Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dune-fem-dg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dune-fem
dune-fem-dg
Commits
7f5b6cb9
Commit
7f5b6cb9
authored
9 years ago
by
Stefan Girke
Browse files
Options
Downloads
Patches
Plain Diff
distinct between matrix-free and matrix-based solvers
parent
8f08b5c5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/fem-dg/misc/algorithmcreatorselector.hh
+73
-8
73 additions, 8 deletions
dune/fem-dg/misc/algorithmcreatorselector.hh
dune/fem-dg/misc/configurator.hh
+6
-4
6 additions, 4 deletions
dune/fem-dg/misc/configurator.hh
with
79 additions
and
12 deletions
dune/fem-dg/misc/algorithmcreatorselector.hh
+
73
−
8
View file @
7f5b6cb9
...
...
@@ -401,7 +401,7 @@ namespace Fem
///////////////////////////////////////////////////////////////////////////
// SolverSelector
//
Matrix
SolverSelector
///////////////////////////////////////////////////////////////////////////
template
<
Solver
::
Enum
solver
,
bool
dummy
=
false
>
...
...
@@ -409,7 +409,7 @@ namespace Fem
{};
template
<
Solver
::
Enum
solver
,
bool
symmetric
,
class
DomainDFSpace
,
class
RangeDFSpace
=
DomainDFSpace
>
struct
SolverSelector
struct
Matrix
SolverSelector
{
static
const
bool
solverConfigured
=
false
;
// this implementation is used for not installed packages
// choose type of discrete function, Matrix implementation and solver implementation
...
...
@@ -423,7 +423,7 @@ namespace Fem
};
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
SolverSelector
<
Solver
::
Enum
::
fem
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
struct
Matrix
SolverSelector
<
Solver
::
Enum
::
fem
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
typedef
Dune
::
Fem
::
AdaptiveDiscreteFunction
<
DomainDFSpace
>
DomainDiscreteFunctionType
;
...
...
@@ -436,7 +436,7 @@ namespace Fem
};
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
SolverSelector
<
Solver
::
Enum
::
femoem
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
struct
Matrix
SolverSelector
<
Solver
::
Enum
::
femoem
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
// choose type of discrete function, Matrix implementation and solver implementation
...
...
@@ -452,7 +452,7 @@ namespace Fem
#if HAVE_DUNE_ISTL
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
SolverSelector
<
Solver
::
Enum
::
istl
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
struct
Matrix
SolverSelector
<
Solver
::
Enum
::
istl
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
// choose type of discrete function, Matrix implementation and solver implementation
...
...
@@ -475,7 +475,7 @@ namespace Fem
#if HAVE_UMFPACK || HAVE_SUITESPARSE_UMFPACK
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
SolverSelector
<
Solver
::
Enum
::
umfpack
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
struct
Matrix
SolverSelector
<
Solver
::
Enum
::
umfpack
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
// choose type of discrete function, Matrix implementation and solver implementation
...
...
@@ -495,7 +495,7 @@ namespace Fem
#if HAVE_PETSC
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
SolverSelector
<
Solver
::
Enum
::
petsc
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
struct
Matrix
SolverSelector
<
Solver
::
Enum
::
petsc
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
// choose type of discrete function, Matrix implementation and solver implementation
...
...
@@ -518,7 +518,7 @@ namespace Fem
#if HAVE_EIGEN
#warning "Eigen solver is not working at the moment.!"
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
SolverSelector
<
Solver
::
Enum
::
eigen
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
struct
Matrix
SolverSelector
<
Solver
::
Enum
::
eigen
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
// choose type of discrete function, Matrix implementation and solver implementation
...
...
@@ -537,6 +537,71 @@ namespace Fem
};
#endif
///////////////////////////////////////////////////////////////////////////
// MatrixFreeSolverSelector
///////////////////////////////////////////////////////////////////////////
//template <Solver::Enum solver, bool symmetric, class DomainDFSpace, class RangeDFSpace = DomainDFSpace>
//struct MatrixFreeSolverSelector
//{
// static const bool solverConfigured = false; // this implementation is used for not installed packages
// // choose type of discrete function, Matrix implementation and solver implementation
// // this should work with any discrete function implementation
// typedef Dune::Fem::DynamicVector<double> DofVectorType;
// typedef Dune::Fem::ManagedDiscreteFunction< Dune::Fem::VectorDiscreteFunction< DomainDFSpace, DofVectorType > > DomainDiscreteFunctionType;
// typedef Dune::Fem::ManagedDiscreteFunction< Dune::Fem::VectorDiscreteFunction< RangeDFSpace, DofVectorType > > RangeDiscreteFunctionType;
// typedef DomainDiscreteFunctionType DiscreteFunctionType;
// typedef Dune::Fem::SparseRowLinearOperator< DomainDiscreteFunctionType, RangeDiscreteFunctionType > LinearOperatorType;
// typedef Dune::Fem::CGInverseOperator< DiscreteFunctionType > LinearInverseOperatorType;
//};
template
<
Solver
::
Enum
solver
,
bool
symmetric
,
class
DomainDFSpace
,
class
RangeDFSpace
=
DomainDFSpace
>
struct
MatrixFreeSolverSelector
{
static
const
bool
solverConfigured
=
false
;
typedef
Dune
::
Fem
::
AdaptiveDiscreteFunction
<
DomainDFSpace
>
DomainDiscreteFunctionType
;
typedef
Dune
::
Fem
::
AdaptiveDiscreteFunction
<
RangeDFSpace
>
RangeDiscreteFunctionType
;
typedef
DomainDiscreteFunctionType
DiscreteFunctionType
;
typedef
Dune
::
Fem
::
SparseRowLinearOperator
<
DomainDiscreteFunctionType
,
RangeDiscreteFunctionType
>
LinearOperatorType
;
typedef
typename
std
::
conditional
<
symmetric
,
Dune
::
Fem
::
CGInverseOperator
<
DiscreteFunctionType
>
,
Dune
::
Fem
::
ParDGGeneralizedMinResInverseOperator
<
DiscreteFunctionType
>
>
::
type
LinearInverseOperatorType
;
};
template
<
class
DomainDFSpace
,
class
RangeDFSpace
,
bool
symmetric
>
struct
MatrixFreeSolverSelector
<
Solver
::
Enum
::
fem
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
{
static
const
bool
solverConfigured
=
true
;
typedef
Dune
::
Fem
::
AdaptiveDiscreteFunction
<
DomainDFSpace
>
DomainDiscreteFunctionType
;
typedef
Dune
::
Fem
::
AdaptiveDiscreteFunction
<
RangeDFSpace
>
RangeDiscreteFunctionType
;
typedef
DomainDiscreteFunctionType
DiscreteFunctionType
;
typedef
Dune
::
Fem
::
SparseRowLinearOperator
<
DomainDiscreteFunctionType
,
RangeDiscreteFunctionType
>
LinearOperatorType
;
typedef
typename
std
::
conditional
<
symmetric
,
Dune
::
Fem
::
CGInverseOperator
<
DiscreteFunctionType
>
,
Dune
::
Fem
::
ParDGGeneralizedMinResInverseOperator
<
DiscreteFunctionType
>
>
::
type
LinearInverseOperatorType
;
};
///////////////////////////////////////////////////////////////////////////
// SolverSelector
///////////////////////////////////////////////////////////////////////////
template
<
Solver
::
Enum
solver
,
bool
symmetric
,
bool
matrixfree
,
class
DomainDFSpace
,
class
RangeDFSpace
=
DomainDFSpace
>
struct
SolverSelector
;
template
<
Solver
::
Enum
solver
,
bool
symmetric
,
class
DomainDFSpace
,
class
RangeDFSpace
>
struct
SolverSelector
<
solver
,
symmetric
,
true
,
DomainDFSpace
,
RangeDFSpace
>
{
typedef
MatrixFreeSolverSelector
<
solver
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
type
;
};
template
<
Solver
::
Enum
solver
,
bool
symmetric
,
class
DomainDFSpace
,
class
RangeDFSpace
>
struct
SolverSelector
<
solver
,
symmetric
,
false
,
DomainDFSpace
,
RangeDFSpace
>
{
typedef
MatrixSolverSelector
<
solver
,
symmetric
,
DomainDFSpace
,
RangeDFSpace
>
type
;
};
///////////////////////////////////////////////////////////////////////////
// DiscreteFunctionSpaceSelector
///////////////////////////////////////////////////////////////////////////
...
...
This diff is collapsed.
Click to expand it.
dune/fem-dg/misc/configurator.hh
+
6
−
4
View file @
7f5b6cb9
...
...
@@ -162,6 +162,8 @@ namespace Fem
static
const
DiffusionFlux
::
Enum
diffFluxId
=
(
diffFluxEnumId
==
DiffusionFlux
::
Enum
::
default_
)
?
diffFluxEnum
:
diffFluxEnumId
;
template
<
bool
symmetric
,
class
DomainDFSpace
,
class
RangeDFSpace
=
DomainDFSpace
>
using
SolverSelect
=
typename
SolverSelector
<
solverId
,
symmetric
,
Matrix
::
Enum
::
matrixfree
==
matrixId
?
true
:
false
,
DomainDFSpace
,
RangeDFSpace
>::
type
;
public
:
typedef
GridImp
GridType
;
...
...
@@ -178,7 +180,7 @@ namespace Fem
using
DiscreteFunctionSpaces
=
typename
DiscreteFunctionSpaceSelector
<
FunctionSpaceImp
,
GridPartImp
,
polOrd
,
spaceId
,
dgId
>::
type
;
template
<
class
DFSpace
>
using
DiscreteFunctions
=
typename
SolverSelect
or
<
solverId
,
false
,
DFSpace
>::
DiscreteFunctionType
;
using
DiscreteFunctions
=
typename
SolverSelect
<
false
,
DFSpace
>::
DiscreteFunctionType
;
template
<
class
ModelImp
,
AdvectionFlux
::
Enum
id
=
advFluxId
>
using
AdvectionFluxes
=
DGAdvectionFlux
<
ModelImp
,
id
>
;
...
...
@@ -194,7 +196,7 @@ namespace Fem
DiffusionFlux
::
Enum
diffId
=
diffFluxId
>
using
DefaultAssembTraits
=
DefaultAssemblerTraits
<
polOrd
,
AnalyticalTraitsImp
,
typename
SolverSelect
or
<
solverId
,
false
,
DomainDFSpace
,
RangeDFSpace
>::
LinearOperatorType
,
typename
SolverSelect
<
false
,
DomainDFSpace
,
RangeDFSpace
>::
LinearOperatorType
,
AdvectionFluxes
<
typename
AnalyticalTraitsImp
::
ModelType
,
advId
>
,
DiffusionFluxes
<
typename
AnalyticalTraitsImp
::
ModelType
,
DomainDFSpace
,
diffId
>
,
DiscreteFunctions
<
DomainDFSpace
>
,
...
...
@@ -223,11 +225,11 @@ namespace Fem
//Matrix Containers
template
<
class
DomainDFSpace
,
class
RangeDFSpace
>
using
Containers
=
typename
SolverSelect
or
<
solverId
,
false
,
DomainDFSpace
,
RangeDFSpace
>::
LinearOperatorType
;
using
Containers
=
typename
SolverSelect
<
false
,
DomainDFSpace
,
RangeDFSpace
>::
LinearOperatorType
;
//Solver
template
<
class
DFSpace
,
bool
symmetric
=
false
>
using
LinearSolvers
=
typename
SolverSelect
or
<
solverId
,
symmetric
,
DFSpace
>::
LinearInverseOperatorType
;
using
LinearSolvers
=
typename
SolverSelect
<
symmetric
,
DFSpace
>::
LinearInverseOperatorType
;
////Real Jacobian for Runge-Kutta
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment