Ewoms::EcfvDiscretization< TypeTag > Class Template Reference

The base class for the element-centered finite-volume discretization scheme. More...

#include <ecfvdiscretization.hh>

Inheritance diagram for Ewoms::EcfvDiscretization< TypeTag >:
Ewoms::FvBaseDiscretization< TypeTag >

Public Member Functions

 EcfvDiscretization (Simulator &simulator)
 
size_t numGridDof () const
 Returns the number of global degrees of freedom (DOFs) due to the grid.
 
const DofMapper & dofMapper () const
 Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices.
 
void syncOverlap ()
 Syncronize the values of the primary variables on the degrees of freedom that overlap with the neighboring processes. More...
 
template<class Restarter >
void serialize (Restarter &res)
 Serializes the current state of the model. More...
 
template<class Restarter >
void deserialize (Restarter &res)
 Deserializes the state of the model. More...
 
- Public Member Functions inherited from Ewoms::FvBaseDiscretization< TypeTag >
 FvBaseDiscretization (Simulator &simulator)
 
void finishInit ()
 Apply the initial conditions to the model.
 
bool enableGridAdaptation () const
 Returns whether the grid ought to be adapted to the solution during the simulation.
 
void applyInitialSolution ()
 Applies the initial solution for all degrees of freedom to which the model applies.
 
void prefetch (const Element &elem OPM_UNUSED) const
 Allows to improve the performance by prefetching all data which is associated with a given element.
 
NewtonMethodnewtonMethod ()
 Returns the newton method object.
 
const NewtonMethodnewtonMethod () const
 Returns the newton method object. More...
 
const IntensiveQuantities * thermodynamicHint (unsigned globalIdx, unsigned timeIdx) const
 Return the thermodynamic hint for a entity on the grid at given time. More...
 
const IntensiveQuantities * cachedIntensiveQuantities (unsigned globalIdx, unsigned timeIdx) const
 Return the cached intensive quantities for a entity on the grid at given time. More...
 
void updateCachedIntensiveQuantities (const IntensiveQuantities &intQuants, unsigned globalIdx, unsigned timeIdx) const
 Update the intensive quantity cache for a entity on the grid at given time. More...
 
void setIntensiveQuantitiesCacheEntryValidity (unsigned globalIdx, unsigned timeIdx, bool newValue) const
 Invalidate the cache for a given intensive quantities object. More...
 
void invalidateIntensiveQuantitiesCache (unsigned timeIdx) const
 Invalidate the whole intensive quantity cache for time index. More...
 
void shiftIntensiveQuantityCache (unsigned numSlots=1)
 Move the intensive quantities for a given time index to the back. More...
 
bool enableStorageCache () const
 Returns true iff the storage term is cached. More...
 
const EqVector & cachedStorage (unsigned globalIdx, unsigned timeIdx) const
 Retrieve an entry of the cache for the storage term. More...
 
void updateCachedStorage (unsigned globalIdx, unsigned timeIdx, const EqVector &value) const
 Set an entry of the cache for the storage term. More...
 
Scalar globalResidual (GlobalEqVector &dest, const SolutionVector &u) const
 Compute the global residual for an arbitrary solution vector. More...
 
Scalar globalResidual (GlobalEqVector &dest) const
 Compute the global residual for the current solution vector. More...
 
void globalStorage (EqVector &storage, unsigned timeIdx=0) const
 Compute the integral over the domain of the storage terms of all conservation quantities. More...
 
void checkConservativeness (Scalar OPM_OPTIM_UNUSED tolerance=-1, bool OPM_OPTIM_UNUSED verbose=false) const
 Ensure that the difference between the storage terms of the last and of the current time step is consistent with the source and boundary terms. More...
 
Scalar dofTotalVolume (unsigned globalIdx) const
 Returns the volume $\mathrm{[m^3]}$ of a given control volume. More...
 
bool isLocalDof (unsigned globalIdx) const
 Returns if the overlap of the volume ofa degree of freedom is non-zero. More...
 
Scalar gridTotalVolume () const
 Returns the volume $\mathrm{[m^3]}$ of the whole grid which represents the spatial domain.
 
const SolutionVector & solution (unsigned timeIdx) const
 Reference to the solution at a given history index as a block vector. More...
 
SolutionVector & solution (unsigned timeIdx)
 
const Linearizer & linearizer () const
 Returns the operator linearizer for the global jacobian of the problem.
 
