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
iwr
amdis
Commits
56139ea6
Commit
56139ea6
authored
Oct 23, 2012
by
Thomas Witkowski
Browse files
bo eh
parent
576bb4eb
Changes
6
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/ParallelCoarseSpaceMatVec.cc
View file @
56139ea6
...
...
@@ -114,11 +114,7 @@ namespace AMDiS {
bool
localMatrix
=
(
coarseSpaceMap
.
size
()
&&
subdomainLevel
==
0
);
if
(
checkMeshChange
())
{
// Mesh has been changed, recompute interior DOF mapping.
interiorMap
->
setComputeMatIndex
(
!
localMatrix
);
interiorMap
->
update
();
int
nMat
=
uniqueCoarseMap
.
size
()
+
1
;
int
nMat
=
uniqueCoarseMap
.
size
()
+
1
;
nnz
.
resize
(
nMat
);
for
(
int
i
=
0
;
i
<
nMat
;
i
++
)
{
nnz
[
i
].
resize
(
nMat
);
...
...
AMDiS/src/parallel/ParallelDofMapping.cc
View file @
56139ea6
...
...
@@ -215,7 +215,8 @@ namespace AMDiS {
nRankDofs
(
1
),
nLocalDofs
(
1
),
nOverallDofs
(
1
),
rStartDofs
(
1
)
rStartDofs
(
1
),
mode
(
mode
)
{
switch
(
mode
)
{
case
COMPONENT_WISE
:
...
...
@@ -535,4 +536,15 @@ namespace AMDiS {
ISCreateStride
(
mpiComm
,
nRankRows
,
firstMatIndex
,
1
,
&
is
);
}
void
ParallelDofMapping
::
printInfo
()
{
FUNCNAME
(
"ParallelDofMapping::printInfo()"
);
if
(
mode
==
COMPONENT_WISE
)
{
MSG
(
"Mapping is defined by component numbers!
\n
"
);
}
else
{
MSG
(
"Mapping is defined by FE spaces!
\n
"
);
}
}
}
AMDiS/src/parallel/ParallelDofMapping.h
View file @
56139ea6
...
...
@@ -820,6 +820,10 @@ namespace AMDiS {
VecCreateSeq
(
PETSC_COMM_SELF
,
getRankDofs
(),
&
vec
);
}
/// Prints out some information about the mapping. May be used during
/// debugging or parallel solver creation.
void
printInfo
();
protected:
/// Compute \ref nRankDofs.
int
computeRankDofs
();
...
...
@@ -883,6 +887,10 @@ namespace AMDiS {
/// Set of unique FE spaces.
vector
<
const
FiniteElemSpace
*>
feSpaces
;
/// Defines the DOF mapping either. The mapping may be defined either for
/// FE spaces or for component numbers.
DofMappingMode
mode
;
};
}
...
...
AMDiS/src/parallel/PetscSolver.cc
View file @
56139ea6
...
...
@@ -45,7 +45,8 @@ namespace AMDiS {
void
PetscSolver
::
init
(
vector
<
const
FiniteElemSpace
*>
&
fe0
,
vector
<
const
FiniteElemSpace
*>
&
fe1
)
vector
<
const
FiniteElemSpace
*>
&
fe1
,
bool
createGlobalMapping
)
{
FUNCNAME
(
"PetscSolver::init()"
);
...
...
@@ -60,18 +61,20 @@ namespace AMDiS {
int
nLevels
=
levelData
.
getLevelNumber
();
TEST_EXIT_DBG
(
nLevels
>=
1
)(
"Should not happen!
\n
"
);
dofMap
.
init
(
levelData
,
componentSpaces
,
feSpaces
);
dofMap
.
setMpiComm
(
levelData
.
getMpiComm
(
0
),
0
);
dofMap
.
setDofComm
(
meshDistributor
->
getDofComm
());
dofMap
.
clear
();
meshDistributor
->
registerDofMap
(
dofMap
);
if
(
nLevels
>
1
)
{
dofMapSd
.
init
(
levelData
,
componentSpaces
,
feSpaces
);
dofMapSd
.
setMpiComm
(
levelData
.
getMpiComm
(
1
),
1
);
dofMapSd
.
setDofComm
(
meshDistributor
->
getDofCommSd
());
dofMapSd
.
clear
();
meshDistributor
->
registerDofMap
(
dofMapSd
);
if
(
createGlobalMapping
)
{
dofMap
.
init
(
levelData
,
componentSpaces
,
feSpaces
);
dofMap
.
setMpiComm
(
levelData
.
getMpiComm
(
0
),
0
);
dofMap
.
setDofComm
(
meshDistributor
->
getDofComm
());
dofMap
.
clear
();
meshDistributor
->
registerDofMap
(
dofMap
);
if
(
nLevels
>
1
)
{
dofMapSd
.
init
(
levelData
,
componentSpaces
,
feSpaces
);
dofMapSd
.
setMpiComm
(
levelData
.
getMpiComm
(
1
),
1
);
dofMapSd
.
setDofComm
(
meshDistributor
->
getDofCommSd
());
dofMapSd
.
clear
();
meshDistributor
->
registerDofMap
(
dofMapSd
);
}
}
}
...
...
AMDiS/src/parallel/PetscSolver.h
View file @
56139ea6
...
...
@@ -54,8 +54,9 @@ namespace AMDiS {
virtual
~
PetscSolver
()
{}
virtual
void
init
(
vector
<
const
FiniteElemSpace
*>
&
componentSpaces
,
vector
<
const
FiniteElemSpace
*>
&
feSpaces
);
void
init
(
vector
<
const
FiniteElemSpace
*>
&
componentSpaces
,
vector
<
const
FiniteElemSpace
*>
&
feSpaces
,
bool
createGlobalMapping
=
true
);
/** \brief
* Create a PETSc matrix. The given DOF matrices are used to create the nnz
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
56139ea6
...
...
@@ -1282,20 +1282,28 @@ namespace AMDiS {
if
(
!
massMatrixSolver
)
{
MSG
(
"START CREATE MASS MATRIX!
\n
"
);
ParallelDofMapping
*
massMapping
=
new
ParallelDofMapping
(
COMPONENT_WISE
);
massMapping
->
init
(
meshDistributor
->
getMeshLevelData
(),
pressureFeSpace
,
pressureFeSpace
);
massMapping
->
setDofComm
(
meshDistributor
->
getDofComm
());
(
*
massMapping
)[
0
]
=
interfaceDofMap
[
pressureComponent
];
massMapping
->
update
();
DOFMatrix
massMatrix
(
pressureFeSpace
,
pressureFeSpace
);
Operator
op
(
pressureFeSpace
,
pressureFeSpace
);
Simple_ZOT
zot
;
op
.
addTerm
(
&
zot
);
massMatrix
.
assembleOperator
(
op
);
ParallelDofMapping
massMatMapping
=
interfaceDofMap
;
massMatrixSolver
=
new
PetscSolverGlobalMatrix
;
massMatrixSolver
->
setKspPrefix
(
"mass_"
);
massMatrixSolver
->
setMeshDistributor
(
meshDistributor
,
mpiCommGlobal
,
mpiCommLocal
);
massMatrixSolver
->
setDofMapping
(
&
massMatMapping
);
massMatrixSolver
->
setDofMapping
(
massMapping
);
MSG
(
"START ASM ===
\n
"
);
massMatrixSolver
->
fillPetscMatrix
(
&
massMatrix
);
MSG
(
"END ASM ===
\n
"
);
int
r
,
c
;
MatGetSize
(
massMatrixSolver
->
getMatInterior
(),
&
r
,
&
c
);
...
...
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