Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
amdis
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Aland, Sebastian
amdis
Commits
544ddc37
Commit
544ddc37
authored
Nov 09, 2012
by
Praetorius, Simon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Petsc-solvers added to Creator-Map, PetscSolver is now based on OEMSolver
parent
d8f9590b
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
139 additions
and
45 deletions
+139
-45
AMDiS/src/CreatorMap.cc
AMDiS/src/CreatorMap.cc
+21
-0
AMDiS/src/DOFVector.cc
AMDiS/src/DOFVector.cc
+2
-2
AMDiS/src/ElInfo2d.cc
AMDiS/src/ElInfo2d.cc
+1
-1
AMDiS/src/FixVec.h
AMDiS/src/FixVec.h
+5
-0
AMDiS/src/ProblemStat.cc
AMDiS/src/ProblemStat.cc
+0
-2
AMDiS/src/parallel/BddcMlSolver.h
AMDiS/src/parallel/BddcMlSolver.h
+13
-0
AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc
AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc
+4
-2
AMDiS/src/parallel/ParallelCoarseSpaceSolver.h
AMDiS/src/parallel/ParallelCoarseSpaceSolver.h
+8
-3
AMDiS/src/parallel/PetscProblemStat.cc
AMDiS/src/parallel/PetscProblemStat.cc
+14
-27
AMDiS/src/parallel/PetscProblemStat.h
AMDiS/src/parallel/PetscProblemStat.h
+2
-0
AMDiS/src/parallel/PetscSolver.cc
AMDiS/src/parallel/PetscSolver.cc
+1
-2
AMDiS/src/parallel/PetscSolver.h
AMDiS/src/parallel/PetscSolver.h
+1
-5
AMDiS/src/parallel/PetscSolverFeti.h
AMDiS/src/parallel/PetscSolverFeti.h
+13
-0
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
+2
-0
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.h
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.h
+13
-0
AMDiS/src/parallel/PetscSolverGlobalMatrix.h
AMDiS/src/parallel/PetscSolverGlobalMatrix.h
+13
-0
AMDiS/src/parallel/PetscSolverNavierStokes.h
AMDiS/src/parallel/PetscSolverNavierStokes.h
+13
-1
AMDiS/src/parallel/PetscSolverSchur.h
AMDiS/src/parallel/PetscSolverSchur.h
+13
-0
No files found.
AMDiS/src/CreatorMap.cc
View file @
544ddc37
...
...
@@ -29,6 +29,16 @@
#include "time/RosenbrockMethod.h"
#include "nonlin/NonLinSolver.h"
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#include "parallel/PetscSolverFeti.h"
#include "parallel/PetscSolverGlobalBlockMatrix.h"
#include "parallel/PetscSolverGlobalMatrix.h"
#include "parallel/PetscSolverNavierStokes.h"
#include "parallel/PetscSolverSchur.h"
#include "parallel/BddcMlSolver.h"
#endif
namespace
AMDiS
{
template
<
>
...
...
@@ -73,6 +83,17 @@ namespace AMDiS {
creator
=
new
UmfPackSolver
::
Creator
;
addCreator
(
"umfpack"
,
creator
);
#endif
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
addCreator
(
"petsc"
,
new
PetscSolverGlobalMatrix
::
Creator
);
addCreator
(
"petsc-schur"
,
new
PetscSolverSchur
::
Creator
);
addCreator
(
"petsc-block"
,
new
PetscSolverGlobalBlockMatrix
::
Creator
);
addCreator
(
"petsc-feti"
,
new
PetscSolverFeti
::
Creator
);
#ifdef HAVE_BDDC_ML
addCreator
(
"bddcml"
,
new
BddcMlSolver
::
Creator
);
#endif
addCreator
(
"petsc-stokes"
,
new
PetscSolverNavierStokes
::
Creator
);
#endif
}
...
...
AMDiS/src/DOFVector.cc
View file @
544ddc37
...
...
@@ -770,7 +770,7 @@ namespace AMDiS {
Quadrature
*
quad
=
Quadrature
::
provideQuadrature
(
vecs
[
0
]
->
getFeSpace
()
->
getMesh
()
->
getDim
(),
deg
);
FastQuadrature
*
fastQuad
=
FastQuadrature
::
provideFastQuadrature
(
vecs
[
0
]
->
getFeSpace
()
->
getBasisFcts
(),
*
quad
,
INIT
_PHI
);
FastQuadrature
::
provideFastQuadrature
(
vecs
[
0
]
->
getFeSpace
()
->
getBasisFcts
(),
*
quad
,
INIT_PHI
|
INIT_GRD
_PHI
);
std
::
vector
<
mtl
::
dense_vector
<
double
>
>
qp
(
vecs
.
size
());
std
::
vector
<
mtl
::
dense_vector
<
WorldVector
<
double
>
>
>
qpGrd
(
vecs
.
size
());
...
...
@@ -782,7 +782,7 @@ namespace AMDiS {
qpGrd
[
i
].
change_dim
(
fastQuad
->
getNumPoints
());
double
value
=
0.0
;
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
|
Mesh
::
FILL_DET
;
Flag
traverseFlag
=
Mesh
::
CALL_LEAF_EL
|
Mesh
::
FILL_COORDS
|
Mesh
::
FILL_DET
|
Mesh
::
FILL_GRD_LAMBDA
;
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
vecs
[
0
]
->
getFeSpace
()
->
getMesh
(),
-
1
,
traverseFlag
);
while
(
elInfo
)
{
...
...
AMDiS/src/ElInfo2d.cc
View file @
544ddc37
...
...
@@ -270,7 +270,7 @@ namespace AMDiS {
neighbourCoord
[
i
][
0
]
=
macroNeighbour
->
coord
[
0
];
neighbourCoord
[
i
][
1
]
=
macroNeighbour
->
coord
[
2
];
}
else
{
ERROR_EXIT
(
"Should not happen!
\n
"
);
ERROR_EXIT
(
"Should not happen!
Non-conforming AMDiS-mesh? Periodic mesh with corrected index-circles?
\n
"
);
}
// I've deleted here some code, be I think that this case is not
...
...
AMDiS/src/FixVec.h
View file @
544ddc37
...
...
@@ -638,6 +638,11 @@ namespace AMDiS {
typedef
T1
type
;
};
template
<
>
struct
ProductType
<
double
,
int
>
{
typedef
double
type
;
};
template
<
>
struct
ProductType
<
int
,
double
>
{
typedef
double
type
;
};
template
<
>
struct
ProductType
<
float
,
int
>
{
typedef
float
type
;
};
template
<
>
struct
ProductType
<
int
,
float
>
{
typedef
float
type
;
};
// scalar times vector
template
<
typename
T1
>
struct
ProductType
<
T1
,
WorldVector
<
T1
>
>
...
...
AMDiS/src/ProblemStat.cc
View file @
544ddc37
...
...
@@ -507,7 +507,6 @@ namespace AMDiS {
{
FUNCNAME
(
"ProblemStat::createSolver()"
);
#ifndef HAVE_PARALLEL_DOMAIN_AMDIS
// === create solver ===
string
solverType
(
"0"
);
string
initFileStr
=
name
+
"->solver"
;
...
...
@@ -518,7 +517,6 @@ namespace AMDiS {
solverCreator
->
setName
(
initFileStr
);
solver
=
solverCreator
->
create
();
solver
->
initParameters
();
#endif
}
...
...
AMDiS/src/parallel/BddcMlSolver.h
View file @
544ddc37
...
...
@@ -35,6 +35,19 @@ namespace AMDiS {
class
BddcMlSolver
:
public
PetscSolver
{
public:
/// Creator class
class
Creator
:
public
OEMSolverCreator
{
public:
virtual
~
Creator
()
{}
/// Returns a new PetscSolver object.
OEMSolver
*
create
()
{
return
new
BddcMlSolver
(
this
->
name
);
}
};
BddcMlSolver
(
string
name
)
:
PetscSolver
(
name
),
rhsVec
(
NULL
),
...
...
AMDiS/src/parallel/ParallelCoarseSpaceSolver.cc
View file @
544ddc37
...
...
@@ -18,8 +18,10 @@ namespace AMDiS {
using
namespace
std
;
ParallelCoarseSpaceSolver
::
ParallelCoarseSpaceSolver
()
:
interiorMap
(
NULL
),
ParallelCoarseSpaceSolver
::
ParallelCoarseSpaceSolver
(
string
name
)
:
OEMSolver
(
name
),
initFileStr
(
name
),
interiorMap
(
NULL
),
lastMeshNnz
(
-
1
),
alwaysCreateNnzStructure
(
false
),
meshDistributor
(
NULL
),
...
...
AMDiS/src/parallel/ParallelCoarseSpaceSolver.h
View file @
544ddc37
...
...
@@ -31,9 +31,10 @@
#include "parallel/ParallelDofMapping.h"
#include "parallel/MeshDistributor.h"
#include "parallel/MatrixNnzStructure.h"
#include "OEMSolver.h"
namespace
AMDiS
{
/**
* This class implements a block structured PETSc matrix/vec which seperates
* the discretization of the interior of subdomains and the discretization
...
...
@@ -48,10 +49,10 @@ namespace AMDiS {
* - This class also manages the creation of the corresponding non zero
* structure of the matrices.
*/
class
ParallelCoarseSpaceSolver
{
class
ParallelCoarseSpaceSolver
:
public
OEMSolver
{
public:
/// Constructor
ParallelCoarseSpaceSolver
();
ParallelCoarseSpaceSolver
(
string
name
);
/// Set parallel DOF mapping for the interior DOFs.
void
setDofMapping
(
ParallelDofMapping
*
interiorDofs
)
...
...
@@ -305,6 +306,9 @@ namespace AMDiS {
bool
alwaysCreateNnzStructure
;
protected:
/// Prefix string for parameters in init file.
string
initFileStr
;
/// Pointer to a mesh distributor object.
MeshDistributor
*
meshDistributor
;
...
...
@@ -340,6 +344,7 @@ namespace AMDiS {
/// different coarse spaces for different components.
map
<
int
,
ParallelDofMapping
*>
coarseSpaceMap
;
};
}
#endif
AMDiS/src/parallel/PetscProblemStat.cc
View file @
544ddc37
...
...
@@ -32,33 +32,6 @@ namespace AMDiS {
{
FUNCNAME
(
"PetscProblemStat::PetscProblemStat()"
);
string
tmp
(
""
);
string
initFileStr
=
nameStr
+
"->solver"
;
Parameters
::
get
(
initFileStr
,
tmp
);
if
(
tmp
==
"petsc-schur"
)
{
petscSolver
=
new
PetscSolverSchur
(
initFileStr
);
}
else
if
(
tmp
==
"petsc-feti"
)
{
petscSolver
=
new
PetscSolverFeti
(
initFileStr
);
}
else
if
(
tmp
==
"petsc-block"
)
{
petscSolver
=
new
PetscSolverGlobalBlockMatrix
(
initFileStr
);
}
else
if
(
tmp
==
"petsc"
)
{
petscSolver
=
new
PetscSolverGlobalMatrix
(
initFileStr
);
}
else
if
(
tmp
==
"bddcml"
)
{
#ifdef HAVE_BDDC_ML
petscSolver
=
new
BddcMlSolver
(
initFileStr
);
#else
ERROR_EXIT
(
"AMDiS was compiled without BDDC-ML support!
\n
"
);
#endif
}
else
if
(
tmp
==
"petsc-navierstokes"
)
{
petscSolver
=
new
PetscSolverNavierStokes
(
initFileStr
);
}
else
{
ERROR_EXIT
(
"No parallel solver %s available!
\n
"
,
tmp
.
c_str
());
}
tmp
=
""
;
Parameters
::
get
(
nameStr
+
"->solver->petsc prefix"
,
tmp
);
petscSolver
->
setKspPrefix
(
tmp
);
}
...
...
@@ -76,6 +49,10 @@ namespace AMDiS {
{
ParallelProblemStatBase
::
initialize
(
initFlag
,
adoptProblem
,
adoptFlag
);
string
tmp
(
""
);
Parameters
::
get
(
getName
()
+
"->solver->petsc prefix"
,
tmp
);
petscSolver
->
setKspPrefix
(
tmp
);
meshDistributor
->
setBoundaryDofRequirement
(
petscSolver
->
getBoundaryDofRequirement
());
petscSolver
->
setMeshDistributor
(
meshDistributor
,
...
...
@@ -83,6 +60,16 @@ namespace AMDiS {
PETSC_COMM_SELF
);
petscSolver
->
init
(
this
->
getComponentSpaces
(),
this
->
getFeSpaces
());
}
void
PetscProblemStat
::
createSolver
()
{
FUNCNAME
(
"createSolver()"
);
ParallelProblemStatBase
::
createSolver
();
petscSolver
=
dynamic_cast
<
PetscSolver
*>
(
solver
);
TEST_EXIT
(
petscSolver
)(
"wrong petsc-solver type
\n
"
);
}
void
PetscProblemStat
::
solve
(
AdaptInfo
*
adaptInfo
,
...
...
AMDiS/src/parallel/PetscProblemStat.h
View file @
544ddc37
...
...
@@ -52,6 +52,8 @@ namespace AMDiS {
void
initialize
(
Flag
initFlag
,
ProblemStatSeq
*
adoptProblem
=
NULL
,
Flag
adoptFlag
=
INIT_NOTHING
);
virtual
void
createSolver
();
void
solve
(
AdaptInfo
*
adaptInfo
,
bool
createMatrixData
=
true
,
...
...
AMDiS/src/parallel/PetscSolver.cc
View file @
544ddc37
...
...
@@ -21,8 +21,7 @@ namespace AMDiS {
using
namespace
std
;
PetscSolver
::
PetscSolver
(
string
name
)
:
ParallelCoarseSpaceSolver
(),
initFileStr
(
name
),
:
ParallelCoarseSpaceSolver
(
name
),
dofMap
(
FESPACE_WISE
,
true
),
dofMapSd
(
FESPACE_WISE
,
true
),
kspPrefix
(
""
),
...
...
AMDiS/src/parallel/PetscSolver.h
View file @
544ddc37
...
...
@@ -49,7 +49,7 @@ namespace AMDiS {
*/
class
PetscSolver
:
public
ParallelCoarseSpaceSolver
{
public:
public:
PetscSolver
(
string
name
);
virtual
~
PetscSolver
()
{}
...
...
@@ -173,9 +173,6 @@ namespace AMDiS {
/// Run test, if matrix is symmetric.
bool
testMatrixSymmetric
(
Mat
mat
,
bool
advancedTest
=
false
);
protected:
/// Prefix string for parameters in init file.
string
initFileStr
;
/// FE spaces of all components for the stationary problem the specific
/// solver object is registered to.
vector
<
const
FiniteElemSpace
*>
componentSpaces
;
...
...
@@ -215,7 +212,6 @@ namespace AMDiS {
vector
<
int
>
constNullspaceComponent
;
};
}
// namespace AMDiS
#endif
AMDiS/src/parallel/PetscSolverFeti.h
View file @
544ddc37
...
...
@@ -41,6 +41,19 @@ namespace AMDiS {
class
PetscSolverFeti
:
public
PetscSolver
{
public:
/// Creator class
class
Creator
:
public
OEMSolverCreator
{
public:
virtual
~
Creator
()
{}
/// Returns a new PetscSolver object.
OEMSolver
*
create
()
{
return
new
PetscSolverFeti
(
this
->
name
);
}
};
/// Constructor of FETI-DP solver class.
PetscSolverFeti
(
string
name
);
...
...
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
View file @
544ddc37
...
...
@@ -92,6 +92,8 @@ namespace AMDiS {
matAssembly
();
/// initPreconditioner(...)
// === Init PETSc solver and preconditioner objects. ===
...
...
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.h
View file @
544ddc37
...
...
@@ -34,6 +34,19 @@ namespace AMDiS {
class
PetscSolverGlobalBlockMatrix
:
public
PetscSolver
{
public:
/// Creator class
class
Creator
:
public
OEMSolverCreator
{
public:
virtual
~
Creator
()
{}
/// Returns a new PetscSolver object.
OEMSolver
*
create
()
{
return
new
PetscSolverGlobalBlockMatrix
(
this
->
name
);
}
};
PetscSolverGlobalBlockMatrix
(
string
name
)
:
PetscSolver
(
name
),
nComponents
(
0
),
...
...
AMDiS/src/parallel/PetscSolverGlobalMatrix.h
View file @
544ddc37
...
...
@@ -39,6 +39,19 @@ namespace AMDiS {
class
PetscSolverGlobalMatrix
:
public
PetscSolver
{
public:
/// Creator class
class
Creator
:
public
OEMSolverCreator
{
public:
virtual
~
Creator
()
{}
/// Returns a new PetscSolver object.
OEMSolver
*
create
()
{
return
new
PetscSolverGlobalMatrix
(
this
->
name
);
}
};
PetscSolverGlobalMatrix
(
string
name
);
void
fillPetscMatrix
(
Matrix
<
DOFMatrix
*>
*
mat
);
...
...
AMDiS/src/parallel/PetscSolverNavierStokes.h
View file @
544ddc37
...
...
@@ -39,7 +39,7 @@ namespace AMDiS {
class
PetscSolverNavierStokes
:
public
PetscSolverGlobalMatrix
{
private:
private:
class
IdFct
:
public
AbstractFunction
<
double
,
double
>
{
public:
...
...
@@ -108,6 +108,18 @@ namespace AMDiS {
public:
/// Creator class
class
Creator
:
public
OEMSolverCreator
{
public:
virtual
~
Creator
()
{}
/// Returns a new PetscSolver object.
OEMSolver
*
create
()
{
return
new
PetscSolverNavierStokes
(
this
->
name
);
}
};
PetscSolverNavierStokes
(
string
name
);
void
setStokesData
(
double
*
nuPtr
,
double
*
invTauPtr
,
SystemVector
*
vec
)
...
...
AMDiS/src/parallel/PetscSolverSchur.h
View file @
544ddc37
...
...
@@ -33,6 +33,19 @@ namespace AMDiS {
class
PetscSolverSchur
:
public
PetscSolver
{
public:
/// Creator class
class
Creator
:
public
OEMSolverCreator
{
public:
virtual
~
Creator
()
{}
/// Returns a new PetscSolver object.
OEMSolver
*
create
()
{
return
new
PetscSolverSchur
(
this
->
name
);
}
};
PetscSolverSchur
(
string
name
)
:
PetscSolver
(
name
)
{}
...
...
Write
Preview
Markdown
is supported
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