Skip to content
GitLab
Menu
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
68d46cbf
Commit
68d46cbf
authored
Mar 15, 2021
by
Dennis Gläser
Browse files
[operators] hide context definition from user
parent
674bda13
Changes
4
Hide whitespace changes
Inline
Side-by-side
dumux/assembly/fv/operators.hh
View file @
68d46cbf
...
...
@@ -27,18 +27,30 @@
#include <dumux/common/numeqvector.hh>
#include <dumux/discretization/extrusion.hh>
#include <dumux/discretization/localcontext.hh>
namespace
Dumux
::
Experimental
{
/*!
* \ingroup Assembly
* \brief Convenience alias to define the context finite-volume operators work on.
* \tparam EV The element-(stencil)-local variables
*/
template
<
class
EV
>
using
FVOperatorsContext
=
DefaultLocalContext
<
EV
>
;
/*!
* \ingroup Assembly
* \brief The base class for the sub-control entity-local evaluation of
* the terms of equations in the context of finite-volume schemes
* \tparam
LC t
he element-stencil-local
data required to evaluate the term
s
* \tparam
EV T
he element-
(
stencil
)
-local
variable
s
*/
template
<
class
LC
>
template
<
class
EV
>
class
FVOperators
{
// context type on which to operate
using
LC
=
FVOperatorsContext
<
EV
>
;
// The grid geometry on which the scheme operates
using
FVElementGeometry
=
typename
LC
::
ElementGridGeometry
;
using
GridGeometry
=
typename
FVElementGeometry
::
GridGeometry
;
...
...
dumux/porousmediumflow/immiscible/operators.hh
View file @
68d46cbf
...
...
@@ -38,7 +38,7 @@ namespace Dumux::Experimental {
* \tparam ModelTraits defines model-related types and variables (e.g. number of phases)
* \tparam FluxVariables the type that is responsible for computing the individual
* flux contributions, i.e., advective, diffusive, convective...
* \tparam
LocalContext t
he element-stencil-local
data required to evaluate the term
s
* \tparam
ElemVars T
he element-
(
stencil
)
-local
variable
s
* \tparam EnergyOperators optional template argument, specifying the class that
* handles the operators related to non-isothermal effects.
* The default energy operators are compatible with isothermal
...
...
@@ -46,15 +46,16 @@ namespace Dumux::Experimental {
*/
template
<
class
ModelTraits
,
class
FluxVariables
,
class
LocalContext
,
class
EnergyOperators
=
FVNonIsothermalOperators
<
ModelTraits
,
LocalContext
>
>
class
ElemVars
,
class
EnergyOperators
=
FVNonIsothermalOperators
<
ModelTraits
,
FVOperatorsContext
<
ElemVars
>
>>
class
FVImmiscibleOperators
:
public
FVOperators
<
LocalContext
>
:
public
FVOperators
<
ElemVars
>
{
using
ParentType
=
FVOperators
<
LocalContext
>
;
using
ParentType
=
FVOperators
<
ElemVars
>
;
using
LC
=
typename
ParentType
::
LocalContext
;
// The variables required for the evaluation of the equation
using
ElementVariables
=
typename
L
ocalContext
::
ElementVariables
;
using
ElementVariables
=
typename
L
C
::
ElementVariables
;
using
GridVariables
=
typename
ElementVariables
::
GridVariables
;
using
VolumeVariables
=
typename
GridVariables
::
VolumeVariables
;
using
ElementVolumeVariables
=
typename
ElementVariables
::
ElementVolumeVariables
;
...
...
@@ -78,6 +79,9 @@ class FVImmiscibleOperators
static
constexpr
bool
enableEnergyBalance
=
ModelTraits
::
enableEnergyBalance
();;
public:
//! export the type of context on which this class operates
using
LocalContext
=
LC
;
//! export the type used to store scalar values for all equations
using
typename
ParentType
::
NumEqVector
;
...
...
dumux/porousmediumflow/nonisothermal/operators.hh
View file @
68d46cbf
...
...
@@ -34,20 +34,23 @@ namespace Dumux::Experimental {
* involved in the system of equations of non-isothermal models
* that assume thermal equilibrium between all phases.
* \tparam ModelTraits Model-specific traits.
* \tparam L
ocalContext
Element-local context (geometry & primary/secondary variables)
* \tparam L
C
Element-local context (geometry & primary/secondary variables)
*/
template
<
class
ModelTraits
,
class
L
ocalContext
>
template
<
class
ModelTraits
,
class
L
C
>
class
FVNonIsothermalOperators
{
// The variables required for the evaluation of the equation
using
ElementVariables
=
typename
L
ocalContext
::
ElementVariables
;
using
ElementVariables
=
typename
L
C
::
ElementVariables
;
// The grid geometry on which the scheme operates
using
GridGeometry
=
typename
L
ocalContext
::
ElementGridGeometry
::
GridGeometry
;
using
GridGeometry
=
typename
L
C
::
ElementGridGeometry
::
GridGeometry
;
using
SubControlVolume
=
typename
GridGeometry
::
SubControlVolume
;
public:
//! export the type of context on which this class operates
using
LocalContext
=
LC
;
/*!
* \brief The energy storage in the fluid phase with index phaseIdx
*
...
...
test/porousmediumflow/1p/compressible/instationary/main_experimental.cc
View file @
68d46cbf
...
...
@@ -128,8 +128,8 @@ int main(int argc, char** argv)
// the assembler (we use the immiscible operators to define the system of equations)
using
ModelTraits
=
GetPropType
<
TypeTag
,
Properties
::
ModelTraits
>
;
using
FluxVariables
=
GetPropType
<
TypeTag
,
Properties
::
FluxVariables
>
;
using
LocalContext
=
Experimental
::
LocalContext
<
typename
GridVariables
::
LocalView
>
;
using
Operators
=
Experimental
::
FVImmiscibleOperators
<
ModelTraits
,
FluxVariables
,
LocalContext
>
;
using
ElementVariables
=
typename
GridVariables
::
LocalView
;
using
Operators
=
Experimental
::
FVImmiscibleOperators
<
ModelTraits
,
FluxVariables
,
ElementVariables
>
;
using
LocalOperator
=
Experimental
::
FVLocalOperator
<
Operators
>
;
using
LocalAssembler
=
Experimental
::
LocalAssembler
<
LocalOperator
>
;
...
...
Write
Preview
Supports
Markdown
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