Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
iwr
amdis
Commits
ecb93cc3
Commit
ecb93cc3
authored
Oct 23, 2012
by
Thomas Witkowski
Browse files
Fixed FETI-DP for Stokes problem.
parent
e8e207b4
Changes
14
Show whitespace changes
Inline
Side-by-side
AMDiS/src/MatrixVector.cc
View file @
ecb93cc3
...
...
@@ -16,23 +16,4 @@
namespace
AMDiS
{
vector
<
const
FiniteElemSpace
*>
getComponentFeSpaces
(
Matrix
<
DOFMatrix
*>
&
mat
)
{
FUNCNAME
(
"getComponentFeSpaces()"
);
int
nComponents
=
mat
.
getNumRows
();
vector
<
const
FiniteElemSpace
*>
result
(
nComponents
);
for
(
int
i
=
0
;
i
<
nComponents
;
i
++
)
{
for
(
int
j
=
0
;
j
<
nComponents
;
j
++
)
{
if
(
mat
[
i
][
j
])
{
result
[
i
]
=
mat
[
i
][
j
]
->
getRowFeSpace
();
break
;
}
}
}
return
result
;
}
}
AMDiS/src/MatrixVector.h
View file @
ecb93cc3
...
...
@@ -518,11 +518,6 @@ namespace AMDiS {
z
[
1
]
=
x
[
2
]
*
y
[
0
]
-
x
[
0
]
*
y
[
2
];
z
[
2
]
=
x
[
0
]
*
y
[
1
]
-
x
[
1
]
*
y
[
0
];
}
/// Returns a vector with the FE spaces of each row in the matrix. Thus, the
/// resulting vector may contain the same FE space multiple times.
vector
<
const
FiniteElemSpace
*>
getComponentFeSpaces
(
Matrix
<
DOFMatrix
*>
&
mat
);
}
#endif // AMDIS_MATRIXVECTOR_H
AMDiS/src/ProblemStat.h
View file @
ecb93cc3
...
...
@@ -334,7 +334,7 @@ namespace AMDiS {
}
/// Returns \ref componentSpaces;
inline
vector
<
const
FiniteElemSpace
*>
getComponent
Fe
Spaces
()
inline
vector
<
const
FiniteElemSpace
*>
getComponentSpaces
()
{
return
componentSpaces
;
}
...
...
AMDiS/src/SystemVector.cc
View file @
ecb93cc3
...
...
@@ -35,14 +35,4 @@ namespace AMDiS {
vectors
[
i
]
->
deserialize
(
in
);
}
vector
<
const
FiniteElemSpace
*>
SystemVector
::
getComponentFeSpaces
()
const
{
vector
<
const
FiniteElemSpace
*>
result
(
vectors
.
size
());
for
(
unsigned
int
i
=
0
;
i
<
vectors
.
size
();
i
++
)
result
[
i
]
=
vectors
[
i
]
->
getFeSpace
();
return
result
;
}
}
AMDiS/src/SystemVector.h
View file @
ecb93cc3
...
...
@@ -120,8 +120,6 @@ namespace AMDiS {
return
feSpace
;
}
vector
<
const
FiniteElemSpace
*>
getComponentFeSpaces
()
const
;
/// Here the system vector is interpreted as one large vector. The given
/// is used as a global index which indicates a local vector number and
/// a local index on this vector. The operator returns this local vector
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
ecb93cc3
...
...
@@ -160,18 +160,18 @@ namespace AMDiS {
bool
doNext
=
false
;
do
{
doNext
=
false
;
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
()
-
1
;
i
++
)
{
if
(
uniqueF
eSpaces
[
i
]
->
getBasisFcts
()
->
getDegree
()
>
uniqueF
eSpaces
[
i
+
1
]
->
getBasisFcts
()
->
getDegree
())
{
const
FiniteElemSpace
*
tmp
=
uniqueF
eSpaces
[
i
+
1
];
uniqueF
eSpaces
[
i
+
1
]
=
uniqueF
eSpaces
[
i
];
uniqueF
eSpaces
[
i
]
=
tmp
;
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
()
-
1
;
i
++
)
{
if
(
f
eSpaces
[
i
]
->
getBasisFcts
()
->
getDegree
()
>
f
eSpaces
[
i
+
1
]
->
getBasisFcts
()
->
getDegree
())
{
const
FiniteElemSpace
*
tmp
=
f
eSpaces
[
i
+
1
];
f
eSpaces
[
i
+
1
]
=
f
eSpaces
[
i
];
f
eSpaces
[
i
]
=
tmp
;
doNext
=
true
;
}
}
}
while
(
doNext
);
elObjDb
.
setFeSpace
(
uniqueF
eSpaces
[
0
]);
elObjDb
.
setFeSpace
(
f
eSpaces
[
0
]);
// If required, create hierarchical mesh level structure.
createMeshLevelStructure
();
...
...
@@ -193,7 +193,7 @@ namespace AMDiS {
elObjDb
.
setData
(
partitionMap
,
levelData
);
#if (DEBUG != 0)
ParallelDebug
::
writeDebugFile
(
uniqueF
eSpaces
[
uniqueF
eSpaces
.
size
()
-
1
],
ParallelDebug
::
writeDebugFile
(
f
eSpaces
[
f
eSpaces
.
size
()
-
1
],
dofMap
,
debugOutputDir
+
"mpi-dbg"
,
"dat"
);
#endif
...
...
@@ -318,7 +318,7 @@ namespace AMDiS {
ParallelDebug
::
testInteriorBoundary
(
*
this
);
ParallelDebug
::
followBoundary
(
*
this
);
debug
::
writeMesh
(
uniqueF
eSpaces
[
0
],
-
1
,
debugOutputDir
+
"macro_mesh"
);
debug
::
writeMesh
(
f
eSpaces
[
0
],
-
1
,
debugOutputDir
+
"macro_mesh"
);
MSG
(
"Debug mode tests finished!
\n
"
);
#endif
...
...
@@ -369,9 +369,9 @@ namespace AMDiS {
TEST_EXIT
(
componentSpaces
.
size
()
==
0
)
(
"Parallelization of coupled problems is deactived at the moment!
\n
"
);
componentSpaces
=
probStat
->
getComponent
Fe
Spaces
();
uniqueF
eSpaces
=
probStat
->
getFeSpaces
();
mesh
=
uniqueF
eSpaces
[
0
]
->
getMesh
();
componentSpaces
=
probStat
->
getComponentSpaces
();
f
eSpaces
=
probStat
->
getFeSpaces
();
mesh
=
f
eSpaces
[
0
]
->
getMesh
();
info
=
probStat
->
getInfo
();
switch
(
mesh
->
getDim
())
{
...
...
@@ -668,8 +668,8 @@ namespace AMDiS {
DofEdge
dofEdge1
=
edge1
.
first
->
getEdge
(
edge1
.
second
);
WorldVector
<
double
>
c0
,
c1
;
mesh
->
getDofIndexCoords
(
dofEdge0
.
first
,
uniqueF
eSpaces
[
0
],
c0
);
mesh
->
getDofIndexCoords
(
dofEdge0
.
second
,
uniqueF
eSpaces
[
0
],
c1
);
mesh
->
getDofIndexCoords
(
dofEdge0
.
first
,
f
eSpaces
[
0
],
c0
);
mesh
->
getDofIndexCoords
(
dofEdge0
.
second
,
f
eSpaces
[
0
],
c1
);
MSG
(
"FOUND EDGE %d/%d <-> %d/%d
\n
"
,
edge0
.
first
->
getIndex
(),
edge0
.
second
,
...
...
@@ -966,7 +966,7 @@ namespace AMDiS {
MPI
::
Wtime
()
-
first
);
#if (DEBUG != 0)
debug
::
writeMesh
(
uniqueF
eSpaces
[
0
],
-
1
,
debugOutputDir
+
"mesh"
);
debug
::
writeMesh
(
f
eSpaces
[
0
],
-
1
,
debugOutputDir
+
"mesh"
);
#endif
// Because the mesh has been changed, update the DOF numbering and mappings.
...
...
@@ -1267,7 +1267,7 @@ namespace AMDiS {
if
(
writePartMesh
>
0
&&
repartitioningCounter
==
0
)
ParallelDebug
::
writePartitioningFile
(
debugOutputDir
+
"partitioning"
,
repartitioningCounter
,
uniqueF
eSpaces
[
0
]);
f
eSpaces
[
0
]);
repartitioningCounter
++
;
...
...
@@ -1298,7 +1298,7 @@ namespace AMDiS {
// === Run mesh partitioner to calculate a new mesh partitioning. ===
partitioner
->
setLocalGlobalDofMap
(
&
(
dofMap
[
uniqueF
eSpaces
[
0
]].
getMap
()));
partitioner
->
setLocalGlobalDofMap
(
&
(
dofMap
[
f
eSpaces
[
0
]].
getMap
()));
bool
partitioningSucceed
=
partitioner
->
partition
(
elemWeights
,
ADAPTIVE_REPART
);
if
(
!
partitioningSucceed
)
{
...
...
@@ -1475,11 +1475,11 @@ namespace AMDiS {
// Note that also if there are no macros to be deleted, this function will
// update the number of elements, vertices, etc. of the mesh.
mesh
->
removeMacroElements
(
deleteMacroElements
,
uniqueF
eSpaces
);
mesh
->
removeMacroElements
(
deleteMacroElements
,
f
eSpaces
);
// === Remove double DOFs. ===
MeshManipulation
meshManipulation
(
mesh
);
meshManipulation
.
deleteDoubleDofs
(
uniqueF
eSpaces
,
newMacroEl
,
elObjDb
);
meshManipulation
.
deleteDoubleDofs
(
f
eSpaces
,
newMacroEl
,
elObjDb
);
mesh
->
dofCompress
();
partitioner
->
createPartitionMap
(
partitionMap
);
...
...
@@ -1515,7 +1515,7 @@ namespace AMDiS {
ParallelDebug
::
writePartitioningFile
(
debugOutputDir
+
"partitioning"
,
repartitioningCounter
,
uniqueF
eSpaces
[
0
]);
f
eSpaces
[
0
]);
ParallelDebug
::
testAllElements
(
*
this
);
ParallelDebug
::
testDoubleDofs
(
mesh
);
ParallelDebug
::
testInteriorBoundary
(
*
this
);
...
...
@@ -1561,11 +1561,11 @@ namespace AMDiS {
// === Create DOF communicator. ===
dofComm
.
init
(
0
,
levelData
,
uniqueF
eSpaces
);
dofComm
.
init
(
0
,
levelData
,
f
eSpaces
);
dofComm
.
create
(
intBoundary
);
if
(
levelData
.
getLevelNumber
()
>
1
)
{
dofCommSd
.
init
(
0
,
levelData
,
uniqueF
eSpaces
);
dofCommSd
.
init
(
0
,
levelData
,
f
eSpaces
);
dofCommSd
.
create
(
intBoundarySd
);
}
...
...
@@ -1577,8 +1577,8 @@ namespace AMDiS {
int
nLevels
=
levelData
.
getLevelNumber
();
boundaryDofInfo
.
resize
(
nLevels
);
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
uniqueF
eSpaces
[
i
];
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
f
eSpaces
[
i
];
for
(
int
level
=
0
;
level
<
nLevels
;
level
++
)
{
...
...
@@ -1630,7 +1630,7 @@ namespace AMDiS {
if
(
partitioner
->
getElementInRank
()[(
*
it
)
->
getIndex
()]
==
false
)
macrosToRemove
.
insert
(
*
it
);
mesh
->
removeMacroElements
(
macrosToRemove
,
uniqueF
eSpaces
);
mesh
->
removeMacroElements
(
macrosToRemove
,
f
eSpaces
);
}
...
...
@@ -1651,13 +1651,13 @@ namespace AMDiS {
int
nLevels
=
levelData
.
getLevelNumber
();
TEST_EXIT_DBG
(
nLevels
>=
1
)(
"Should not happen!
\n
"
);
dofMap
.
init
(
levelData
,
componentSpaces
,
uniqueF
eSpaces
);
dofMap
.
init
(
levelData
,
componentSpaces
,
f
eSpaces
);
dofMap
.
setMpiComm
(
levelData
.
getMpiComm
(
0
),
0
);
dofMap
.
setDofComm
(
dofComm
);
dofMap
.
clear
();
if
(
nLevels
>
1
)
{
dofMapSd
.
init
(
levelData
,
componentSpaces
,
uniqueF
eSpaces
);
dofMapSd
.
init
(
levelData
,
componentSpaces
,
f
eSpaces
);
dofMapSd
.
setMpiComm
(
levelData
.
getMpiComm
(
1
),
1
);
dofMapSd
.
setDofComm
(
dofCommSd
);
dofMapSd
.
clear
();
...
...
@@ -1665,13 +1665,13 @@ namespace AMDiS {
createBoundaryDofs
();
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
updateLocalGlobalNumbering
(
dofMap
,
dofComm
,
uniqueF
eSpaces
[
i
]);
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
updateLocalGlobalNumbering
(
dofMap
,
dofComm
,
f
eSpaces
[
i
]);
dofMap
.
update
();
if
(
nLevels
>
1
)
{
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
updateLocalGlobalNumbering
(
dofMapSd
,
dofCommSd
,
uniqueF
eSpaces
[
i
]);
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
updateLocalGlobalNumbering
(
dofMapSd
,
dofCommSd
,
f
eSpaces
[
i
]);
dofMapSd
.
update
();
}
...
...
@@ -1685,28 +1685,28 @@ namespace AMDiS {
MSG
(
"------------- Debug information -------------
\n
"
);
MSG
(
"| number of levels: %d
\n
"
,
nLevels
);
MSG
(
"| number of FE spaces: %d
\n
"
,
uniqueF
eSpaces
.
size
());
MSG
(
"| number of FE spaces: %d
\n
"
,
f
eSpaces
.
size
());
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
{
MSG
(
"| FE space = %d (pointer adr %p):
\n
"
,
i
,
uniqueF
eSpaces
[
i
]);
MSG
(
"| nRankDofs = %d
\n
"
,
dofMap
[
uniqueF
eSpaces
[
i
]].
nRankDofs
);
MSG
(
"| nOverallDofs = %d
\n
"
,
dofMap
[
uniqueF
eSpaces
[
i
]].
nOverallDofs
);
MSG
(
"| rStartDofs = %d
\n
"
,
dofMap
[
uniqueF
eSpaces
[
i
]].
rStartDofs
);
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
{
MSG
(
"| FE space = %d (pointer adr %p):
\n
"
,
i
,
f
eSpaces
[
i
]);
MSG
(
"| nRankDofs = %d
\n
"
,
dofMap
[
f
eSpaces
[
i
]].
nRankDofs
);
MSG
(
"| nOverallDofs = %d
\n
"
,
dofMap
[
f
eSpaces
[
i
]].
nOverallDofs
);
MSG
(
"| rStartDofs = %d
\n
"
,
dofMap
[
f
eSpaces
[
i
]].
rStartDofs
);
}
if
(
nLevels
>
1
)
{
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
{
MSG
(
"| FE space = %d:
\n
"
,
i
);
MSG
(
"| nRankDofs = %d
\n
"
,
dofMapSd
[
uniqueF
eSpaces
[
i
]].
nRankDofs
);
MSG
(
"| nOverallDofs = %d
\n
"
,
dofMapSd
[
uniqueF
eSpaces
[
i
]].
nOverallDofs
);
MSG
(
"| rStartDofs = %d
\n
"
,
dofMapSd
[
uniqueF
eSpaces
[
i
]].
rStartDofs
);
MSG
(
"| nRankDofs = %d
\n
"
,
dofMapSd
[
f
eSpaces
[
i
]].
nRankDofs
);
MSG
(
"| nOverallDofs = %d
\n
"
,
dofMapSd
[
f
eSpaces
[
i
]].
nOverallDofs
);
MSG
(
"| rStartDofs = %d
\n
"
,
dofMapSd
[
f
eSpaces
[
i
]].
rStartDofs
);
}
}
// debug::writeElementIndexMesh(mesh, debugOutputDir + "elementIndex-" +
// lexical_cast<string>(mpiRank) + ".vtu");
ParallelDebug
::
writeDebugFile
(
uniqueF
eSpaces
[
uniqueF
eSpaces
.
size
()
-
1
],
ParallelDebug
::
writeDebugFile
(
f
eSpaces
[
f
eSpaces
.
size
()
-
1
],
dofMap
,
debugOutputDir
+
"mpi-dbg"
,
"dat"
);
debug
::
testSortedDofs
(
mesh
,
elMap
);
...
...
@@ -1718,15 +1718,15 @@ namespace AMDiS {
ParallelDebug
::
testGlobalIndexByCoords
(
*
this
);
}
#else
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
MSG
(
"FE space %d: nRankDofs = %d nOverallDofs = %d
\n
"
,
i
,
dofMap
[
uniqueF
eSpaces
[
i
]].
nRankDofs
,
dofMap
[
uniqueF
eSpaces
[
i
]].
nOverallDofs
);
i
,
dofMap
[
f
eSpaces
[
i
]].
nRankDofs
,
dofMap
[
f
eSpaces
[
i
]].
nOverallDofs
);
int
tmp
=
0
;
Parameters
::
get
(
name
+
"->write parallel debug file"
,
tmp
);
if
(
tmp
)
ParallelDebug
::
writeDebugFile
(
uniqueF
eSpaces
[
uniqueF
eSpaces
.
size
()
-
1
],
ParallelDebug
::
writeDebugFile
(
f
eSpaces
[
f
eSpaces
.
size
()
-
1
],
dofMap
,
debugOutputDir
+
"mpi-dbg"
,
"dat"
);
#endif
...
...
@@ -1784,8 +1784,8 @@ namespace AMDiS {
// MPI::COMM_WORLD.Barrier(); [TODO: CHANGE BECAUSE NOT ALL RANKS HAVE PERIODIC MAP!!!]
double
first
=
MPI
::
Wtime
();
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
createPeriodicMap
(
uniqueF
eSpaces
[
i
]);
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
createPeriodicMap
(
f
eSpaces
[
i
]);
// MPI::COMM_WORLD.Barrier();
INFO
(
info
,
8
)(
"Creation of periodic mapping needed %.5f seconds
\n
"
,
...
...
@@ -2022,14 +2022,14 @@ namespace AMDiS {
// Create a map from DOF indices to the corresponding DOF pointers.
map
<
const
FiniteElemSpace
*
,
map
<
int
,
const
DegreeOfFreedom
*>
>
dofIndexMap
;
for
(
unsigned
int
i
=
0
;
i
<
uniqueF
eSpaces
.
size
();
i
++
)
{
ElementDofIterator
elDofIter
(
uniqueF
eSpaces
[
i
]);
for
(
unsigned
int
i
=
0
;
i
<
f
eSpaces
.
size
();
i
++
)
{
ElementDofIterator
elDofIter
(
f
eSpaces
[
i
]);
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_LEAF_EL
);
while
(
elInfo
)
{
elDofIter
.
reset
(
elInfo
->
getElement
());
do
{
dofIndexMap
[
uniqueF
eSpaces
[
i
]][
elDofIter
.
getDof
()]
=
elDofIter
.
getDofPtr
();
dofIndexMap
[
f
eSpaces
[
i
]][
elDofIter
.
getDof
()]
=
elDofIter
.
getDofPtr
();
}
while
(
elDofIter
.
next
());
elInfo
=
stack
.
traverseNext
(
elInfo
);
...
...
AMDiS/src/parallel/MeshDistributor.h
View file @
ecb93cc3
...
...
@@ -137,20 +137,20 @@ namespace AMDiS {
{
FUNCNAME
(
"MeshDistributor::getFeSpace()"
);
TEST_EXIT_DBG
(
i
<
uniqueF
eSpaces
.
size
())
TEST_EXIT_DBG
(
i
<
f
eSpaces
.
size
())
(
"Try to access FE space %d, but have only %d FE spaces!
\n
"
,
i
,
uniqueF
eSpaces
.
size
());
i
,
f
eSpaces
.
size
());
return
uniqueF
eSpaces
[
i
];
return
f
eSpaces
[
i
];
}
/// Returns all FE spaces, thus \ref feSpaces.
inline
vector
<
const
FiniteElemSpace
*>&
getFeSpaces
()
{
return
uniqueF
eSpaces
;
return
f
eSpaces
;
}
inline
const
FiniteElemSpace
*
getComponent
Fe
Space
(
unsigned
int
i
=
0
)
inline
const
FiniteElemSpace
*
getComponentSpace
(
unsigned
int
i
=
0
)
{
FUNCNAME
(
"MeshDistributor::getFeSpace()"
);
...
...
@@ -159,7 +159,7 @@ namespace AMDiS {
return
componentSpaces
[
i
];
}
inline
vector
<
const
FiniteElemSpace
*>&
getComponent
Fe
Spaces
()
inline
vector
<
const
FiniteElemSpace
*>&
getComponentSpaces
()
{
return
componentSpaces
;
}
...
...
@@ -504,7 +504,8 @@ namespace AMDiS {
/// Finite element spaces of the problem.
vector
<
const
FiniteElemSpace
*>
componentSpaces
;
vector
<
const
FiniteElemSpace
*>
uniqueFeSpaces
;
/// Set of all different FE spaces.
vector
<
const
FiniteElemSpace
*>
feSpaces
;
/// Mesh of the problem.
...
...
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.cc
View file @
ecb93cc3
...
...
@@ -115,7 +115,8 @@ namespace AMDiS {
if
(
checkMeshChange
())
{
// Mesh has been changed, recompute interior DOF mapping.
vector
<
const
FiniteElemSpace
*>
feSpaces
=
getComponentFeSpaces
(
seqMat
);
vector
<
const
FiniteElemSpace
*>
feSpaces
=
meshDistributor
->
getComponentSpaces
();
interiorMap
->
setComputeMatIndex
(
!
localMatrix
);
interiorMap
->
update
();
...
...
AMDiS/src/parallel/ParallelDebug.cc
View file @
ecb93cc3
...
...
@@ -164,7 +164,7 @@ namespace AMDiS {
perMap
.
periodicDofAssociations
[
feSpace
].
begin
();
it
!=
perMap
.
periodicDofAssociations
[
feSpace
].
end
();
++
it
)
{
WorldVector
<
double
>
c
;
pdb
.
mesh
->
getDofIndexCoords
(
it
->
first
,
pdb
.
uniqueF
eSpaces
[
0
],
c
);
pdb
.
mesh
->
getDofIndexCoords
(
it
->
first
,
pdb
.
f
eSpaces
[
0
],
c
);
int
nAssoc
=
it
->
second
.
size
();
}
...
...
@@ -329,7 +329,7 @@ namespace AMDiS {
clock_t
first
=
clock
();
// Get FE space with basis functions of the highest degree
const
FiniteElemSpace
*
feSpace
=
pdb
.
uniqueF
eSpaces
[
pdb
.
uniqueF
eSpaces
.
size
()
-
1
];
const
FiniteElemSpace
*
feSpace
=
pdb
.
f
eSpaces
[
pdb
.
f
eSpaces
.
size
()
-
1
];
int
testCommonDofs
=
1
;
Parameters
::
get
(
"dbg->test common dofs"
,
testCommonDofs
);
...
...
@@ -471,7 +471,7 @@ namespace AMDiS {
FUNCNAME
(
"ParallelDebug::testGlobalIndexByCoords()"
);
// Get FE space with basis functions of the highest degree
const
FiniteElemSpace
*
feSpace
=
pdb
.
uniqueF
eSpaces
[
pdb
.
uniqueF
eSpaces
.
size
()
-
1
];
const
FiniteElemSpace
*
feSpace
=
pdb
.
f
eSpaces
[
pdb
.
f
eSpaces
.
size
()
-
1
];
DOFVector
<
WorldVector
<
double
>
>
coords
(
feSpace
,
"tmp"
);
pdb
.
mesh
->
getDofIndexCoords
(
feSpace
,
coords
);
...
...
@@ -649,7 +649,7 @@ namespace AMDiS {
#if 0
if (rank == -1 || pdb.mpiRank == rank) {
const FiniteElemSpace *feSpace = pdb.
uniqueF
eSpaces[0];
const FiniteElemSpace *feSpace = pdb.
f
eSpaces[0];
cout << "====== DOF MAP LOCAL -> GLOBAL ====== " << endl;
...
...
@@ -700,7 +700,7 @@ namespace AMDiS {
dofit
!=
rankDofs
.
end
();
++
dofit
)
{
cout
<<
" "
<<
**
dofit
<<
endl
;
WorldVector
<
double
>
coords
;
pdb
.
mesh
->
getDofIndexCoords
(
*
dofit
,
pdb
.
uniqueF
eSpaces
[
0
],
coords
);
pdb
.
mesh
->
getDofIndexCoords
(
*
dofit
,
pdb
.
f
eSpaces
[
0
],
coords
);
coords
.
print
();
}
...
...
@@ -709,7 +709,7 @@ namespace AMDiS {
dofit
!=
rankAllDofs
.
end
();
++
dofit
)
{
cout
<<
" "
<<
**
dofit
<<
endl
;
WorldVector
<
double
>
coords
;
pdb
.
mesh
->
getDofIndexCoords
(
*
dofit
,
pdb
.
uniqueF
eSpaces
[
0
],
coords
);
pdb
.
mesh
->
getDofIndexCoords
(
*
dofit
,
pdb
.
f
eSpaces
[
0
],
coords
);
coords
.
print
();
}
}
...
...
@@ -886,13 +886,13 @@ namespace AMDiS {
if
(
followThisBound
(
it
->
rankObj
.
elIndex
,
it
->
neighObj
.
elIndex
))
debug
::
writeLocalElementDofs
(
pdb
.
mpiRank
,
it
->
rankObj
.
elIndex
,
pdb
.
uniqueF
eSpaces
[
0
]);
pdb
.
f
eSpaces
[
0
]);
for
(
InteriorBoundary
::
iterator
it
(
pdb
.
intBoundary
.
other
);
!
it
.
end
();
++
it
)
if
(
followThisBound
(
it
->
rankObj
.
elIndex
,
it
->
neighObj
.
elIndex
))
debug
::
writeLocalElementDofs
(
pdb
.
mpiRank
,
it
->
rankObj
.
elIndex
,
pdb
.
uniqueF
eSpaces
[
0
]);
pdb
.
f
eSpaces
[
0
]);
}
...
...
AMDiS/src/parallel/ParallelDofMapping.h
View file @
ecb93cc3
...
...
@@ -366,7 +366,7 @@ namespace AMDiS {
/// FE space.
ComponentDofMap
&
operator
[](
const
FiniteElemSpace
*
feSpace
)
{
ERROR_EXIT
(
"FE Space acces is not possible for component wise defined DOF mappings
\n
"
);
ERROR_EXIT
(
"FE Space acces
s
is not possible for component wise defined DOF mappings
\n
"
);
}
/// Return data iterator.
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
ecb93cc3
...
...
@@ -100,8 +100,6 @@ namespace AMDiS {
Parameters
::
get
(
"parallel->feti->pressure component"
,
pressureComponent
);
TEST_EXIT
(
pressureComponent
>=
0
)
(
"FETI-DP in Stokes mode, no pressure component defined!
\n
"
);
pressureFeSpace
=
feSpaces
[
pressureComponent
];
}
if
(
subdomain
==
NULL
)
{
...
...
@@ -192,8 +190,8 @@ namespace AMDiS {
interfaceDofMap
.
setMpiComm
(
levelData
.
getMpiComm
(
0
),
0
);
}
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponent
Fe
Spaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getComponent
Fe
Space
(
i
);
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponentSpaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getComponentSpace
(
i
);
createPrimals
(
i
,
feSpace
);
...
...
@@ -213,8 +211,8 @@ namespace AMDiS {
if
(
stokesMode
)
interfaceDofMap
.
update
();
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponent
Fe
Spaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getComponent
Fe
Space
(
i
);
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponentSpaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getComponentSpace
(
i
);
createLagrange
(
i
,
feSpace
);
createAugmentedLagrange
(
i
,
feSpace
);
}
...
...
@@ -245,12 +243,12 @@ namespace AMDiS {
}
MSG
(
"FETI-DP data created on mesh level %d
\n
"
,
meshLevel
);
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponent
Fe
Spaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getComponent
Fe
Space
(
i
);
for
(
unsigned
int
i
=
0
;
i
<
meshDistributor
->
getComponentSpaces
().
size
();
i
++
)
{
const
FiniteElemSpace
*
feSpace
=
meshDistributor
->
getComponentSpace
(
i
);
MSG
(
"FETI-DP data for %d-ith component (FE space %p):
\n
"
,
i
,
feSpace
);
if
(
feSpace
==
pressure
FeSpace
)
{
if
(
i
==
pressure
Component
)
{
MSG
(
" nRankInterface = %d nOverallInterface = %d
\n
"
,
interfaceDofMap
[
i
].
nRankDofs
,
interfaceDofMap
[
i
].
nOverallDofs
);
...
...
@@ -289,7 +287,7 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscSolverFeti::createPrimals()"
);
if
(
feSpace
==
pressure
FeSpace
)
if
(
component
==
pressure
Component
)
return
;
// === Define all vertices on the interior boundaries of the macro mesh ===
...
...
@@ -339,7 +337,7 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscSolverFeti::createDuals()"
);
if
(
feSpace
==
pressure
FeSpace
)
if
(
component
==
pressure
Component
)
return
;
// === Create global index of the dual nodes on each rank. ===
...
...
@@ -370,7 +368,7 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscSolverFeti::createInterfaceNodes()"
);
if
(
feSpace
!=
pressure
FeSpace
)
if
(
component
!=
pressure
Component
)
return
;
DofContainer
allBoundaryDofs
;
...
...
@@ -394,7 +392,7 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscSolverFeti::createLagrange()"
);
if
(
feSpace
==
pressure
FeSpace
)
if
(
component
==
pressure
Component
)
return
;
boundaryDofRanks
[
feSpace
].
clear
();
...
...
@@ -1270,11 +1268,14 @@ namespace AMDiS {
if
(
stokesMode
)
{
// === Create H2 vec ===
const
FiniteElemSpace
*
pressureFeSpace
=
meshDistributor
->
getComponentSpace
(
pressureComponent
);
DOFVector
<
double
>
tmpvec
(
pressureFeSpace
,
"tmpvec"
);
createH2vec
(
tmpvec
);
interfaceDofMap
.
createVec
(
fetiInterfaceLumpedPreconData
.
h2vec
);
DofMap
&
m
=
interfaceDofMap
[
pressure
FeSpace
].
getMap
();
DofMap
&
m
=
interfaceDofMap
[
pressure
Component
].
getMap
();
for
(
DofMap
::
iterator
it
=
m
.
begin
();
it
!=
m
.
end
();
++
it
)
{
if
(
meshDistributor
->
getDofMap
()[
pressureFeSpace
].
isRankDof
(
it
->
first
))
{
int
index
=
interfaceDofMap
.
getMatIndex
(
pressureComponent
,
it
->
first
);
...
...
@@ -1419,10 +1420,13 @@ namespace AMDiS {
if
(
!
stokesMode
)
return
;
const
FiniteElemSpace
*
pressureFeSpace
=
meshDistributor
->
getComponentSpace
(
pressureComponent
);
Vec
ktest0
,
ktest1
;
localDofMap
.
createLocalVec
(
ktest0
);
localDofMap
.
createLocalVec
(
ktest1
);
DofMap
&
m
=
localDofMap
[
pressure
FeSpace
].
getMap
();
DofMap
&
m
=
localDofMap
[
pressure
Component
].
getMap
();
for
(
DofMap
::
iterator
it
=
m
.
begin
();
it
!=
m
.
end
();
++
it
)
{
if
(
meshDistributor
->
getDofMap
()[
pressureFeSpace
].
isRankDof
(
it
->
first
))
{
int
index
=
localDofMap
.
getLocalMatIndex
(
pressureComponent
,
it
->
first
);
...
...
@@ -1675,7 +1679,7 @@ namespace AMDiS {
// === And copy from PETSc local vectors to the DOF vectors. ===
vector
<
const
FiniteElemSpace
*>
feSpaces
=
vec
.
getComponent
Fe
Spaces
();
vector
<
const
FiniteElemSpace
*>
feSpaces
=
meshDistributor
->
getComponentSpaces
();
int
cnt
=
0
;
for
(
int
component
=
0
;
component
<
nComponents
;
component
++
)
{
DOFVector
<
double
>&
dofVec
=
*
(
vec
.
getDOFVector
(
component
));
...
...
@@ -1716,10 +1720,8 @@ namespace AMDiS {
globalIsIndex
.
reserve
(
interfaceDofMap
.
getLocalDofs
());
localIsIndex
.
reserve
(
interfaceDofMap
.
getLocalDofs
());
const
FiniteElemSpace
*
pressureFeSpace
=