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
Aland, Sebastian
amdis
Commits
e80c79ac
Commit
e80c79ac
authored
May 30, 2011
by
Thomas Witkowski
Browse files
More flexibel structure for FETI-DP preconditioner.
parent
92d14c6f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/AdaptInstationary.cc
View file @
e80c79ac
...
...
@@ -17,6 +17,11 @@
#include
"ProblemTimeInterface.h"
#include
"Serializer.h"
#if HAVE_PARALLEL_DOMAIN_AMDIS
#include
"parallel/MeshDistributor.h"
#include
<petsc.h>
#endif
namespace
AMDiS
{
AdaptInstationary
::
AdaptInstationary
(
std
::
string
name
,
...
...
@@ -31,8 +36,8 @@ namespace AMDiS {
{
FUNCNAME
(
"AdaptInstationary::AdaptInstationary()"
);
//
MSG("You make use of the obsolete constructor AdaptInstationary::AdaptInstationary(...)!\n");
//
MSG("Please use the constructor that uses references instead of pointers!\n");
MSG
(
"You make use of the obsolete constructor AdaptInstationary::AdaptInstationary(...)!
\n
"
);
MSG
(
"Please use the constructor that uses references instead of pointers!
\n
"
);
initConstructor
(
problemStat
,
info
,
initialInfo
,
initialTimestampSet
);
}
...
...
@@ -262,6 +267,8 @@ namespace AMDiS {
{
FUNCNAME
(
"AdaptInstationary::oneTimestep()"
);
MSG
(
"ONE TIMESTEP!
\n
"
);
adaptInfo
->
setTimestepIteration
(
0
);
switch
(
strategy
)
{
...
...
@@ -294,6 +301,10 @@ namespace AMDiS {
TEST_EXIT
(
adaptInfo
->
getTimestep
()
>
0
)(
"timestep <= 0!
\n
"
);
#if HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor
::
globalMeshDistributor
->
initParallelization
();
#endif
if
(
adaptInfo
->
getTimestepNumber
()
==
0
)
{
adaptInfo
->
setTime
(
adaptInfo
->
getStartTime
());
initialAdaptInfo
->
setStartTime
(
adaptInfo
->
getStartTime
());
...
...
@@ -315,10 +326,7 @@ namespace AMDiS {
if
(
breakWhenStable
&&
(
adaptInfo
->
getSolverIterations
()
==
0
))
break
;
/*
if (adaptInfo->forceBreak)
break;
*/
// Check if there is a runtime limitation. If there is a runtime limitation
// and there is no more time for a next adaption loop, than return the error
// code for rescheduling the problem and break the adaption loop.
...
...
@@ -328,6 +336,11 @@ namespace AMDiS {
}
}
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor
::
globalMeshDistributor
->
exitParallelization
();
PetscFinalize
();
#endif
return
errorCode
;
}
...
...
AMDiS/src/AdaptStationary.cc
View file @
e80c79ac
...
...
@@ -16,6 +16,11 @@
#include
"ProblemIterationInterface.h"
#include
<math.h>
#if HAVE_PARALLEL_DOMAIN_AMDIS
#include
"parallel/MeshDistributor.h"
#include
<petsc.h>
#endif
namespace
AMDiS
{
AdaptStationary
::
AdaptStationary
(
std
::
string
name
,
...
...
@@ -25,8 +30,8 @@ namespace AMDiS {
{
FUNCNAME
(
"AdaptStationary::AdaptStationary()"
);
//
MSG("You make use of the obsolete constructor AdaptStationary::AdaptStationary(...)!\n");
//
MSG("Please use the constructor that uses references instead of pointers!\n");
MSG
(
"You make use of the obsolete constructor AdaptStationary::AdaptStationary(...)!
\n
"
);
MSG
(
"Please use the constructor that uses references instead of pointers!
\n
"
);
initialize
();
}
...
...
@@ -45,6 +50,10 @@ namespace AMDiS {
{
FUNCNAME
(
"AdaptStationary::adapt()"
);
#if HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor
::
globalMeshDistributor
->
initParallelization
();
#endif
// initial iteration
if
(
adaptInfo
->
getSpaceIteration
()
==
-
1
)
{
problemIteration
->
beginIteration
(
adaptInfo
);
...
...
@@ -68,6 +77,11 @@ namespace AMDiS {
adaptInfo
->
incSpaceIteration
();
}
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor
::
globalMeshDistributor
->
exitParallelization
();
PetscFinalize
();
#endif
return
0
;
}
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
e80c79ac
...
...
@@ -143,6 +143,7 @@ namespace AMDiS {
TEST_EXIT
(
feSpace
)(
"No FE space has been defined for the mesh distributor!
\n
"
);
TEST_EXIT
(
mesh
)(
"No mesh has been defined for the mesh distributor!
\n
"
);
TEST_EXIT
(
!
initialized
)(
"MeshDistributor is already initialized!
\n
"
);
#ifdef HAVE_ZOLTAN
int
a
=
0
;
...
...
AMDiS/src/parallel/PetscSolverFeti.cc
View file @
e80c79ac
This diff is collapsed.
Click to expand it.
AMDiS/src/parallel/PetscSolverFeti.h
View file @
e80c79ac
...
...
@@ -60,7 +60,7 @@ namespace AMDiS {
* the system matrix reduced to the Lagrange multipliers.
* \ref petscMultMatFeti
*/
struct
Petsc
FetiData
{
struct
FetiData
{
/// Pointers to the matrix containing the primal variables.
Mat
*
mat_primal_primal
;
...
...
@@ -87,11 +87,11 @@ namespace AMDiS {
};
struct
P
et
scF
et
i
PreconData
{
struct
F
et
iDirichl
etPreconData
{
/// Matrix of scaled Lagrange variables.
Mat
*
mat_lagrange_scaled
;
Mat
*
mat_interior_interior
,
*
mat_
bound_bound
,
*
mat_interior_
bound
,
*
mat_
bound
_interior
;
Mat
*
mat_interior_interior
,
*
mat_
duals_duals
,
*
mat_interior_
duals
,
*
mat_
duals
_interior
;
/// Pointer to the solver for \ref PetscSolverFeti::mat_bb.
KSP
*
ksp_interior
;
...
...
@@ -99,27 +99,42 @@ namespace AMDiS {
/// Temporal vector on the B variables.
Vec
tmp_vec_b
;
Vec
tmp_vec_bound0
,
tmp_vec_bound1
;
Vec
tmp_vec_interior
;
/// Temporal vector on the dual variables.
Vec
tmp_vec_duals0
,
tmp_vec_duals1
;
/// Temporal vector on the interior variables.
Vec
tmp_vec_interior
;
};
int
nLocalInterior
;
int
nLocalBound
;
struct
FetiLumpedPreconData
{
/// Matrix of scaled Lagrange variables.
Mat
*
mat_lagrange_scaled
;
Mat
*
mat_duals_duals
;
/// Temporal vector on the B variables.
Vec
tmp_vec_b
;
/// Temporal vector on the dual variables.
Vec
tmp_vec_duals0
,
tmp_vec_duals1
;
};
typedef
enum
{
FETI_NONE
=
0
,
FETI_DIRICHLET
=
1
,
FETI_LUMPED
=
2
}
FetiPreconditioner
;
/** \brief
* FETI-DP implementation based on PETSc.
*/
class
PetscSolverFeti
:
public
PetscSolver
{
public:
PetscSolverFeti
()
:
PetscSolver
(),
nComponents
(
-
1
)
{}
PetscSolverFeti
();
/// Assemble the sequentially created matrices and vectors to the
/// global matrices and vectors required by the FETI-DP method.
...
...
@@ -288,22 +303,29 @@ namespace AMDiS {
Mat
mat_feti
;
/// Data for MatMult operation in matrix \ref mat_feti
Petsc
FetiData
petscF
etiData
;
FetiData
f
etiData
;
/// Defines which preconditioner should be used to solve the reduced
/// FETI-DP system.
FetiPreconditioner
fetiPreconditioner
;
/// Preconditioner object for the reduced FETI-DP system.
PC
precon_feti
;
Mat
mat_lagrange_scaled
;
PC
precon_feti
;
FetiDirichletPreconData
fetiDirichletPreconData
;
PetscFeti
PreconData
petscFeti
PreconData
;
FetiLumped
PreconData
fetiLumped
PreconData
;
Mat
mat_interior_interior
,
mat_
bound_bound
,
mat_interior_
bound
,
mat_
bound
_interior
;
Mat
mat_interior_interior
,
mat_
duals_duals
,
mat_interior_
duals
,
mat_
duals
_interior
;
KSP
ksp_interior
;
int
nLocalInterior
;
int
nLocalBound
;
// Number of local nodes that are duals.
int
nLocalDuals
;
};
#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