Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
7c59d88b
Commit
7c59d88b
authored
Aug 17, 2009
by
Thomas Witkowski
Browse files
Fixed bug for mesh partitioning with 16 or more procs.
parent
4930cf1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/ParallelDomainBase.cc
View file @
7c59d88b
...
@@ -82,6 +82,9 @@ namespace AMDiS {
...
@@ -82,6 +82,9 @@ namespace AMDiS {
#if (DEBUG != 0)
#if (DEBUG != 0)
ElementIdxToDofs
elMap
;
ElementIdxToDofs
elMap
;
DbgCreateElementMap
(
elMap
);
DbgCreateElementMap
(
elMap
);
if
(
mpiRank
==
0
)
writePartitioningMesh
(
"part.vtu"
);
#endif
#endif
// === Create new global and local DOF numbering. ===
// === Create new global and local DOF numbering. ===
...
@@ -748,6 +751,7 @@ namespace AMDiS {
...
@@ -748,6 +751,7 @@ namespace AMDiS {
PartitionElementData
*
partitionData
=
PartitionElementData
*
partitionData
=
dynamic_cast
<
PartitionElementData
*>
(
element
->
getElementData
(
PARTITION_ED
));
dynamic_cast
<
PartitionElementData
*>
(
element
->
getElementData
(
PARTITION_ED
));
if
(
partitionData
->
getPartitionStatus
()
==
IN
)
{
if
(
partitionData
->
getPartitionStatus
()
==
IN
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
if
(
!
elInfo
->
getNeighbour
(
i
))
if
(
!
elInfo
->
getNeighbour
(
i
))
...
@@ -759,39 +763,13 @@ namespace AMDiS {
...
@@ -759,39 +763,13 @@ namespace AMDiS {
if
(
neighbourPartitionData
->
getPartitionStatus
()
==
OUT
)
{
if
(
neighbourPartitionData
->
getPartitionStatus
()
==
OUT
)
{
// We have found an element that is at an interior boundary.
// We have found an element that is at an interior boundary.
// === Find out, if the boundary part of the element corresponds to the ===
int
otherElementRank
=
partitionVec
[
elInfo
->
getNeighbour
(
i
)
->
getIndex
()];
// === rank or to the rank "on the other side" of the interoir boundary. ===
bool
ranksBoundary
=
(
mpiRank
>
otherElementRank
);
const
DegreeOfFreedom
*
boundDOF1
=
NULL
;
const
DegreeOfFreedom
*
boundDOF2
=
NULL
;
switch
(
i
)
{
case
0
:
boundDOF1
=
element
->
getDOF
(
1
);
boundDOF2
=
element
->
getDOF
(
2
);
break
;
case
1
:
boundDOF1
=
element
->
getDOF
(
0
);
boundDOF2
=
element
->
getDOF
(
2
);
break
;
case
2
:
boundDOF1
=
element
->
getDOF
(
0
);
boundDOF2
=
element
->
getDOF
(
1
);
break
;
default:
ERROR_EXIT
(
"Should never happen!
\n
"
);
}
bool
isRankDOF1
=
(
find
(
rankDOFs
.
begin
(),
rankDOFs
.
end
(),
boundDOF1
)
!=
rankDOFs
.
end
());
bool
isRankDOF2
=
(
find
(
rankDOFs
.
begin
(),
rankDOFs
.
end
(),
boundDOF2
)
!=
rankDOFs
.
end
());
bool
ranksBoundary
=
isRankDOF1
||
isRankDOF2
;
// === And add the part of the interior boundary. ===
AtomicBoundary
&
bound
=
AtomicBoundary
&
bound
=
(
ranksBoundary
?
(
ranksBoundary
?
myIntBoundary
.
getNewAtomicBoundary
(
partitionVec
[
elInfo
->
getNeighbour
(
i
)
->
getIndex
()]
)
:
myIntBoundary
.
getNewAtomicBoundary
(
otherElementRank
)
:
otherIntBoundary
.
getNewAtomicBoundary
(
partitionVec
[
elInfo
->
getNeighbour
(
i
)
->
getIndex
()]
));
otherIntBoundary
.
getNewAtomicBoundary
(
otherElementRank
));
bound
.
rankObject
.
el
=
element
;
bound
.
rankObject
.
el
=
element
;
bound
.
rankObject
.
elIndex
=
element
->
getIndex
();
bound
.
rankObject
.
elIndex
=
element
->
getIndex
();
...
@@ -1772,6 +1750,26 @@ namespace AMDiS {
...
@@ -1772,6 +1750,26 @@ namespace AMDiS {
}
}
}
}
void
ParallelDomainBase
::
writePartitioningMesh
(
std
::
string
filename
)
{
FUNCNAME
(
"ParallelDomainBase::writePartitioningMesh()"
);
std
::
map
<
int
,
double
>
vec
;
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
);
while
(
elInfo
)
{
int
index
=
elInfo
->
getElement
()
->
getIndex
();
vec
[
index
]
=
partitionVec
[
index
];
elInfo
=
stack
.
traverseNext
(
elInfo
);
}
ElementFileWriter
::
writeFile
(
vec
,
feSpace
,
filename
);
}
Flag
ParallelDomainBase
::
oneIteration
(
AdaptInfo
*
adaptInfo
,
Flag
toDo
)
Flag
ParallelDomainBase
::
oneIteration
(
AdaptInfo
*
adaptInfo
,
Flag
toDo
)
{
{
FUNCNAME
(
"ParallelDomainBase::oneIteration()"
);
FUNCNAME
(
"ParallelDomainBase::oneIteration()"
);
...
...
AMDiS/src/ParallelDomainBase.h
View file @
7c59d88b
...
@@ -272,6 +272,13 @@ namespace AMDiS {
...
@@ -272,6 +272,13 @@ namespace AMDiS {
*/
*/
void
DbgTestCommonDofs
(
bool
printCoords
=
false
);
void
DbgTestCommonDofs
(
bool
printCoords
=
false
);
/** \brief
* This functions create a Paraview file with the macro mesh where the elements
* are colored by the partition they are part of. This function can be used for
* debugging.
*/
void
writePartitioningMesh
(
std
::
string
filename
);
inline
void
orderDOFs
(
const
DegreeOfFreedom
*
dof1
,
inline
void
orderDOFs
(
const
DegreeOfFreedom
*
dof1
,
const
DegreeOfFreedom
*
dof2
,
const
DegreeOfFreedom
*
dof2
,
const
DegreeOfFreedom
*
dof3
,
const
DegreeOfFreedom
*
dof3
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment