Commit a45b6171 authored by Kilian Weishaupt's avatar Kilian Weishaupt

[staggered] Rename globalFaceVars -> gridFaceVars

parent c0779a22
......@@ -70,7 +70,7 @@ class StaggeredLocalAssembler<TypeTag,
using NumEqVector = typename GET_PROP_TYPE(TypeTag, NumEqVector);
using ElementBoundaryTypes = typename GET_PROP_TYPE(TypeTag, ElementBoundaryTypes);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using GlobalFaceVars = typename GET_PROP_TYPE(TypeTag, GlobalFaceVars);
using GridFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables);
using ElementFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, ElementFluxVariablesCache);
using Element = typename GET_PROP_TYPE(TypeTag, GridView)::template Codim<0>::Entity;
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
......@@ -649,14 +649,14 @@ private:
{ return gridVolVars.volVars(scv); }
template<class T = TypeTag>
static typename std::enable_if<!GET_PROP_VALUE(T, EnableGlobalFaceVariablesCache), FaceVariables&>::type
getFaceVarAccess(GlobalFaceVars& gridFaceVars, ElementFaceVariables& elemFaceVars, const SubControlVolumeFace& scvf)
static typename std::enable_if<!GET_PROP_VALUE(T, EnableGridFaceVariablesCache), FaceVariables&>::type
getFaceVarAccess(GridFaceVariables& GridFaceVariables, ElementFaceVariables& elemFaceVars, const SubControlVolumeFace& scvf)
{ return elemFaceVars[scvf]; }
template<class T = TypeTag>
static typename std::enable_if<GET_PROP_VALUE(T, EnableGlobalFaceVariablesCache), FaceVariables&>::type
getFaceVarAccess(GlobalFaceVars& gridFaceVars, ElementFaceVariables& elemFaceVars, const SubControlVolumeFace& scvf)
{ return gridFaceVars.faceVars(scvf.index()); }
static typename std::enable_if<GET_PROP_VALUE(T, EnableGridFaceVariablesCache), FaceVariables&>::type
getFaceVarAccess(GridFaceVariables& GridFaceVariables, ElementFaceVariables& elemFaceVars, const SubControlVolumeFace& scvf)
{ return GridFaceVariables.faceVars(scvf.index()); }
};
} // end namespace Dumux
......
......@@ -186,9 +186,7 @@ NEW_PROP_TAG(NumEqCellCenter); //!< The number of equations
NEW_PROP_TAG(NumEqFace); //!< The number of equations for face dofs
NEW_PROP_TAG(CellCenterSolutionVector); //!< The solution vector type for cell-centered dofs
NEW_PROP_TAG(FaceSolutionVector); //!< The solution vector type for face dofs
NEW_PROP_TAG(StaggeredFaceSolution); //!< The solution on the face
NEW_PROP_TAG(GlobalFaceVars); //!< Class containing face-related data
NEW_PROP_TAG(ElementFaceVariables); //!< Face data per element
NEW_PROP_TAG(GridFaceVariables); //!< Global vector containing face-related data
NEW_PROP_TAG(CellCenterPrimaryVariables); //!< The primary variables container type for cell-centered dofs
NEW_PROP_TAG(FacePrimaryVariables); //!< The primary variables container type for face dofs
NEW_PROP_TAG(IntersectionMapper); //!< Specifies the intersection mapper
......@@ -198,7 +196,7 @@ NEW_PROP_TAG(StaggeredPrimaryVariables); //!< The hybrid primary varia
NEW_PROP_TAG(BaseEpsilon); //!< A base epsilon for numerical differentiation, can contain multiple values
NEW_PROP_TAG(FaceVariables); //!< Class containing local face-related data
NEW_PROP_TAG(BoundaryValues); //!< Class containing local boundary data
NEW_PROP_TAG(EnableGlobalFaceVariablesCache); //!< If the face variables are cached on the gridview
NEW_PROP_TAG(EnableGridFaceVariablesCache); //!< Switch on/off caching of face variables
/////////////////////////////////////////////////////////////
// Properties used by the mpnc model
......
......@@ -32,34 +32,34 @@ namespace Dumux
* \ingroup ImplicitModel
* \brief Base class for the face variables vector
*/
template<class TypeTag, bool enableGlobalFaceVarsCache>
template<class TypeTag, bool enableGridFaceVariablesCache>
class StaggeredElementFaceVariables
{};
template<class TypeTag>
class StaggeredElementFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/true>
class StaggeredElementFaceVariables<TypeTag, /*enableGridFaceVariablesCache*/true>
{
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Element = typename GridView::template Codim<0>::Entity;
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace);
using GlobalFaceVars = typename GET_PROP_TYPE(TypeTag, GlobalFaceVars);
using GridFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables);
using FaceVariables = typename GET_PROP_TYPE(TypeTag, FaceVariables);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using IndexType = typename GridView::IndexSet::IndexType;
public:
StaggeredElementFaceVariables(const GlobalFaceVars& globalFacesVars) : globalFaceVarsPtr_(&globalFacesVars) {}
StaggeredElementFaceVariables(const GridFaceVariables& gridFaceVariables) : gridFaceVariablesPtr_(&gridFaceVariables) {}
const FaceVariables& operator [](const SubControlVolumeFace& scvf) const
{ return globalFaceVars().faceVars(scvf.index()); }
{ return gridFaceVariables().faceVars(scvf.index()); }
// operator for the access with an index
// needed for cc methods for the access to the boundary volume variables
const FaceVariables& operator [](const IndexType scvfIdx) const
{ return globalFaceVars().faceVars(scvfIdx); }
{ return gridFaceVariables().faceVars(scvfIdx); }
//! For compatibility reasons with the case of not storing the face vars.
......@@ -78,22 +78,22 @@ public:
//! The global volume variables object we are a restriction of
const GlobalFaceVars& globalFaceVars() const
{ return *globalFaceVarsPtr_; }
const GridFaceVariables& gridFaceVariables() const
{ return *gridFaceVariablesPtr_; }
private:
const GlobalFaceVars* globalFaceVarsPtr_;
const GridFaceVariables* gridFaceVariablesPtr_;
};
template<class TypeTag>
class StaggeredElementFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/false>
class StaggeredElementFaceVariables<TypeTag, /*enableGridFaceVariablesCache*/false>
{
using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using Element = typename GridView::template Codim<0>::Entity;
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace);
using GlobalFaceVars = typename GET_PROP_TYPE(TypeTag, GlobalFaceVars);
using GridFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables);
using FaceVariables = typename GET_PROP_TYPE(TypeTag, FaceVariables);
using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVElementGeometry);
using IndexType = typename GridView::IndexSet::IndexType;
......@@ -104,7 +104,7 @@ class StaggeredElementFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/false>
public:
StaggeredElementFaceVariables(const GlobalFaceVars& globalFacesVars) : globalFaceVarsPtr_(&globalFacesVars) {}
StaggeredElementFaceVariables(const GridFaceVariables& globalFacesVars) : gridFaceVariablesPtr_(&globalFacesVars) {}
const FaceVariables& operator [](const SubControlVolumeFace& scvf) const
{ return faceVariables_[scvf.localFaceIdx()]; }
......@@ -131,7 +131,7 @@ public:
for(auto&& scvf : scvfs(fvGeometry))
{
faceVariables_[scvf.localFaceIdx()].update(sol[faceIdx], globalFaceVars().problem(), element, fvGeometry, scvf);
faceVariables_[scvf.localFaceIdx()].update(sol[faceIdx], GridFaceVariables().problem(), element, fvGeometry, scvf);
faceVarIndices_[scvf.localFaceIdx()] = scvf.index();
}
}
......@@ -153,8 +153,8 @@ public:
}
//! The global volume variables object we are a restriction of
const GlobalFaceVars& globalFaceVars() const
{ return *globalFaceVarsPtr_; }
const GridFaceVariables& gridFaceVariables() const
{ return *gridFaceVariablesPtr_; }
private:
......@@ -165,7 +165,7 @@ private:
return std::distance(faceVarIndices_.begin(), it);
}
const GlobalFaceVars* globalFaceVarsPtr_;
const GridFaceVariables* gridFaceVariablesPtr_;
std::vector<IndexType> faceVarIndices_;
std::vector<FaceVariables> faceVariables_;
};
......
......@@ -29,17 +29,12 @@
namespace Dumux
{
namespace Properties
{
NEW_PROP_TAG(ElementFaceVariables);
}
template<class TypeTag, bool enableGlobalFaceVarsCache>
class StaggeredGlobalFaceVariables
class StaggeredGridFaceVariables
{};
template<class TypeTag>
class StaggeredGlobalFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/true>
class StaggeredGridFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/true>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
......@@ -55,7 +50,7 @@ class StaggeredGlobalFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/true>
typename DofTypeIndices::FaceIdx faceIdx;
public:
StaggeredGlobalFaceVariables(const Problem& problem) : problemPtr_(&problem) {}
StaggeredGridFaceVariables(const Problem& problem) : problemPtr_(&problem) {}
void update(const FVGridGeometry& fvGridGeometry, const SolutionVector& sol)
{
......@@ -86,7 +81,7 @@ public:
* The local object is only functional after calling its bind/bindElement method
* This is a free function that will be found by means of ADL
*/
friend inline ElementFaceVariables localView(const StaggeredGlobalFaceVariables& global)
friend inline ElementFaceVariables localView(const StaggeredGridFaceVariables& global)
{ return ElementFaceVariables(global); }
const Problem& problem() const
......@@ -100,7 +95,7 @@ private:
};
template<class TypeTag>
class StaggeredGlobalFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/false>
class StaggeredGridFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/false>
{
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
......@@ -116,7 +111,7 @@ class StaggeredGlobalFaceVariables<TypeTag, /*enableGlobalFaceVarsCache*/false>
typename DofTypeIndices::FaceIdx faceIdx;
public:
StaggeredGlobalFaceVariables(const Problem& problem) : problemPtr_(&problem) {}
StaggeredGridFaceVariables(const Problem& problem) : problemPtr_(&problem) {}
void update(const FVGridGeometry& fvGridGeometry, const SolutionVector& sol)
{ }
......@@ -126,7 +121,7 @@ public:
* The local object is only functional after calling its bind/bindElement method
* This is a free function that will be found by means of ADL
*/
friend inline ElementFaceVariables localView(const StaggeredGlobalFaceVariables& global)
friend inline ElementFaceVariables localView(const StaggeredGridFaceVariables& global)
{ return ElementFaceVariables(global); }
const Problem& problem() const
......
......@@ -40,7 +40,7 @@ class StaggeredGridVariables : public FVGridVariables<TypeTag>
using Problem = typename GET_PROP_TYPE(TypeTag, Problem);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using GridVolumeVariables = typename GET_PROP_TYPE(TypeTag, GridVolumeVariables);
using GridFaceVariables = typename GET_PROP_TYPE(TypeTag, GlobalFaceVars);
using GridFaceVariables = typename GET_PROP_TYPE(TypeTag, GridFaceVariables);
using GridFluxVariablesCache = typename GET_PROP_TYPE(TypeTag, GridFluxVariablesCache);
using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
......
......@@ -42,7 +42,7 @@
#include <dumux/discretization/staggered/elementvolumevariables.hh>
#include <dumux/discretization/staggered/fvgridgeometry.hh>
#include <dumux/discretization/staggered/fvelementgeometry.hh>
#include <dumux/discretization/staggered/globalfacevariables.hh>
#include <dumux/discretization/staggered/gridfacevariables.hh>
#include <dumux/discretization/staggered/facesolution.hh>
#include <dumux/discretization/staggered/elementfacevariables.hh>
#include <dumux/discretization/staggered/subcontrolvolumeface.hh>
......@@ -64,7 +64,6 @@ NEW_PROP_TAG(CellCenterSolutionVector);
NEW_PROP_TAG(FaceSolutionVector);
NEW_PROP_TAG(StaggeredFaceSolution);
NEW_PROP_TAG(ElementFaceVariables);
NEW_PROP_TAG(EnableGlobalFaceVariablesCache);
//! Type tag for the staggered scheme.
NEW_TYPE_TAG(StaggeredModel, INHERITS_FROM(FiniteVolumeModel));
......@@ -128,7 +127,8 @@ public:
using type = BaseStaggeredGeometryHelper<GridView>;
};
SET_TYPE_PROP(StaggeredModel, GlobalFaceVars, StaggeredGlobalFaceVariables<TypeTag, GET_PROP_VALUE(TypeTag, EnableGlobalFaceVariablesCache)>);
//! Set the default global face variables
SET_TYPE_PROP(StaggeredModel, GridFaceVariables, StaggeredGridFaceVariables<TypeTag, GET_PROP_VALUE(TypeTag, EnableGridFaceVariablesCache)>);
//! Set the default for the ElementBoundaryTypes
SET_TYPE_PROP(StaggeredModel, ElementBoundaryTypes, CCElementBoundaryTypes<TypeTag>);
......@@ -152,9 +152,9 @@ SET_TYPE_PROP(StaggeredModel, IntersectionMapper, ConformingGridIntersectionMapp
SET_TYPE_PROP(StaggeredModel, StaggeredFaceSolution, StaggeredFaceSolution<TypeTag>);
SET_TYPE_PROP(StaggeredModel, ElementFaceVariables, StaggeredElementFaceVariables<TypeTag, GET_PROP_VALUE(TypeTag, EnableGlobalFaceVariablesCache)>);
SET_TYPE_PROP(StaggeredModel, ElementFaceVariables, StaggeredElementFaceVariables<TypeTag, GET_PROP_VALUE(TypeTag, EnableGridFaceVariablesCache)>);
SET_BOOL_PROP(StaggeredModel, EnableGlobalFaceVariablesCache, true);
SET_BOOL_PROP(StaggeredModel, EnableGridFaceVariablesCache, true);
//! Definition of the indices for cell center and face dofs in the global solution vector
SET_PROP(StaggeredModel, DofTypeIndices)
......
Markdown is supported
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