Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amdis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aland, Sebastian
amdis
Commits
5f0d2ca0
Commit
5f0d2ca0
authored
Apr 27, 2012
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
At least, it compiles. Will never work, never, never ....
parent
9c8a9a5c
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
516 additions
and
349 deletions
+516
-349
AMDiS/src/AMDiS_fwd.h
AMDiS/src/AMDiS_fwd.h
+1
-0
AMDiS/src/DOFMatrix.cc
AMDiS/src/DOFMatrix.cc
+1
-1
AMDiS/src/DOFVector.h
AMDiS/src/DOFVector.h
+1
-1
AMDiS/src/io/Spreadsheet.cc
AMDiS/src/io/Spreadsheet.cc
+2
-0
AMDiS/src/parallel/DofComm.cc
AMDiS/src/parallel/DofComm.cc
+20
-1
AMDiS/src/parallel/DofComm.h
AMDiS/src/parallel/DofComm.h
+2
-0
AMDiS/src/parallel/ElementObjectDatabase.cc
AMDiS/src/parallel/ElementObjectDatabase.cc
+24
-6
AMDiS/src/parallel/ElementObjectDatabase.h
AMDiS/src/parallel/ElementObjectDatabase.h
+18
-14
AMDiS/src/parallel/InteriorBoundary.cc
AMDiS/src/parallel/InteriorBoundary.cc
+43
-18
AMDiS/src/parallel/InteriorBoundary.h
AMDiS/src/parallel/InteriorBoundary.h
+25
-44
AMDiS/src/parallel/MeshDistributor.cc
AMDiS/src/parallel/MeshDistributor.cc
+130
-83
AMDiS/src/parallel/MeshDistributor.h
AMDiS/src/parallel/MeshDistributor.h
+4
-2
AMDiS/src/parallel/MeshLevelData.h
AMDiS/src/parallel/MeshLevelData.h
+25
-0
AMDiS/src/parallel/ParallelDebug.cc
AMDiS/src/parallel/ParallelDebug.cc
+18
-18
AMDiS/src/parallel/ParallelDofMapping.cc
AMDiS/src/parallel/ParallelDofMapping.cc
+14
-14
AMDiS/src/parallel/ParallelDofMapping.h
AMDiS/src/parallel/ParallelDofMapping.h
+21
-12
AMDiS/src/parallel/PetscSolverFeti.cc
AMDiS/src/parallel/PetscSolverFeti.cc
+110
-85
AMDiS/src/parallel/PetscSolverFeti.h
AMDiS/src/parallel/PetscSolverFeti.h
+6
-4
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
+3
-3
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
+20
-20
AMDiS/src/parallel/PetscSolverSchur.cc
AMDiS/src/parallel/PetscSolverSchur.cc
+12
-12
AMDiS/src/parallel/SubDomainSolver.cc
AMDiS/src/parallel/SubDomainSolver.cc
+13
-9
AMDiS/src/parallel/SubDomainSolver.h
AMDiS/src/parallel/SubDomainSolver.h
+3
-2
No files found.
AMDiS/src/AMDiS_fwd.h
View file @
5f0d2ca0
...
@@ -99,6 +99,7 @@ namespace AMDiS {
...
@@ -99,6 +99,7 @@ namespace AMDiS {
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
class
FeSpaceDofMap
;
class
FeSpaceDofMap
;
class
MeshLevelData
;
#endif
#endif
struct
BoundaryObject
;
struct
BoundaryObject
;
...
...
AMDiS/src/DOFMatrix.cc
View file @
5f0d2ca0
...
@@ -238,7 +238,7 @@ namespace AMDiS {
...
@@ -238,7 +238,7 @@ namespace AMDiS {
if
(
condition
->
applyBoundaryCondition
())
{
if
(
condition
->
applyBoundaryCondition
())
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
if
(
dofMap
->
isRankDof
(
rowIndices
[
i
]
))
if
(
dofMap
->
isRankDof
(
rowIndices
[
i
]
,
0
))
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
));
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
));
#else
#else
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
));
applyDBCs
.
insert
(
static_cast
<
int
>
(
row
));
...
...
AMDiS/src/DOFVector.h
View file @
5f0d2ca0
...
@@ -248,7 +248,7 @@ namespace AMDiS {
...
@@ -248,7 +248,7 @@ namespace AMDiS {
{
{
TEST_EXIT_DBG
(
dofMap
)(
"No rank dofs set!
\n
"
);
TEST_EXIT_DBG
(
dofMap
)(
"No rank dofs set!
\n
"
);
return
dofMap
->
isRankDof
(
dof
);
return
dofMap
->
isRankDof
(
dof
,
0
);
}
}
#endif
#endif
...
...
AMDiS/src/io/Spreadsheet.cc
View file @
5f0d2ca0
...
@@ -54,6 +54,8 @@ namespace AMDiS {
...
@@ -54,6 +54,8 @@ namespace AMDiS {
void
Spreadsheet
::
read
(
string
filename
)
void
Spreadsheet
::
read
(
string
filename
)
{
{
FUNCNAME
(
"Spreadsheet::read()"
);
data
.
clear
();
data
.
clear
();
string
line
;
string
line
;
...
...
AMDiS/src/parallel/DofComm.cc
View file @
5f0d2ca0
...
@@ -42,6 +42,25 @@ namespace AMDiS {
...
@@ -42,6 +42,25 @@ namespace AMDiS {
}
}
int
DofComm
::
getNumberDofs
(
int
level
,
const
FiniteElemSpace
*
feSpace
)
{
FUNCNAME
(
"DofComm::getNumberDofs()"
);
TEST_EXIT_DBG
(
level
<
data
.
size
())(
"Should not happen!
\n
"
);
DofContainerSet
dofs
;
for
(
DataIter
rankIt
=
data
[
level
].
begin
();
rankIt
!=
data
[
level
].
end
();
++
rankIt
)
for
(
FeMapIter
feIt
=
rankIt
->
second
.
begin
();
feIt
!=
rankIt
->
second
.
end
();
++
feIt
)
if
(
feIt
->
first
==
feSpace
)
dofs
.
insert
(
feIt
->
second
.
begin
(),
feIt
->
second
.
end
());
return
static_cast
<
int
>
(
dofs
.
size
());
}
bool
DofComm
::
Iterator
::
setNextFeMap
()
bool
DofComm
::
Iterator
::
setNextFeMap
()
{
{
FUNCNAME
(
"DofComm::Iterator::setNextFeMap()"
);
FUNCNAME
(
"DofComm::Iterator::setNextFeMap()"
);
...
...
AMDiS/src/parallel/DofComm.h
View file @
5f0d2ca0
...
@@ -65,6 +65,8 @@ namespace AMDiS {
...
@@ -65,6 +65,8 @@ namespace AMDiS {
return
data
[
level
];
return
data
[
level
];
}
}
int
getNumberDofs
(
int
level
,
const
FiniteElemSpace
*
feSpace
);
protected:
protected:
LevelDataType
data
;
LevelDataType
data
;
...
...
AMDiS/src/parallel/ElementObjectDatabase.cc
View file @
5f0d2ca0
...
@@ -376,10 +376,14 @@ namespace AMDiS {
...
@@ -376,10 +376,14 @@ namespace AMDiS {
}
}
void
ElementObjectDatabase
::
createRankData
(
map
<
int
,
int
>&
macroElementRankMap
)
void
ElementObjectDatabase
::
createRankData
(
map
<
int
,
int
>&
macroElementRankMap
,
MeshLevelData
&
levelData
)
{
{
FUNCNAME
(
"ElementObjectDatabase::createRankData()"
);
FUNCNAME
(
"ElementObjectDatabase::createRankData()"
);
int
nLevel
=
levelData
.
getLevelNumber
();
TEST_EXIT_DBG
(
nLevel
>
0
)(
"Should not happen!
\n
"
);
vertexOwner
.
clear
();
vertexOwner
.
clear
();
vertexInRank
.
clear
();
vertexInRank
.
clear
();
for
(
map
<
DegreeOfFreedom
,
vector
<
ElementObjectData
>
>::
iterator
it
=
vertexElements
.
begin
();
for
(
map
<
DegreeOfFreedom
,
vector
<
ElementObjectData
>
>::
iterator
it
=
vertexElements
.
begin
();
...
@@ -391,7 +395,11 @@ namespace AMDiS {
...
@@ -391,7 +395,11 @@ namespace AMDiS {
if
(
it2
->
elIndex
>
vertexInRank
[
it
->
first
][
elementInRank
].
elIndex
)
if
(
it2
->
elIndex
>
vertexInRank
[
it
->
first
][
elementInRank
].
elIndex
)
vertexInRank
[
it
->
first
][
elementInRank
]
=
*
it2
;
vertexInRank
[
it
->
first
][
elementInRank
]
=
*
it2
;
vertexOwner
[
it
->
first
]
=
std
::
max
(
vertexOwner
[
it
->
first
],
elementInRank
);
for
(
int
level
=
0
;
level
<
nLevel
;
level
++
)
{
int
levelId
=
levelData
.
getLevelId
(
level
,
elementInRank
);
vertexOwner
[
it
->
first
][
level
]
=
std
::
max
(
vertexOwner
[
it
->
first
][
level
],
levelId
);
}
}
}
}
}
...
@@ -407,7 +415,11 @@ namespace AMDiS {
...
@@ -407,7 +415,11 @@ namespace AMDiS {
if
(
it2
->
elIndex
>
edgeInRank
[
it
->
first
][
elementInRank
].
elIndex
)
if
(
it2
->
elIndex
>
edgeInRank
[
it
->
first
][
elementInRank
].
elIndex
)
edgeInRank
[
it
->
first
][
elementInRank
]
=
*
it2
;
edgeInRank
[
it
->
first
][
elementInRank
]
=
*
it2
;
edgeOwner
[
it
->
first
]
=
std
::
max
(
edgeOwner
[
it
->
first
],
elementInRank
);
for
(
int
level
=
0
;
level
<
nLevel
;
level
++
)
{
int
levelId
=
levelData
.
getLevelId
(
level
,
elementInRank
);
edgeOwner
[
it
->
first
][
level
]
=
std
::
max
(
edgeOwner
[
it
->
first
][
level
],
levelId
);
}
}
}
}
}
...
@@ -423,7 +435,11 @@ namespace AMDiS {
...
@@ -423,7 +435,11 @@ namespace AMDiS {
if
(
it2
->
elIndex
>
faceInRank
[
it
->
first
][
elementInRank
].
elIndex
)
if
(
it2
->
elIndex
>
faceInRank
[
it
->
first
][
elementInRank
].
elIndex
)
faceInRank
[
it
->
first
][
elementInRank
]
=
*
it2
;
faceInRank
[
it
->
first
][
elementInRank
]
=
*
it2
;
faceOwner
[
it
->
first
]
=
std
::
max
(
faceOwner
[
it
->
first
],
elementInRank
);
for
(
int
level
=
0
;
level
<
nLevel
;
level
++
)
{
int
levelId
=
levelData
.
getLevelId
(
level
,
elementInRank
);
faceOwner
[
it
->
first
][
level
]
=
std
::
max
(
faceOwner
[
it
->
first
][
level
],
levelId
);
}
}
}
}
}
}
}
...
@@ -597,11 +613,12 @@ namespace AMDiS {
...
@@ -597,11 +613,12 @@ namespace AMDiS {
}
}
ERROR_EXIT
(
"REWRITE SERIALIZATION!
\n
"
);
/*
SerUtil::serialize(out, vertexOwner);
SerUtil::serialize(out, vertexOwner);
SerUtil::serialize(out, edgeOwner);
SerUtil::serialize(out, edgeOwner);
SerUtil::serialize(out, faceOwner);
SerUtil::serialize(out, faceOwner);
*/
nSize
=
vertexInRank
.
size
();
nSize
=
vertexInRank
.
size
();
SerUtil
::
serialize
(
out
,
nSize
);
SerUtil
::
serialize
(
out
,
nSize
);
...
@@ -737,6 +754,7 @@ namespace AMDiS {
...
@@ -737,6 +754,7 @@ namespace AMDiS {
}
}
ERROR_EXIT
(
"REWRITE DESERIALIZATION!
\n
"
);
SerUtil
::
deserialize
(
in
,
vertexOwner
);
SerUtil
::
deserialize
(
in
,
vertexOwner
);
SerUtil
::
deserialize
(
in
,
edgeOwner
);
SerUtil
::
deserialize
(
in
,
edgeOwner
);
SerUtil
::
deserialize
(
in
,
faceOwner
);
SerUtil
::
deserialize
(
in
,
faceOwner
);
...
...
AMDiS/src/parallel/ElementObjectDatabase.h
View file @
5f0d2ca0
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include <boost/tuple/tuple_comparison.hpp>
#include "AMDiS_fwd.h"
#include "Containers.h"
#include "Containers.h"
#include "Global.h"
#include "Global.h"
#include "Boundary.h"
#include "Boundary.h"
...
@@ -144,7 +145,8 @@ namespace AMDiS {
...
@@ -144,7 +145,8 @@ namespace AMDiS {
* \param[in] macroElementRankMap Maps to each macro element of the mesh
* \param[in] macroElementRankMap Maps to each macro element of the mesh
* the rank that owns this macro element.
* the rank that owns this macro element.
*/
*/
void
createRankData
(
map
<
int
,
int
>&
macroElementRankMap
);
void
createRankData
(
map
<
int
,
int
>&
macroElementRankMap
,
MeshLevelData
&
levelData
);
/** \brief
/** \brief
...
@@ -257,17 +259,17 @@ namespace AMDiS {
...
@@ -257,17 +259,17 @@ namespace AMDiS {
/// Returns the rank owner of the current iterator position.
/// Returns the rank owner of the current iterator position.
int
getIterateOwner
()
int
getIterateOwner
(
int
level
)
{
{
switch
(
iterGeoPos
)
{
switch
(
iterGeoPos
)
{
case
VERTEX
:
case
VERTEX
:
return
vertexOwner
[
vertexIter
->
first
];
return
vertexOwner
[
vertexIter
->
first
]
[
level
]
;
break
;
break
;
case
EDGE
:
case
EDGE
:
return
edgeOwner
[
edgeIter
->
first
];
return
edgeOwner
[
edgeIter
->
first
]
[
level
]
;
break
;
break
;
case
FACE
:
case
FACE
:
return
faceOwner
[
faceIter
->
first
];
return
faceOwner
[
faceIter
->
first
]
[
level
]
;
break
;
break
;
default:
default:
ERROR_EXIT
(
"Should not happen!
\n
"
);
ERROR_EXIT
(
"Should not happen!
\n
"
);
...
@@ -279,21 +281,21 @@ namespace AMDiS {
...
@@ -279,21 +281,21 @@ namespace AMDiS {
/// Returns the rank owner of a vertex DOF.
/// Returns the rank owner of a vertex DOF.
int
getOwner
(
DegreeOfFreedom
vertex
)
int
getOwner
(
DegreeOfFreedom
vertex
,
int
level
)
{
{
return
vertexOwner
[
vertex
];
return
vertexOwner
[
vertex
]
[
level
]
;
}
}
/// Returns the rank owner of an edge.
/// Returns the rank owner of an edge.
int
getOwner
(
DofEdge
edge
)
int
getOwner
(
DofEdge
edge
,
int
level
)
{
{
return
edgeOwner
[
edge
];
return
edgeOwner
[
edge
]
[
level
]
;
}
}
/// Returns the rank owner of an face.
/// Returns the rank owner of an face.
int
getOwner
(
DofFace
face
)
int
getOwner
(
DofFace
face
,
int
level
)
{
{
return
faceOwner
[
face
];
return
faceOwner
[
face
]
[
level
]
;
}
}
...
@@ -540,15 +542,17 @@ namespace AMDiS {
...
@@ -540,15 +542,17 @@ namespace AMDiS {
/// Maps to an element object the corresponding face.
/// Maps to an element object the corresponding face.
map
<
ElementObjectData
,
DofFace
>
faceLocalMap
;
map
<
ElementObjectData
,
DofFace
>
faceLocalMap
;
/// Maps from level to rank number
typedef
map
<
int
,
int
>
LevelRank
;
/// Defines for all vertex DOFs the rank that ownes this vertex DOF.
/// Defines for all vertex DOFs the rank that ownes this vertex DOF.
map
<
DegreeOfFreedom
,
int
>
vertexOwner
;
map
<
DegreeOfFreedom
,
LevelRank
>
vertexOwner
;
/// Defines for all edges the rank that ownes this edge.
/// Defines for all edges the rank that ownes this edge.
map
<
DofEdge
,
int
>
edgeOwner
;
map
<
DofEdge
,
LevelRank
>
edgeOwner
;
/// Defines for all faces the rank that ownes this face.
/// Defines for all faces the rank that ownes this face.
map
<
DofFace
,
int
>
faceOwner
;
map
<
DofFace
,
LevelRank
>
faceOwner
;
/// Defines to each vertex DOF a map that maps to each rank number the element
/// Defines to each vertex DOF a map that maps to each rank number the element
...
...
AMDiS/src/parallel/InteriorBoundary.cc
View file @
5f0d2ca0
...
@@ -18,10 +18,11 @@
...
@@ -18,10 +18,11 @@
namespace
AMDiS
{
namespace
AMDiS
{
AtomicBoundary
&
InteriorBoundary
::
getNewAtomic
(
int
rank
)
AtomicBoundary
&
InteriorBoundary
::
getNewAtomic
(
int
level
,
int
rank
)
{
{
boundary
[
rank
].
resize
(
boundary
[
rank
].
size
()
+
1
);
int
size
=
boundary
[
level
][
rank
].
size
();
return
boundary
[
rank
][
boundary
[
rank
].
size
()
-
1
];
boundary
[
level
][
rank
].
resize
(
size
+
1
);
return
boundary
[
level
][
rank
][
size
];
}
}
...
@@ -29,32 +30,51 @@ namespace AMDiS {
...
@@ -29,32 +30,51 @@ namespace AMDiS {
{
{
InteriorBoundary
&
other2
=
const_cast
<
InteriorBoundary
&>
(
other
);
InteriorBoundary
&
other2
=
const_cast
<
InteriorBoundary
&>
(
other
);
for
(
RankToBoundMap
::
const_iterator
it
=
boundary
.
begin
();
if
(
boundary
.
size
()
!=
other2
.
boundary
.
size
())
it
!=
boundary
.
end
();
++
it
)
{
return
false
;
if
(
other2
.
boundary
.
count
(
it
->
first
)
==
0
)
for
(
unsigned
int
level
=
0
;
level
<
boundary
.
size
();
level
++
)
{
for
(
RankToBoundMap
::
const_iterator
it
=
boundary
[
level
].
begin
();
it
!=
boundary
[
level
].
end
();
++
it
)
{
if
(
other2
.
boundary
[
level
].
count
(
it
->
first
)
==
0
)
return
false
;
return
false
;
if
(
other2
.
boundary
[
it
->
first
].
size
()
!=
it
->
second
.
size
())
if
(
other2
.
boundary
[
level
]
[
it
->
first
].
size
()
!=
it
->
second
.
size
())
return
false
;
return
false
;
for
(
unsigned
int
i
=
0
;
i
<
it
->
second
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
it
->
second
.
size
();
i
++
)
{
std
::
vector
<
AtomicBoundary
>::
iterator
bIt
=
std
::
vector
<
AtomicBoundary
>::
iterator
bIt
=
find
(
other2
.
boundary
[
it
->
first
].
begin
(),
find
(
other2
.
boundary
[
level
]
[
it
->
first
].
begin
(),
other2
.
boundary
[
it
->
first
].
end
(),
it
->
second
[
i
]);
other2
.
boundary
[
level
]
[
it
->
first
].
end
(),
it
->
second
[
i
]);
if
(
bIt
==
other2
.
boundary
[
it
->
first
].
end
())
if
(
bIt
==
other2
.
boundary
[
level
]
[
it
->
first
].
end
())
return
false
;
return
false
;
}
}
}
}
}
return
true
;
return
true
;
}
}
void
InteriorBoundary
::
reset
(
int
level
)
{
FUNCNAME
(
"InteriorBoundary::reset()"
);
nLevel
=
level
;
boundary
.
clear
();
boundary
.
resize
(
nLevel
);
}
void
InteriorBoundary
::
serialize
(
std
::
ostream
&
out
)
void
InteriorBoundary
::
serialize
(
std
::
ostream
&
out
)
{
{
FUNCNAME
(
"InteriorBoundary::serialize()"
);
FUNCNAME
(
"InteriorBoundary::serialize()"
);
ERROR_EXIT
(
"REWRITE TO MULTILEVEL STRUCTURE!
\n
"
);
#if 0
int mSize = boundary.size();
int mSize = boundary.size();
SerUtil::serialize(out, mSize);
SerUtil::serialize(out, mSize);
for (RankToBoundMap::iterator it = boundary.begin();
for (RankToBoundMap::iterator it = boundary.begin();
...
@@ -83,6 +103,7 @@ namespace AMDiS {
...
@@ -83,6 +103,7 @@ namespace AMDiS {
SerUtil::serialize(out, bound.type);
SerUtil::serialize(out, bound.type);
}
}
}
}
#endif
}
}
...
@@ -91,6 +112,9 @@ namespace AMDiS {
...
@@ -91,6 +112,9 @@ namespace AMDiS {
{
{
FUNCNAME
(
"InteriorBoundary::deserialize()"
);
FUNCNAME
(
"InteriorBoundary::deserialize()"
);
ERROR_EXIT
(
"REWRITE TO MULTILEVEL STRUCTURE!
\n
"
);
#if 0
int mSize = 0;
int mSize = 0;
SerUtil::deserialize(in, mSize);
SerUtil::deserialize(in, mSize);
for (int i = 0; i < mSize; i++) {
for (int i = 0; i < mSize; i++) {
...
@@ -137,6 +161,7 @@ namespace AMDiS {
...
@@ -137,6 +161,7 @@ namespace AMDiS {
bound.neighObj.el = NULL;
bound.neighObj.el = NULL;
}
}
}
}
#endif
}
}
...
...
AMDiS/src/parallel/InteriorBoundary.h
View file @
5f0d2ca0
...
@@ -47,34 +47,35 @@ namespace AMDiS {
...
@@ -47,34 +47,35 @@ namespace AMDiS {
public:
public:
iterator
(
InteriorBoundary
&
b
)
iterator
(
InteriorBoundary
&
b
)
:
bound
(
b
),
:
bound
(
b
),
levelData
(
NULL
),
level
(
0
)
level
(
0
)
{
{
reset
();
reset
();
}
}
iterator
(
InteriorBoundary
&
b
,
MeshLevelData
&
levelData
,
int
level
)
iterator
(
InteriorBoundary
&
b
,
int
level
)
:
bound
(
b
),
:
bound
(
b
),
levelData
(
&
levelData
),
level
(
level
)
level
(
level
)
{
{
TEST_EXIT_DBG
(
level
<
bound
.
boundary
.
size
())
(
"Should not happen!
\n
"
);
reset
();
reset
();
}
}
/// Set the iterator to the first position.
/// Set the iterator to the first position.
void
reset
()
void
reset
()
{
{
mapIt
=
bound
.
boundary
.
begin
();
mapIt
=
bound
.
boundary
[
level
]
.
begin
();
nextNonempty
();
nextNonempty
();
if
(
mapIt
!=
bound
.
boundary
.
end
())
if
(
mapIt
!=
bound
.
boundary
[
level
]
.
end
())
vecIt
=
mapIt
->
second
.
begin
();
vecIt
=
mapIt
->
second
.
begin
();
}
}
/// Test if iterator is at the final position.
/// Test if iterator is at the final position.
bool
end
()
const
bool
end
()
const
{
{
return
(
mapIt
==
bound
.
boundary
.
end
());
return
(
mapIt
==
bound
.
boundary
[
level
]
.
end
());
}
}
/// Move iterator to the next position.
/// Move iterator to the next position.
...
@@ -85,7 +86,7 @@ namespace AMDiS {
...
@@ -85,7 +86,7 @@ namespace AMDiS {
++
mapIt
;
++
mapIt
;
nextNonempty
();
nextNonempty
();
if
(
mapIt
!=
bound
.
boundary
.
end
())
if
(
mapIt
!=
bound
.
boundary
[
level
]
.
end
())
vecIt
=
mapIt
->
second
.
begin
();
vecIt
=
mapIt
->
second
.
begin
();
}
}
}
}
...
@@ -105,22 +106,12 @@ namespace AMDiS {
...
@@ -105,22 +106,12 @@ namespace AMDiS {
++
mapIt
;
++
mapIt
;
nextNonempty
();
nextNonempty
();
if
(
mapIt
!=
bound
.
boundary
.
end
())
if
(
mapIt
!=
bound
.
boundary
[
level
]
.
end
())
vecIt
=
mapIt
->
second
.
begin
();
vecIt
=
mapIt
->
second
.
begin
();
}
}
inline
int
getRank
()
inline
int
getRank
()
{
{
if
(
level
>
0
)
{
int
r
=
levelData
->
mapRank
(
mapIt
->
first
,
level
-
1
,
level
);
TEST_EXIT_DBG
(
r
>=
0
)
(
"Mapping rank %d from level % to level %d does not work!
\n
"
,
mapIt
->
first
,
level
-
1
,
level
);
return
r
;
}
return
mapIt
->
first
;
return
mapIt
->
first
;
}
}
...
@@ -128,27 +119,15 @@ namespace AMDiS {
...
@@ -128,27 +119,15 @@ namespace AMDiS {
inline
void
nextNonempty
()
inline
void
nextNonempty
()
{
{
if
(
mapIt
==
bound
.
boundary
.
end
())
if
(
mapIt
==
bound
.
boundary
[
level
]
.
end
())
return
;
return
;
if
(
level
>
0
)
{
TEST_EXIT_DBG
(
levelData
)(
"No mesh level data object defined!
\n
"
);
TEST_EXIT_DBG
(
level
==
1
)(
"Only 2-level method supported!
\n
"
);
while
(
!
levelData
->
rankInSubdomain
(
mapIt
->
first
,
level
)
||
mapIt
->
second
.
size
()
==
0
)
{
++
mapIt
;
if
(
mapIt
==
bound
.
boundary
.
end
())
return
;
}
}
else
{
while
(
mapIt
->
second
.
size
()
==
0
)
{
while
(
mapIt
->
second
.
size
()
==
0
)
{
++
mapIt
;
++
mapIt
;
if
(
mapIt
==
bound
.
boundary
.
end
())
if
(
mapIt
==
bound
.
boundary
[
level
]
.
end
())
return
;
return
;
}
}
}
}
}
protected:
protected:
RankToBoundMap
::
iterator
mapIt
;
RankToBoundMap
::
iterator
mapIt
;
...
@@ -157,20 +136,19 @@ namespace AMDiS {
...
@@ -157,20 +136,19 @@ namespace AMDiS {
InteriorBoundary
&
bound
;
InteriorBoundary
&
bound
;