28 #ifndef EWOMS_ECFV_DISCRETIZATION_HH 29 #define EWOMS_ECFV_DISCRETIZATION_HH 31 #include <opm/material/densead/Math.hpp> 42 #include <dune/fem/space/common/functionspace.hh> 43 #include <dune/fem/space/finitevolume.hh> 47 template <
class TypeTag>
48 class EcfvDiscretization;
52 namespace Properties {
87 typedef Dune::Fem::FunctionSpace<
typename GridPart::GridType::ctype,
89 GridPart::GridType::dimensionworld,
92 typedef Dune::Fem::FiniteVolumeSpace< FunctionSpace, GridPart, 0 > type;
100 typedef typename GET_PROP_TYPE(TypeTag, ElementMapper) ElementMapper;
124 template<
class TypeTag>
125 class EcfvDiscretization :
public FvBaseDiscretization<TypeTag>
127 typedef FvBaseDiscretization<TypeTag> ParentType;
129 typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
130 typedef typename GET_PROP_TYPE(TypeTag, DofMapper) DofMapper;
131 typedef typename GET_PROP_TYPE(TypeTag, PrimaryVariables) PrimaryVariables;
132 typedef typename GET_PROP_TYPE(TypeTag, SolutionVector) SolutionVector;
133 typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
134 typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
137 EcfvDiscretization(Simulator& simulator)
138 : ParentType(simulator)
151 {
return static_cast<size_t>(this->gridView_.size(0)); }
177 auto ghostSync = GhostSyncHandle(this->
solution(0),
179 this->
gridView().communicate(ghostSync,
180 Dune::InteriorBorder_All_Interface,
181 Dune::ForwardCommunication);
191 template <
class Restarter>
193 { res.template serializeEntities<0>(asImp_(), this->gridView_); }
202 template <
class Restarter>
205 res.template deserializeEntities<0>(asImp_(), this->gridView_);
210 Implementation& asImp_()
211 {
return *
static_cast<Implementation*
>(
this); }
212 const Implementation& asImp_()
const 213 {
return *
static_cast<const Implementation*
>(
this); }
size_t numGridDof() const
Returns the number of global degrees of freedom (DOFs) due to the grid.
Definition: ecfvdiscretization.hh:150
const SolutionVector & solution(unsigned timeIdx) const
Reference to the solution at a given history index as a block vector.
Definition: fvbasediscretization.hh:1036
void serialize(Restarter &res)
Serializes the current state of the model.
Definition: ecfvdiscretization.hh:192
void deserialize(Restarter &res)
Deserializes the state of the model.
Definition: ecfvdiscretization.hh:203
#define SET_BOOL_PROP(EffTypeTagName, PropTagName,...)
Set a property to a simple constant boolean value.
Definition: propertysystem.hh:361
Represents the stencil (finite volume geometry) of a single element in the ECFV discretization.
Definition: ecfvstencil.hh:57
Definition: baseauxiliarymodule.hh:37
Represents the stencil (finite volume geometry) of a single element in the ECFV discretization.
void syncOverlap()
Syncronize the values of the primary variables on the degrees of freedom that overlap with the neighb...
Definition: ecfvdiscretization.hh:169
#define GET_PROP_VALUE(TypeTag, PropTagName)
Access the value attribute of a property for a type tag.
Definition: propertysystem.hh:469
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:486
static std::string discretizationName()
Returns a string of discretization's human-readable name.
Definition: ecfvdiscretization.hh:144
The base class for the element-centered finite-volume discretization scheme.
Definition: fvbasegradientcalculator.hh:39
The base class for the finite volume discretization schemes.
const ElementMapper & elementMapper() const
Returns the mapper for elements to indices.
Definition: fvbasediscretization.hh:1427
A class which provides types for DUNE grid handles for communication.
const DofMapper & dofMapper() const
Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices...
Definition: ecfvdiscretization.hh:157
#define SET_PROP(EffTypeTagName, PropTagName)
Set a property for a specific type tag.
Definition: propertysystem.hh:297
Uses communication on the grid to find the initial seed list of indices for methods which use element...
Uses communication on the grid to find the initial seed list of indices for methods which use element...
Definition: elementborderlistfromgrid.hh:52
Implements the discretization specific parts of writing files.
Data handle for parallel communication which can be used to set the values values of ghost and overla...
Definition: gridcommhandles.hh:103
A class which provides types for DUNE grid handles for communication.
Definition: ecfvgridcommhandlefactory.hh:45
#define SET_TYPE_PROP(EffTypeTagName, PropTagName,...)
Set a property which defines a type.
Definition: propertysystem.hh:377
const GridView & gridView() const
Reference to the grid view of the spatial domain.
Definition: fvbasediscretization.hh:1621
Declare the basic properties used by the common infrastructure of the element-centered finite volume ...
Implements the discretization specific parts of writing files.
Definition: ecfvbaseoutputmodule.hh:42