Linearizer & linearizer ()
 Returns the object which linearizes the global system of equations at the current solution.
 
const LocalLinearizer & localLinearizer (unsigned openMpThreadId) const
 Returns the local jacobian which calculates the local stiffness matrix for an arbitrary element. More...
 
LocalLinearizer & localLinearizer (unsigned openMpThreadId)
 
const LocalResidual & localResidual (unsigned openMpThreadId) const
 Returns the object to calculate the local residual function.
 
LocalResidual & localResidual (unsigned openMpThreadId)
 
Scalar primaryVarWeight (unsigned globalDofIdx, unsigned pvIdx) const
 Returns the relative weight of a primary variable for calculating relative errors. More...
 
Scalar eqWeight (unsigned globalVertexIdx OPM_UNUSED, unsigned eqIdx OPM_UNUSED) const
 Returns the relative weight of an equation. More...
 
Scalar relativeDofError (unsigned vertexIdx, const PrimaryVariables &pv1, const PrimaryVariables &pv2) const
 Returns the relative error between two vectors of primary variables. More...
 
bool update ()
 Try to progress the model to the next timestep. More...
 
void syncOverlap ()
 Syncronize the values of the primary variables on the degrees of freedom that overlap with the neighboring processes. More...
 
void updateBegin ()
 Called by the update() method before it tries to apply the newton method. More...
 
void updateSuccessful ()
 Called by the update() method if it was successful.
 
void adaptGrid ()
 Called by the update() method when the grid should be refined.
 
void updateFailed ()
 Called by the update() method if it was unsuccessful. More...
 
void advanceTimeLevel ()
 Called by the problem if a time integration was successful, post processing of the solution is done and the result has been written to disk. More...
 
template<class Restarter >
void serialize (Restarter &res OPM_UNUSED)
 Serializes the current state of the model. More...
 
template<class Restarter >
void deserialize (Restarter &res OPM_UNUSED)
 Deserializes the state of the model. More...
 
template<class DofEntity >
void serializeEntity (std::ostream &outstream, const DofEntity &dof)
 Write the current solution for a degree of freedom to a restart file. More...
 
template<class DofEntity >
void deserializeEntity (std::istream &instream, const DofEntity &dof)
 Reads the current solution variables for a degree of freedom from a restart file. More...
 
size_t numGridDof () const
 Returns the number of degrees of freedom (DOFs) for the computational grid.
 
size_t numAuxiliaryDof () const
 Returns the number of degrees of freedom (DOFs) of the auxiliary equations.
 
size_t numTotalDof () const
 Returns the total number of degrees of freedom (i.e., grid plux auxiliary DOFs)
 
const DofMapper & dofMapper () const
 Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices.
 
const VertexMapper & vertexMapper () const
 Returns the mapper for vertices to indices.
 
const ElementMapper & elementMapper () const
 Returns the mapper for elements to indices.
 
void resetLinearizer ()
 Resets the Jacobian matrix linearizer, so that the boundary types can be altered.
 
std::string primaryVarName (unsigned pvIdx) const
 Given an primary variable index, return a human readable name. More...
 
std::string eqName (unsigned eqIdx) const
 Given an equation index, return a human readable name. More...
 
void updatePVWeights (const ElementContext &elemCtx OPM_UNUSED) const
 Update the weights of all primary variables within an element given the complete set of intensive quantities. More...
 
void addOutputModule (BaseOutputModule< TypeTag > *newModule)
 Add an module for writing visualization output after a timestep.
 
template<class VtkMultiWriter >
void addConvergenceVtkFields (VtkMultiWriter &writer, const SolutionVector &u, const GlobalEqVector &deltaU) const
 Add the vector fields for analysing the convergence of the newton method to the a VTK writer. More...
 
void prepareOutputFields () const
 Prepare the quantities relevant for the current solution to be appended to the output writers.
 
void appendOutputFields (BaseOutputWriter &writer) const
 Append the quantities relevant for the current solution to an output writer.
 
const GridView & gridView () const
 Reference to the grid view of the spatial domain.
 
void addAuxiliaryModule (std::shared_ptr< BaseAuxiliaryModule< TypeTag > > auxMod)
 Add a module for an auxiliary equation. More...
 
void clearAuxiliaryModules ()
 Causes the list of auxiliary equations to be cleared. More...
 
size_t numAuxiliaryModules () const
 Returns the number of modules for auxiliary equations.
 
