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
267dab65
Commit
267dab65
authored
Jul 02, 2012
by
Thomas Witkowski
Browse files
Added possibility to analyze matrices from FETI-DP.
parent
3f5fab8e
Changes
2
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/parallel/MeshDistributor.cc
View file @
267dab65
...
...
@@ -1581,7 +1581,6 @@ namespace AMDiS {
dofCommSd
.
create
(
intBoundarySd
);
}
// === If requested, create more information on communication DOFs. ===
if
(
!
createBoundaryDofFlag
.
isSet
(
BOUNDARY_SUBOBJ_SORTED
))
...
...
@@ -1632,6 +1631,7 @@ namespace AMDiS {
}
}
void
MeshDistributor
::
removeMacroElements
()
{
FUNCNAME
(
"MeshDistributor::removeMacroElements()"
);
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
267dab65
...
...
@@ -1129,6 +1129,92 @@ namespace AMDiS {
MatView
(
subdomain
->
getMatCoarseCoarse
(),
petscView
);
PetscViewerDestroy
(
&
petscView
);
}
int
writeSchurPrimalMatrix
=
0
;
Parameters
::
get
(
"parallel->debug->write schur primal matrix"
,
writeSchurPrimalMatrix
);
if
(
writeSchurPrimalMatrix
)
{
PetscViewer
petscView
;
PetscViewerBinaryOpen
(
PETSC_COMM_WORLD
,
"schurprimal.mat"
,
FILE_MODE_WRITE
,
&
petscView
);
MatView
(
mat_schur_primal
,
petscView
);
PetscViewerDestroy
(
&
petscView
);
}
int
writeFetiMatrix
=
0
;
Parameters
::
get
(
"parallel->debug->write feti matrix"
,
writeFetiMatrix
);
if
(
writeFetiMatrix
)
{
MSG
(
"Start creating explicit FETI-DP matrix!
\n
"
);
Vec
unitVector
;
Vec
resultVector
;
Mat
fetiMat
;
MatCreateAIJ
(
mpiCommGlobal
,
lagrangeMap
.
getRankDofs
(),
lagrangeMap
.
getRankDofs
(),
lagrangeMap
.
getOverallDofs
(),
lagrangeMap
.
getOverallDofs
(),
lagrangeMap
.
getOverallDofs
(),
PETSC_NULL
,
lagrangeMap
.
getOverallDofs
(),
PETSC_NULL
,
&
fetiMat
);
VecCreateMPI
(
mpiCommGlobal
,
lagrangeMap
.
getRankDofs
(),
lagrangeMap
.
getOverallDofs
(),
&
unitVector
);
VecCreateMPI
(
mpiCommGlobal
,
lagrangeMap
.
getRankDofs
(),
lagrangeMap
.
getOverallDofs
(),
&
resultVector
);
PetscInt
low
,
high
;
VecGetOwnershipRange
(
unitVector
,
&
low
,
&
high
);
int
nLocal
=
high
-
low
;
int
nnzCounter
=
0
;
for
(
int
i
=
0
;
i
<
lagrangeMap
.
getOverallDofs
();
i
++
)
{
VecSet
(
unitVector
,
0.0
);
if
(
i
>=
low
&&
i
<
high
)
VecSetValue
(
unitVector
,
i
,
1.0
,
INSERT_VALUES
);
VecAssemblyBegin
(
unitVector
);
VecAssemblyEnd
(
unitVector
);
MatMult
(
mat_feti
,
unitVector
,
resultVector
);
PetscScalar
*
vals
;
VecGetArray
(
resultVector
,
&
vals
);
for
(
int
j
=
0
;
j
<
nLocal
;
j
++
)
if
(
fabs
(
vals
[
j
])
>
1e-30
)
{
MatSetValue
(
fetiMat
,
low
+
j
,
i
,
vals
[
j
],
INSERT_VALUES
);
nnzCounter
++
;
}
VecRestoreArray
(
resultVector
,
&
vals
);
}
MatAssemblyBegin
(
fetiMat
,
MAT_FINAL_ASSEMBLY
);
MatAssemblyEnd
(
fetiMat
,
MAT_FINAL_ASSEMBLY
);
VecDestroy
(
&
unitVector
);
VecDestroy
(
&
resultVector
);
mpi
::
globalAdd
(
nnzCounter
);
PetscViewer
petscView
;
PetscViewerBinaryOpen
(
PETSC_COMM_WORLD
,
"feti.mat"
,
FILE_MODE_WRITE
,
&
petscView
);
MatView
(
fetiMat
,
petscView
);
PetscViewerDestroy
(
&
petscView
);
MatDestroy
(
&
fetiMat
);
MSG
(
"FETI-DP matrix written: %d x %d mat with %d nnz
\n
"
,
lagrangeMap
.
getOverallDofs
(),
lagrangeMap
.
getOverallDofs
(),
nnzCounter
);
}
#endif
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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