Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
4510549a
Commit
4510549a
authored
Mar 05, 2018
by
Timo Koch
Browse files
[linear] Free AMGTraits from TypeTag
parent
dfb6bd54
Changes
3
Hide whitespace changes
Inline
Side-by-side
dumux/linear/amgbackend.hh
View file @
4510549a
...
...
@@ -224,7 +224,9 @@ namespace Dumux {
* \note This is an adaptor using a TypeTag
*/
template
<
class
TypeTag
>
using
AMGBackend
=
ParallelAMGBackend
<
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
),
AmgTraits
<
TypeTag
>>
;
using
AMGBackend
=
ParallelAMGBackend
<
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
),
AmgTraits
<
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
),
typename
GET_PROP_TYPE
(
TypeTag
,
SolutionVector
),
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
>>
;
}
// namespace Dumux
...
...
dumux/linear/amgtraits.hh
View file @
4510549a
...
...
@@ -32,17 +32,16 @@
#include
<dune/istl/preconditioners.hh>
#include
<dune/grid/common/capabilities.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/methods.hh>
namespace
Dumux
{
//! The implementation is specialized for the different discretizations
template
<
class
Type
Tag
,
DiscretizationMethod
discMethod
>
struct
AmgTraitsImpl
;
template
<
class
M
Type
,
class
VType
,
class
FVGridGeometry
,
DiscretizationMethod
discMethod
>
struct
AmgTraitsImpl
;
//! The type traits required for using the AMG backend
template
<
class
Type
Tag
>
using
AmgTraits
=
AmgTraitsImpl
<
Type
Tag
,
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
discMethod
>
;
template
<
class
M
Type
,
class
VType
,
class
FVGridGeometry
>
using
AmgTraits
=
AmgTraitsImpl
<
M
Type
,
VType
,
FVGridGeometry
,
FVGridGeometry
::
discMethod
>
;
//! NonoverlappingSolverTraits used by discretization with non-overlapping parallel model
template
<
class
MType
,
class
VType
,
bool
isParallel
>
...
...
@@ -68,27 +67,24 @@ public:
#endif
//! Box: use the non-overlapping AMG
template
<
class
TypeTag
>
struct
AmgTraitsImpl
<
TypeTag
,
DiscretizationMethod
::
box
>
template
<
class
Matrix
,
class
Vector
,
class
FVGridGeometry
>
struct
AmgTraitsImpl
<
Matrix
,
Vector
,
FVGridGeometry
,
DiscretizationMethod
::
box
>
{
using
JacobianMatrix
=
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
);
using
Grid
=
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
);
using
Grid
=
typename
FVGridGeometry
::
GridView
::
Traits
::
Grid
;
enum
{
numEq
=
JacobianMatrix
::
block_type
::
rows
,
dofCodim
=
Grid
::
dimension
,
isNonOverlapping
=
true
,
isParallel
=
Dune
::
Capabilities
::
canCommunicate
<
Grid
,
dofCodim
>::
v
};
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
MType
=
Dune
::
BCRSMatrix
<
Dune
::
FieldMatrix
<
Scalar
,
numEq
,
numEq
>
>
;
using
VType
=
Dune
::
BlockVector
<
Dune
::
FieldVector
<
Scalar
,
numEq
>
>
;
using
MType
=
Matrix
;
using
VType
=
Dune
::
BlockVector
<
Dune
::
FieldVector
<
typename
Vector
::
block_type
::
value_type
,
Vector
::
block_type
::
dimension
>>
;
using
SolverTraits
=
NonoverlappingSolverTraits
<
MType
,
VType
,
isParallel
>
;
using
Comm
=
typename
SolverTraits
::
Comm
;
using
LinearOperator
=
typename
SolverTraits
::
LinearOperator
;
using
ScalarProduct
=
typename
SolverTraits
::
ScalarProduct
;
using
Smoother
=
typename
SolverTraits
::
Smoother
;
using
DofMapper
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
VertexMapper
;
using
DofMapper
=
typename
FVGridGeometry
::
VertexMapper
;
};
//! OverlappingSolverTraits used by discretization with overlapping parallel model
...
...
@@ -115,33 +111,29 @@ public:
#endif
//! Cell-centered tpfa: use the overlapping AMG
template
<
class
TypeTag
>
struct
AmgTraitsImpl
<
TypeTag
,
DiscretizationMethod
::
cctpfa
>
template
<
class
Matrix
,
class
Vector
,
class
FVGridGeometry
>
struct
AmgTraitsImpl
<
Matrix
,
Vector
,
FVGridGeometry
,
DiscretizationMethod
::
cctpfa
>
{
using
JacobianMatrix
=
typename
GET_PROP_TYPE
(
TypeTag
,
JacobianMatrix
);
using
Grid
=
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
);
using
Grid
=
typename
FVGridGeometry
::
GridView
::
Traits
::
Grid
;
enum
{
numEq
=
JacobianMatrix
::
block_type
::
rows
,
dofCodim
=
0
,
isNonOverlapping
=
false
,
isParallel
=
Dune
::
Capabilities
::
canCommunicate
<
Grid
,
dofCodim
>::
v
};
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
MType
=
Dune
::
BCRSMatrix
<
Dune
::
FieldMatrix
<
Scalar
,
numEq
,
numEq
>
>
;
using
VType
=
Dune
::
BlockVector
<
Dune
::
FieldVector
<
Scalar
,
numEq
>
>
;
using
MType
=
Matrix
;
using
VType
=
Dune
::
BlockVector
<
Dune
::
FieldVector
<
typename
Vector
::
block_type
::
value_type
,
Vector
::
block_type
::
dimension
>>
;
using
SolverTraits
=
OverlappingSolverTraits
<
MType
,
VType
,
isParallel
>
;
using
Comm
=
typename
SolverTraits
::
Comm
;
using
LinearOperator
=
typename
SolverTraits
::
LinearOperator
;
using
ScalarProduct
=
typename
SolverTraits
::
ScalarProduct
;
using
Smoother
=
typename
SolverTraits
::
Smoother
;
using
DofMapper
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
ElementMapper
;
using
DofMapper
=
typename
FVGridGeometry
::
ElementMapper
;
};
template
<
class
TypeTag
>
struct
AmgTraitsImpl
<
TypeTag
,
DiscretizationMethod
::
ccmpfa
>
:
public
AmgTraitsImpl
<
TypeTag
,
DiscretizationMethod
::
cctpfa
>
{};
template
<
class
Matrix
,
class
Vector
,
class
FVGridGeometry
>
struct
AmgTraitsImpl
<
Matrix
,
Vector
,
FVGridGeometry
,
DiscretizationMethod
::
ccmpfa
>
:
public
AmgTraitsImpl
<
Matrix
,
Vector
,
FVGridGeometry
,
DiscretizationMethod
::
cctpfa
>
{};
}
// end namespace Dumux
...
...
dumux/porousmediumflow/sequential/properties.hh
View file @
4510549a
...
...
@@ -133,12 +133,20 @@ SET_PROP(SequentialModel, FVGridGeometry)
:
public
DefaultMapperTraits
<
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
)
>
{
static
constexpr
DiscretizationMethod
discMethod
=
DiscretizationMethod
::
cctpfa
;
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
};
public:
using
type
=
FVGridGeometry
;
};
//! For compatibility with new style models we need a solution vector type
SET_PROP
(
SequentialModel
,
SolutionVector
)
{
public:
using
type
=
typename
GET_PROP
(
TypeTag
,
SolutionTypes
)
::
ScalarSolution
;
};
/*!
* \brief Specifies the types which are assoicated with a solution.
*
...
...
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