The base class for the vertex centered finite volume discretization scheme.
More...
#include <vcfvdiscretization.hh>
|
| VcfvDiscretization (Simulator &simulator) |
|
size_t | numGridDof () const |
| Returns the number of global degrees of freedom (DOFs) due to the grid. More...
|
|
const DofMapper & | dofMapper () const |
| Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices. 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...
|
|
void | finishInit () |
| Apply the initial conditions to the model. More...
|
|
void | applyInitialSolution () |
| Applies the initial solution for all degrees of freedom to which the model applies. More...
|
|
NewtonMethod & | newtonMethod () |
| Returns the newton method object. More...
|
|
const NewtonMethod & | newtonMethod () const |
| Returns the newton method object. More...
|
|
const IntensiveQuantities * | thermodynamicHint (int globalIdx, int timeIdx) const |
| Return the thermodynamic hint for a entity on the grid at given time. More...
|
|
const IntensiveQuantities * | cachedIntensiveQuantities (int globalIdx, int timeIdx) const |
| Return the cached intensive quantities for a entity on the grid at given time. More...
|
|
void | updateCachedIntensiveQuantities (const IntensiveQuantities &intQuants, int globalIdx, int timeIdx) const |
| Update the intensive quantity cache for a entity on the grid at given time. More...
|
|
void | setIntensiveQuantitiesCacheEntryValidity (int globalIdx, int timeIdx, bool newValue) const |
| Invalidate the cache for a given intensive quantities object. More...
|
|
void | shiftIntensiveQuantityCache (int numSlots=1) |
| Move the intensive quantities for a given time index to the back. 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, int timeIdx=0) const |
| Compute the integral over the domain of the storage terms of all conservation quantities. More...
|
|
void | checkConservativeness (Scalar tolerance=-1, bool 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 (int globalIdx) const |
| Returns the volume of a given control volume. More...
|
|
bool | isLocalDof (int globalIdx) const |
| Returns if the overlap of the volume ofa degree of freedom is non-zero. More...
|
|
Scalar | gridTotalVolume () const |
| Returns the volume of the whole grid which represents the spatial domain. More...
|
|
const SolutionVector & | solution (int timeIdx) const |
| Reference to the solution at a given history index as a block vector. More...
|
|
SolutionVector & | solution (int timeIdx) |
| Reference to the solution at a given history index as a block vector. More...
|
|
const Linearizer & | linearizer () const |
| Returns the operator linearizer for the global jacobian of the problem. More...
|
|
Linearizer & | linearizer () |
| Returns the object which linearizes the global system of equations at the current solution. More...
|
|
const LocalLinearizer & | localLinearizer (int openMpThreadId) const |
| Returns the local jacobian which calculates the local stiffness matrix for an arbitrary element. More...
|
|
LocalLinearizer & | localLinearizer (int openMpThreadId) |
|
const LocalResidual & | localResidual (int openMpThreadId) const |
| Returns the object to calculate the local residual function. More...
|
|
LocalResidual & | localResidual (int openMpThreadId) |
|
Scalar | primaryVarWeight (int globalDofIdx, int pvIdx) const |
| Returns the relative weight of a primary variable for calculating relative errors. More...
|
|
Scalar | eqWeight (int globalVertexIdx, int eqIdx) const |
| Returns the relative weight of an equation. More...
|
|
Scalar | relativeDofError (int vertexIdx, const PrimaryVariables &pv1, const PrimaryVariables &pv2) const |
| Returns the relative error between two vectors of primary variables. More...
|
|
bool | update (NewtonMethod &solver) |
| 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. This is primary a hook which the actual model can overload. More...
|
|
void | updateSuccessful () |
| Called by the update() method if it was successful. This is primary a hook which the actual model can overload. More...
|
|
void | updateFailed () |
| Called by the update() method if it was unsuccessful. This is primary a hook which the actual model can overload. 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 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 | numAuxiliaryDof () const |
| Returns the number of degrees of freedom (DOFs) of the auxiliary equations. More...
|
|
size_t | numTotalDof () const |
| Returns the total number of degrees of freedom (i.e., grid plux auxiliary DOFs) More...
|
|
const VertexMapper & | vertexMapper () const |
| Mapper for vertices to indices. More...
|
|
const ElementMapper & | elementMapper () const |
| Mapper for elements to indices. More...
|
|
void | resetLinearizer () |
| Resets the Jacobian matrix linearizer, so that the boundary types can be altered. More...
|
|
bool | onBoundary (int globalIdx) const |
| Return whether a degree of freedom is located on the domain boundary. More...
|
|
std::string | primaryVarName (int pvIdx) const |
| Given an primary variable index, return a human readable name. More...
|
|
std::string | eqName (int eqIdx) const |
| Given an equation index, return a human readable name. More...
|
|
void | updatePVWeights (const ElementContext &elemCtx) 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. More...
|
|
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. More...
|
|
void | appendOutputFields (BaseOutputWriter &writer) const |
| Append the quantities relevant for the current solution to an output writer. More...
|
|
const GridView & | gridView () const |
| Reference to the grid view of the spatial domain. More...
|
|
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. More...
|
|
std::shared_ptr
< BaseAuxiliaryModule< TypeTag > > | auxiliaryModule (int auxEqModIdx) |
| Returns a given module for auxiliary equations. More...
|
|
std::shared_ptr< const
BaseAuxiliaryModule< TypeTag > > | auxiliaryModule (int auxEqModIdx) const |
| Returns a given module for auxiliary equations. More...
|
|
template<class TypeTag>
class Ewoms::VcfvDiscretization< TypeTag >
The base class for the vertex centered finite volume discretization scheme.
template<class TypeTag >
template<class VtkMultiWriter >
template<class TypeTag >
template<class Restarter >
template<class TypeTag >
template<class DofEntity >
Returns a string of discretization's human-readable name.
template<class TypeTag >
|
inlinestaticprotectedinherited |
template<class TypeTag >
|
inlinestaticprotectedinherited |
Given an equation index, return a human readable name.
- Parameters
-
eqIdx | The index of the conservation equation of interest. |
Returns the relative weight of an equation.
- Parameters
-
globalVertexIdx | The global index of the vertex |
eqIdx | The index of the equation |
Apply the initial conditions to the model.
References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), Ewoms::FvBaseDiscretization< TypeTag >::dofTotalVolume_, Ewoms::FvBaseDiscretization< TypeTag >::gridTotalVolume_, Ewoms::FvBaseDiscretization< TypeTag >::gridView_, Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCacheUpToDate_, Ewoms::FvBaseDiscretization< TypeTag >::isLocalDof_, Ewoms::FvBaseDiscretization< TypeTag >::linearizer_, Ewoms::FvBaseDiscretization< TypeTag >::localLinearizer_, Ewoms::ThreadManager< TypeTag >::maxThreads(), Ewoms::FvBaseDiscretization< TypeTag >::simulator_, and Ewoms::FvBaseDiscretization< TypeTag >::storeIntensiveQuantities_().
Compute the global residual for the current solution vector.
- Parameters
-
References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), Ewoms::ThreadedEntityIterator< GridView, codim >::beginParallel(), Ewoms::FvBaseDiscretization< TypeTag >::gridView(), Ewoms::FvBaseDiscretization< TypeTag >::gridView_, Ewoms::ThreadedEntityIterator< GridView, codim >::increment(), Ewoms::ThreadedEntityIterator< GridView, codim >::isFinished(), Ewoms::FvBaseDiscretization< TypeTag >::simulator_, Ewoms::ThreadManager< TypeTag >::threadId(), and ScopedLock::unlock().
Compute the integral over the domain of the storage terms of all conservation quantities.
- Parameters
-
storage | Stores the total amount of each conserved quantity inside the domain. |
References Ewoms::ThreadedEntityIterator< GridView, codim >::beginParallel(), Ewoms::FvBaseDiscretization< TypeTag >::gridView(), Ewoms::FvBaseDiscretization< TypeTag >::gridView_, Ewoms::ThreadedEntityIterator< GridView, codim >::increment(), Ewoms::ThreadedEntityIterator< GridView, codim >::isFinished(), Ewoms::FvBaseDiscretization< TypeTag >::localResidual(), Ewoms::FvBaseDiscretization< TypeTag >::simulator_, Ewoms::ThreadManager< TypeTag >::threadId(), and ScopedLock::unlock().
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness().
Returns the local jacobian which calculates the local stiffness matrix for an arbitrary element.
The local stiffness matrices of the element are used by the jacobian linearizer to produce a global linerization of the problem.
References Ewoms::FvBaseDiscretization< TypeTag >::localLinearizer_.
Given an primary variable index, return a human readable name.
- Parameters
-
pvIdx | The index of the primary variable of interest. |
template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::relativeDofError |
( |
int |
vertexIdx, |
|
|
const PrimaryVariables & |
pv1, |
|
|
const PrimaryVariables & |
pv2 |
|
) |
| const |
|
inlineinherited |
Returns the relative error between two vectors of primary variables.
- Parameters
-
vertexIdx | The global index of the control volume's associated vertex |
pv1 | The first vector of primary variables |
pv2 | The second vector of primary variables |
References Ewoms::FvBaseDiscretization< TypeTag >::asImp_().
template<class TypeTag >
template<class Restarter >
template<class TypeTag >
template<class DofEntity >
template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::setIntensiveQuantitiesCacheEntryValidity |
( |
int |
globalIdx, |
|
|
int |
timeIdx, |
|
|
bool |
newValue |
|
) |
| const |
|
inlineinherited |
template<class TypeTag >
|
inlinestaticprotectedinherited |
template<class TypeTag >
template<class Context >
void Ewoms::FvBaseDiscretization< TypeTag >::supplementInitialSolution_ |
( |
PrimaryVariables & |
priVars, |
|
|
const Context & |
context, |
|
|
int |
dofIdx, |
|
|
int |
timeIdx |
|
) |
| |
|
inlineprotectedinherited |
Syncronize the values of the primary variables on the degrees of freedom that overlap with the neighboring processes.
By default, this method does nothing...
template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updateCachedIntensiveQuantities |
( |
const IntensiveQuantities & |
intQuants, |
|
|
int |
globalIdx, |
|
|
int |
timeIdx |
|
) |
| const |
|
inlineinherited |
Update the weights of all primary variables within an element given the complete set of intensive quantities.
Called by the update() method if it was successful. This is primary a hook which the actual model can overload.
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::applyInitialSolution(), Ewoms::VcfvDiscretization< TypeTag >::deserialize(), Ewoms::EcfvDiscretization< TypeTag >::deserialize(), Ewoms::FvBaseDiscretization< TypeTag >::finishInit(), Ewoms::FvBaseDiscretization< TypeTag >::globalResidual(), Ewoms::FvBaseDiscretization< TypeTag >::globalStorage(), Ewoms::FvBaseDiscretization< TypeTag >::gridView(), Ewoms::EcfvDiscretization< TypeTag >::numGridDof(), Ewoms::VcfvDiscretization< TypeTag >::numGridDof(), Ewoms::VcfvDiscretization< TypeTag >::serialize(), Ewoms::EcfvDiscretization< TypeTag >::serialize(), Ewoms::FvBaseDiscretization< TypeTag >::updateBoundary_(), and Ewoms::FvBaseDiscretization< TypeTag >::verbose_().
template<class TypeTag >
|
mutableprotectedinherited |
template<class TypeTag >
|
mutableprotectedinherited |
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::applyInitialSolution(), Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness(), Ewoms::EcfvDiscretization< TypeTag >::dofMapper(), Ewoms::VcfvDiscretization< TypeTag >::dofMapper(), Ewoms::FvBaseDiscretization< TypeTag >::elementMapper(), Ewoms::FvBaseDiscretization< TypeTag >::finishInit(), Ewoms::FvBaseDiscretization< TypeTag >::globalResidual(), Ewoms::FvBaseDiscretization< TypeTag >::globalStorage(), Ewoms::FvBaseDiscretization< TypeTag >::prepareOutputFields(), Ewoms::FvBaseDiscretization< TypeTag >::registerOutputModules_(), Ewoms::FvBaseDiscretization< TypeTag >::resetLinearizer(), Ewoms::FvBaseDiscretization< TypeTag >::update(), and Ewoms::FvBaseDiscretization< TypeTag >::vertexMapper().
template<class TypeTag >
|
mutableprotectedinherited |
Referenced by Ewoms::FvBaseDiscretization< TypeTag >::addAuxiliaryModule(), Ewoms::FvBaseDiscretization< TypeTag >::advanceTimeLevel(), Ewoms::FvBaseDiscretization< TypeTag >::applyInitialSolution(), Ewoms::VcfvDiscretization< TypeTag >::deserialize(), Ewoms::EcfvDiscretization< TypeTag >::deserialize(), Ewoms::FvBaseDiscretization< TypeTag >::deserializeEntity(), Ewoms::FvBaseDiscretization< TypeTag >::FvBaseDiscretization(), Ewoms::FvBaseDiscretization< TypeTag >::globalResidual(), Ewoms::FvBaseDiscretization< TypeTag >::serializeEntity(), Ewoms::FvBaseDiscretization< TypeTag >::solution(), Ewoms::EcfvDiscretization< TypeTag >::syncOverlap(), and Ewoms::FvBaseDiscretization< TypeTag >::updateFailed().
The documentation for this class was generated from the following file:
|