std::shared_ptr< BaseAuxiliaryModule< TypeTag > > auxiliaryModule (unsigned auxEqModIdx)
 Returns a given module for auxiliary equations.
 
std::shared_ptr< const BaseAuxiliaryModule< TypeTag > > auxiliaryModule (unsigned auxEqModIdx) const
 Returns a given module for auxiliary equations.
 
const Ewoms::TimerprePostProcessTimer () const
 
const Ewoms::TimerlinearizeTimer () const
 
const Ewoms::TimersolveTimer () const
 
const Ewoms::TimerupdateTimer () const
 

Static Public Member Functions

static std::string discretizationName ()
 Returns a string of discretization's human-readable name.
 
- Static Public Member Functions inherited from Ewoms::FvBaseDiscretization< TypeTag >
static void registerParameters ()
 Register all run-time parameters for the model.
 
static std::string discretizationName ()
 Returns a string of discretization's human-readable name.
 
static bool storeIntensiveQuantities ()
 Returns true if the cache for intensive quantities is enabled.
 

Additional Inherited Members

- Protected Member Functions inherited from Ewoms::FvBaseDiscretization< TypeTag >
SolutionVector & mutableSolution (unsigned timeIdx) const
 
void resizeAndResetIntensiveQuantitiesCache_ ()
 
template<class Context >
void supplementInitialSolution_ (PrimaryVariables &priVars OPM_UNUSED, const Context &context OPM_UNUSED, unsigned dofIdx OPM_UNUSED, unsigned timeIdx OPM_UNUSED)
 
void registerOutputModules_ ()
 Register all output modules which make sense for the model. More...
 
LocalResidual & localResidual_ ()
 Reference to the local residal object.
 
bool verbose_ () const
 Returns whether messages should be printed.
 
Implementation & asImp_ ()
 
const Implementation & asImp_ () const
 
- Static Protected Member Functions inherited from Ewoms::FvBaseDiscretization< TypeTag >
static bool enableIntensiveQuantitiesCache_ ()
 
static bool enableThermodynamicHints_ ()
 
- Protected Attributes inherited from Ewoms::FvBaseDiscretization< TypeTag >
Simulatorsimulator_
 
GridView gridView_
 
ElementMapper elementMapper_
 
VertexMapper vertexMapper_
 
std::vector< std::shared_ptr< BaseAuxiliaryModule< TypeTag > > > auxEqModules_
 
NewtonMethod newtonMethod_
 
Ewoms::Timer prePostProcessTimer_
 
Ewoms::Timer linearizeTimer_
 
Ewoms::Timer solveTimer_
 
Ewoms::Timer updateTimer_
 
std::vector< LocalLinearizer > localLinearizer_
 
Linearizer * linearizer_
 
IntensiveQuantitiesVector intensiveQuantityCache_ [historySize]
 
std::vector< bool > intensiveQuantityCacheUpToDate_ [historySize]
 
DiscreteFunctionSpace space_
 
std::array< std::unique_ptr< DiscreteFunction >, historySize > solution_
 
std::list< BaseOutputModule< TypeTag > * > outputModules_
 
Scalar gridTotalVolume_
 
std::vector< Scalar > dofTotalVolume_
 
std::vector< bool > isLocalDof_
 
bool enableGridAdaptation_
 
GlobalEqVector storageCache_ [historySize]
 
bool enableStorageCache_
 

Detailed Description

template<class TypeTag>
class Ewoms::EcfvDiscretization< TypeTag >

The base class for the element-centered finite-volume discretization scheme.

Member Function Documentation

◆ deserialize()

template<class TypeTag >
template<class Restarter >
void Ewoms::EcfvDiscretization< TypeTag >::deserialize ( Restarter &  res)
inline

Deserializes the state of the model.

Template Parameters
RestarterThe type of the serializer class
Parameters
resThe serializer object

◆ serialize()

template<class TypeTag >
template<class Restarter >
void Ewoms::EcfvDiscretization< TypeTag >::serialize ( Restarter &  res)
inline

Serializes the current state of the model.

Template Parameters
RestarterThe type of the serializer class
Parameters
resThe serializer object

◆ syncOverlap()

template<class TypeTag >
void Ewoms::EcfvDiscretization< TypeTag >::syncOverlap ( )
inline

Syncronize the values of the primary variables on the degrees of freedom that overlap with the neighboring processes.

For the Element Centered Finite Volume discretization, this method retrieves the primary variables corresponding to overlap/ghost elements from their respective master process.


The documentation for this class was generated from the following files: