Commit 68d46cbf authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[operators] hide context definition from user

parent 674bda13
......@@ -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 the element-stencil-local data required to evaluate the terms
* \tparam EV The element-(stencil)-local variables
*/
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;
......
......@@ -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 the element-stencil-local data required to evaluate the terms
* \tparam ElemVars The element-(stencil)-local variables
* \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 LocalContext::ElementVariables;
using ElementVariables = typename LC::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;
......
......@@ -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 LocalContext Element-local context (geometry & primary/secondary variables)
* \tparam LC Element-local context (geometry & primary/secondary variables)
*/
template<class ModelTraits, class LocalContext>
template<class ModelTraits, class LC>
class FVNonIsothermalOperators
{
// The variables required for the evaluation of the equation
using ElementVariables = typename LocalContext::ElementVariables;
using ElementVariables = typename LC::ElementVariables;
// The grid geometry on which the scheme operates
using GridGeometry = typename LocalContext::ElementGridGeometry::GridGeometry;
using GridGeometry = typename LC::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
*
......
......@@ -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>;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment