28 #ifndef EWOMS_VCFV_DISCRETIZATION_HH
29 #define EWOMS_VCFV_DISCRETIZATION_HH
31 #include <opm/material/densead/Math.hpp>
43 #include <dune/fem/space/common/functionspace.hh>
44 #include <dune/fem/space/lagrange.hh>
48 template <
class TypeTag>
51 namespace Properties {
57 typedef typename GridView::ctype CoordScalar;
60 typedef Ewoms::
VcfvStencil<CoordScalar, GridView> type;
67 SET_TYPE_PROP(VcfvDiscretization, Discretization, Ewoms::VcfvDiscretization<TypeTag>);
83 SET_BOOL_PROP(VcfvDiscretization, UseP1FiniteElementGradients, false);
86 SET_PROP(VcfvDiscretization, DiscreteFunctionSpace)
93 typedef Dune::Fem::FunctionSpace<
typename GridPart::GridType::ctype,
95 GridPart::GridType::dimensionworld,
99 typedef Dune::Fem::LagrangeDiscreteFunctionSpace< FunctionSpace, GridPart, 1 > type;
104 SET_PROP(VcfvDiscretization, BorderListCreator)
106 typedef typename GET_PROP_TYPE(TypeTag, VertexMapper) VertexMapper;
109 typedef Ewoms::Linear::VertexBorderListFromGrid<GridView, VertexMapper> type;
115 SET_BOOL_PROP(VcfvDiscretization, LinearizeNonLocalElements, false);
124 template<class TypeTag>
125 class VcfvDiscretization : public FvBaseDiscretization<TypeTag>
127 typedef FvBaseDiscretization<TypeTag> ParentType;
128 typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
129 typedef typename
GET_PROP_TYPE(TypeTag, DofMapper) DofMapper;
131 typedef typename
GET_PROP_TYPE(TypeTag, Simulator) Simulator;
133 enum { dim = GridView::dimension };
136 VcfvDiscretization(Simulator& simulator)
137 : ParentType(simulator)
150 {
return static_cast<size_t>(this->gridView_.size(dim)); }
157 {
return this->vertexMapper(); }
166 template <
class Restarter>
168 { res.template serializeEntities<dim>(asImp_(), this->gridView_); }
177 template <
class Restarter>
180 res.template deserializeEntities<dim>(asImp_(), this->gridView_);
181 this->solution(1) = this->solution(0);
185 Implementation& asImp_()
186 {
return *
static_cast<Implementation*
>(
this); }
187 const Implementation& asImp_()
const
188 {
return *
static_cast<const Implementation*
>(
this); }
const DofMapper & dofMapper() const
Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices...
Definition: vcfvdiscretization.hh:156
#define SET_BOOL_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant boolean value.
Definition: propertysystem.hh:361
size_t numGridDof() const
Returns the number of global degrees of freedom (DOFs) due to the grid.
Definition: vcfvdiscretization.hh:149
void serialize(Restarter &res)
Serializes the current state of the model.
Definition: vcfvdiscretization.hh:167
The base class for the vertex centered finite volume discretization scheme.
Definition: vcfvdiscretization.hh:49
Represents the finite volume geometry of a single element in the VCFV discretization.
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
A class which provides types for DUNE grid handles for communication.
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
The base class for the finite volume discretization schemes.
Uses communication on the grid to find the initial seed list of indices.
void deserialize(Restarter &res)
Deserializes the state of the model.
Definition: vcfvdiscretization.hh:178
Implements the discretization specific parts of writing files.
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystem.hh:297
This class calculates gradients of arbitrary quantities at flux integration points using first order ...
Definition: p1fegradientcalculator.hh:65
Declares the basic properties used by the common infrastructure of the vertex-centered finite volume ...
A class which provides types for DUNE grid handles for communication.
Definition: vcfvgridcommhandlefactory.hh:45
This class calculates gradients of arbitrary quantities at flux integration points using first order ...
Implements the discretization specific parts of writing files.
Definition: vcfvbaseoutputmodule.hh:45
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
static std::string discretizationName()
Returns a string of discretization's human-readable name.
Definition: vcfvdiscretization.hh:143
Represents the finite volume geometry of a single element in the VCFV discretization.
Definition: vcfvstencil.hh:467