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

#include <vcfvdiscretization.hh>

Inheritance diagram for Ewoms::VcfvDiscretization< TypeTag >:
Inheritance graph

Public Member Functions

 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...
 
NewtonMethodnewtonMethod ()
 Returns the newton method object. More...
 
const NewtonMethodnewtonMethod () 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 $\mathrm{[m^3]}$ 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 $\mathrm{[m^3]}$ 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...
 

Static Public Member Functions

static std::string discretizationName ()
 Returns a string of discretization's human-readable name. More...
 
static void registerParameters ()
 Register all run-time parameters for the model. More...
 

Protected Member Functions

template<class Context >
void supplementInitialSolution_ (PrimaryVariables &priVars, const Context &context, int dofIdx, int timeIdx)
 
void registerOutputModules_ ()
 Register all output modules which make sense for the model. More...
 
LocalResidual & localResidual_ ()
 Reference to the local residal object. More...
 
void updateBoundary_ ()
 Find the degrees of freedoms adjacent to the grid boundary. More...
 
bool verbose_ () const
 Returns whether messages should be printed. More...
 

Static Protected Member Functions

static bool storeIntensiveQuantities_ ()
 
static bool enableIntensiveQuantitiesCache_ ()
 
static bool enableThermodynamicHints_ ()
 

Protected Attributes

Simulatorsimulator_
 
GridView gridView_
 
std::vector< std::shared_ptr
< BaseAuxiliaryModule< TypeTag > > > 
auxEqModules_
 
NewtonMethod newtonMethod_
 
std::vector< LocalLinearizer > localLinearizer_
 
Linearizer * linearizer_
 
SolutionVector solution_ [historySize]
 
IntensiveQuantitiesVector intensiveQuantityCache_ [historySize]
 
std::vector< bool > intensiveQuantityCacheUpToDate_ [historySize]
 
std::vector< bool > onBoundary_
 
std::list< BaseOutputModule
< TypeTag > * > 
outputModules_
 
Scalar gridTotalVolume_
 
std::vector< Scalar > dofTotalVolume_
 
std::vector< bool > isLocalDof_
 

Detailed Description

template<class TypeTag>
class Ewoms::VcfvDiscretization< TypeTag >

The base class for the vertex centered finite volume discretization scheme.

Constructor & Destructor Documentation

template<class TypeTag >
Ewoms::VcfvDiscretization< TypeTag >::VcfvDiscretization ( Simulator simulator)
inline

Member Function Documentation

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::addAuxiliaryModule ( std::shared_ptr< BaseAuxiliaryModule< TypeTag > >  auxMod)
inlineinherited

Add a module for an auxiliary equation.

This module can add additional degrees of freedom and additional off-diagonal elements, but the number of equations per DOF needs to be the same as for the "main" model.

For example, auxiliary modules can be used to specify non-neighboring connections, well equations or model couplings via mortar DOFs. Auxiliary equations are completely optional, though.

References Ewoms::FvBaseDiscretization< TypeTag >::auxEqModules_, Ewoms::FvBaseDiscretization< TypeTag >::numTotalDof(), and Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
template<class VtkMultiWriter >
void Ewoms::FvBaseDiscretization< TypeTag >::addConvergenceVtkFields ( VtkMultiWriter writer,
const SolutionVector &  u,
const GlobalEqVector &  deltaU 
) const
inlineinherited

Add the vector fields for analysing the convergence of the newton method to the a VTK writer.

Parameters
writerThe writer object to which the fields should be added.
uThe solution function
deltaUThe delta of the solution function before and after the Newton update

References Ewoms::VtkMultiWriter< GridView, vtkFormat >::allocateManagedScalarBuffer(), Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), Ewoms::FvBaseDiscretization< TypeTag >::linearizer(), and Ewoms::FvBaseDiscretization< TypeTag >::numGridDof().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::addOutputModule ( BaseOutputModule< TypeTag > *  newModule)
inlineinherited

Add an module for writing visualization output after a timestep.

References Ewoms::FvBaseDiscretization< TypeTag >::outputModules_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::advanceTimeLevel ( )
inlineinherited

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.

This should prepare the model for the next time integration.

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), and Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::appendOutputFields ( BaseOutputWriter writer) const
inlineinherited

Append the quantities relevant for the current solution to an output writer.

References Ewoms::FvBaseDiscretization< TypeTag >::outputModules_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::applyInitialSolution ( )
inlineinherited
template<class TypeTag >
std::shared_ptr<BaseAuxiliaryModule<TypeTag> > Ewoms::FvBaseDiscretization< TypeTag >::auxiliaryModule ( int  auxEqModIdx)
inlineinherited

Returns a given module for auxiliary equations.

References Ewoms::FvBaseDiscretization< TypeTag >::auxEqModules_.

template<class TypeTag >
std::shared_ptr<const BaseAuxiliaryModule<TypeTag> > Ewoms::FvBaseDiscretization< TypeTag >::auxiliaryModule ( int  auxEqModIdx) const
inlineinherited

Returns a given module for auxiliary equations.

References Ewoms::FvBaseDiscretization< TypeTag >::auxEqModules_.

template<class TypeTag >
const IntensiveQuantities* Ewoms::FvBaseDiscretization< TypeTag >::cachedIntensiveQuantities ( int  globalIdx,
int  timeIdx 
) const
inlineinherited

Return the cached intensive quantities for a entity on the grid at given time.

Attention
If no up-to date intensive quantities are available, this method will return 0.
Parameters
globalIdxThe global space index for the entity where a hint is requested.
timeIdxThe index used by the time discretization.

References Ewoms::FvBaseDiscretization< TypeTag >::enableIntensiveQuantitiesCache_(), Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCache_, and Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCacheUpToDate_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::checkConservativeness ( Scalar  tolerance = -1,
bool  verbose = false 
) const
inlineinherited

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.

This method is purely intented for debugging purposes. If the program is compiled with optimizations enabled, it becomes a no-op.

References Ewoms::FvBaseDiscretization< TypeTag >::globalStorage(), Ewoms::Simulator< TypeTag >::gridView(), Ewoms::Simulator< TypeTag >::model(), Ewoms::Simulator< TypeTag >::problem(), Ewoms::FvBaseDiscretization< TypeTag >::simulator_, and Ewoms::Simulator< TypeTag >::timeStepSize().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::clearAuxiliaryModules ( )
inlineinherited

Causes the list of auxiliary equations to be cleared.

Note that this method implies recreateMatrix()

References Ewoms::FvBaseDiscretization< TypeTag >::auxEqModules_.

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

Deserializes the state of the model.

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

References Ewoms::FvBaseDiscretization< TypeTag >::gridView_, and Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
template<class DofEntity >
void Ewoms::FvBaseDiscretization< TypeTag >::deserializeEntity ( std::istream &  instream,
const DofEntity &  dof 
)
inlineinherited

Reads the current solution variables for a degree of freedom from a restart file.

Parameters
instreamThe stream from which the vertex data should be deserialized from
dofThe Dune entity which's data should be deserialized

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), and Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
static std::string Ewoms::VcfvDiscretization< TypeTag >::discretizationName ( )
inlinestatic

Returns a string of discretization's human-readable name.

template<class TypeTag >
const DofMapper& Ewoms::VcfvDiscretization< TypeTag >::dofMapper ( ) const
inline

Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices.

References Ewoms::Simulator< TypeTag >::problem(), and Ewoms::FvBaseDiscretization< TypeTag >::simulator_.

template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::dofTotalVolume ( int  globalIdx) const
inlineinherited

Returns the volume $\mathrm{[m^3]}$ of a given control volume.

Parameters
globalIdxThe global index of the degree of freedom

References Ewoms::FvBaseDiscretization< TypeTag >::dofTotalVolume_.

template<class TypeTag >
const ElementMapper& Ewoms::FvBaseDiscretization< TypeTag >::elementMapper ( ) const
inlineinherited
template<class TypeTag >
static bool Ewoms::FvBaseDiscretization< TypeTag >::enableIntensiveQuantitiesCache_ ( )
inlinestaticprotectedinherited
template<class TypeTag >
static bool Ewoms::FvBaseDiscretization< TypeTag >::enableThermodynamicHints_ ( )
inlinestaticprotectedinherited
template<class TypeTag >
std::string Ewoms::FvBaseDiscretization< TypeTag >::eqName ( int  eqIdx) const
inlineinherited

Given an equation index, return a human readable name.

Parameters
eqIdxThe index of the conservation equation of interest.
template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::eqWeight ( int  globalVertexIdx,
int  eqIdx 
) const
inlineinherited

Returns the relative weight of an equation.

Parameters
globalVertexIdxThe global index of the vertex
eqIdxThe index of the equation
template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::globalResidual ( GlobalEqVector &  dest,
const SolutionVector &  u 
) const
inlineinherited

Compute the global residual for an arbitrary solution vector.

Parameters
destStores the result
uThe solution for which the residual ought to be calculated

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), Ewoms::FvBaseDiscretization< TypeTag >::solution(), and Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::gridTotalVolume ( ) const
inlineinherited

Returns the volume $\mathrm{[m^3]}$ of the whole grid which represents the spatial domain.

References Ewoms::FvBaseDiscretization< TypeTag >::gridTotalVolume_.

template<class TypeTag >
bool Ewoms::FvBaseDiscretization< TypeTag >::isLocalDof ( int  globalIdx) const
inlineinherited

Returns if the overlap of the volume ofa degree of freedom is non-zero.

Parameters
globalIdxThe global index of the degree of freedom

References Ewoms::FvBaseDiscretization< TypeTag >::isLocalDof_.

template<class TypeTag >
const Linearizer& Ewoms::FvBaseDiscretization< TypeTag >::linearizer ( ) const
inlineinherited

Returns the operator linearizer for the global jacobian of the problem.

References Ewoms::FvBaseDiscretization< TypeTag >::linearizer_.

Referenced by Ewoms::FvBaseDiscretization< TypeTag >::addConvergenceVtkFields().

template<class TypeTag >
Linearizer& Ewoms::FvBaseDiscretization< TypeTag >::linearizer ( )
inlineinherited

Returns the object which linearizes the global system of equations at the current solution.

References Ewoms::FvBaseDiscretization< TypeTag >::linearizer_.

template<class TypeTag >
const LocalLinearizer& Ewoms::FvBaseDiscretization< TypeTag >::localLinearizer ( int  openMpThreadId) const
inlineinherited

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_.

template<class TypeTag >
LocalLinearizer& Ewoms::FvBaseDiscretization< TypeTag >::localLinearizer ( int  openMpThreadId)
inlineinherited
template<class TypeTag >
const LocalResidual& Ewoms::FvBaseDiscretization< TypeTag >::localResidual ( int  openMpThreadId) const
inlineinherited

Returns the object to calculate the local residual function.

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_().

Referenced by Ewoms::FvBaseDiscretization< TypeTag >::globalStorage().

template<class TypeTag >
LocalResidual& Ewoms::FvBaseDiscretization< TypeTag >::localResidual ( int  openMpThreadId)
inlineinherited
template<class TypeTag >
LocalResidual& Ewoms::FvBaseDiscretization< TypeTag >::localResidual_ ( )
inlineprotectedinherited

Reference to the local residal object.

References Ewoms::FvBaseDiscretization< TypeTag >::localLinearizer_.

template<class TypeTag >
NewtonMethod& Ewoms::FvBaseDiscretization< TypeTag >::newtonMethod ( )
inlineinherited

Returns the newton method object.

References Ewoms::FvBaseDiscretization< TypeTag >::newtonMethod_.

template<class TypeTag >
const NewtonMethod& Ewoms::FvBaseDiscretization< TypeTag >::newtonMethod ( ) const
inlineinherited

Returns the newton method object.

References Ewoms::FvBaseDiscretization< TypeTag >::newtonMethod_.

template<class TypeTag >
size_t Ewoms::FvBaseDiscretization< TypeTag >::numAuxiliaryDof ( ) const
inlineinherited

Returns the number of degrees of freedom (DOFs) of the auxiliary equations.

References Ewoms::FvBaseDiscretization< TypeTag >::auxEqModules_.

Referenced by Ewoms::FvBaseDiscretization< TypeTag >::numTotalDof().

template<class TypeTag >
size_t Ewoms::FvBaseDiscretization< TypeTag >::numAuxiliaryModules ( ) const
inlineinherited

Returns the number of modules for auxiliary equations.

References Ewoms::FvBaseDiscretization< TypeTag >::auxEqModules_.

template<class TypeTag >
size_t Ewoms::VcfvDiscretization< TypeTag >::numGridDof ( ) const
inline

Returns the number of global degrees of freedom (DOFs) due to the grid.

References Ewoms::FvBaseDiscretization< TypeTag >::gridView_.

template<class TypeTag >
size_t Ewoms::FvBaseDiscretization< TypeTag >::numTotalDof ( ) const
inlineinherited

Returns the total number of degrees of freedom (i.e., grid plux auxiliary DOFs)

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), and Ewoms::FvBaseDiscretization< TypeTag >::numAuxiliaryDof().

Referenced by Ewoms::FvBaseDiscretization< TypeTag >::addAuxiliaryModule().

template<class TypeTag >
bool Ewoms::FvBaseDiscretization< TypeTag >::onBoundary ( int  globalIdx) const
inlineinherited

Return whether a degree of freedom is located on the domain boundary.

Parameters
globalIdxThe global space index of the degree of freedom of interest.

References Ewoms::FvBaseDiscretization< TypeTag >::onBoundary_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::prepareOutputFields ( ) const
inlineinherited

Prepare the quantities relevant for the current solution to be appended to the output writers.

References Ewoms::FvBaseDiscretization< TypeTag >::gridView(), Ewoms::FvBaseDiscretization< TypeTag >::outputModules_, and Ewoms::FvBaseDiscretization< TypeTag >::simulator_.

template<class TypeTag >
std::string Ewoms::FvBaseDiscretization< TypeTag >::primaryVarName ( int  pvIdx) const
inlineinherited

Given an primary variable index, return a human readable name.

Parameters
pvIdxThe index of the primary variable of interest.
template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::primaryVarWeight ( int  globalDofIdx,
int  pvIdx 
) const
inlineinherited

Returns the relative weight of a primary variable for calculating relative errors.

Parameters
globalDofIdxThe global index of the degree of freedom
pvIdxThe index of the primary variable

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), and Ewoms::FvBaseDiscretization< TypeTag >::solution().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::registerOutputModules_ ( )
inlineprotectedinherited

Register all output modules which make sense for the model.

This method is supposed to be overloaded by the actual models, or else only the primary variables can be written to the result files.

References Ewoms::FvBaseDiscretization< TypeTag >::outputModules_, and Ewoms::FvBaseDiscretization< TypeTag >::simulator_.

template<class TypeTag >
static void Ewoms::FvBaseDiscretization< TypeTag >::registerParameters ( )
inlinestaticinherited
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
vertexIdxThe global index of the control volume's associated vertex
pv1The first vector of primary variables
pv2The second vector of primary variables

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::resetLinearizer ( )
inlineinherited

Resets the Jacobian matrix linearizer, so that the boundary types can be altered.

References Ewoms::FvBaseDiscretization< TypeTag >::linearizer_, and Ewoms::FvBaseDiscretization< TypeTag >::simulator_.

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

Serializes the current state of the model.

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

References Ewoms::FvBaseDiscretization< TypeTag >::gridView_.

template<class TypeTag >
template<class DofEntity >
void Ewoms::FvBaseDiscretization< TypeTag >::serializeEntity ( std::ostream &  outstream,
const DofEntity &  dof 
)
inlineinherited

Write the current solution for a degree of freedom to a restart file.

Parameters
outstreamThe stream into which the vertex data should be serialized to
dofThe Dune entity which's data should be serialized

References Ewoms::FvBaseDiscretization< TypeTag >::asImp_(), and Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::setIntensiveQuantitiesCacheEntryValidity ( int  globalIdx,
int  timeIdx,
bool  newValue 
) const
inlineinherited

Invalidate the cache for a given intensive quantities object.

Parameters
globalIdxThe global space index for the entity where a hint is to be set.
timeIdxThe index used by the time discretization.

References Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCacheUpToDate_, and Ewoms::FvBaseDiscretization< TypeTag >::storeIntensiveQuantities_().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::shiftIntensiveQuantityCache ( int  numSlots = 1)
inlineinherited

Move the intensive quantities for a given time index to the back.

This method should only be called by the time discretization.

Parameters
numSlotsThe number of time step slots for which the hints should be shifted.

References Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCache_, Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCacheUpToDate_, and Ewoms::FvBaseDiscretization< TypeTag >::storeIntensiveQuantities_().

template<class TypeTag >
const SolutionVector& Ewoms::FvBaseDiscretization< TypeTag >::solution ( int  timeIdx) const
inlineinherited

Reference to the solution at a given history index as a block vector.

Parameters
timeIdxThe index of the solution used by the time discretization.

References Ewoms::FvBaseDiscretization< TypeTag >::solution_.

Referenced by Ewoms::FvBaseDiscretization< TypeTag >::globalResidual(), and Ewoms::FvBaseDiscretization< TypeTag >::primaryVarWeight().

template<class TypeTag >
SolutionVector& Ewoms::FvBaseDiscretization< TypeTag >::solution ( int  timeIdx)
inlineinherited

Reference to the solution at a given history index as a block vector.

Parameters
timeIdxThe index of the solution used by the time discretization.

References Ewoms::FvBaseDiscretization< TypeTag >::solution_.

template<class TypeTag >
template<class Context >
void Ewoms::FvBaseDiscretization< TypeTag >::supplementInitialSolution_ ( PrimaryVariables &  priVars,
const Context &  context,
int  dofIdx,
int  timeIdx 
)
inlineprotectedinherited
template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::syncOverlap ( )
inlineinherited

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 >
const IntensiveQuantities* Ewoms::FvBaseDiscretization< TypeTag >::thermodynamicHint ( int  globalIdx,
int  timeIdx 
) const
inlineinherited

Return the thermodynamic hint for a entity on the grid at given time.

The hint is defined as a IntensiveQuantities object which is supposed to be "close" to the IntensiveQuantities of the current solution. It can be used as a good starting point for non-linear solvers when having to solve non-linear relations while updating the intensive quantities. (This may yield a major performance boost depending on how the physical models require.)

Attention
If no up-to date intensive quantities are available, or if hints have been disabled, this method will return 0.
Parameters
globalIdxThe global space index for the entity where a hint is requested.
timeIdxThe index used by the time discretization.

References Ewoms::FvBaseDiscretization< TypeTag >::enableThermodynamicHints_(), Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCache_, and Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCacheUpToDate_.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updateBegin ( )
inlineinherited

Called by the update() method before it tries to apply the newton method. This is primary a hook which the actual model can overload.

References Ewoms::FvBaseDiscretization< TypeTag >::updateBoundary_().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updateBoundary_ ( )
inlineprotectedinherited
template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updateCachedIntensiveQuantities ( const IntensiveQuantities &  intQuants,
int  globalIdx,
int  timeIdx 
) const
inlineinherited

Update the intensive quantity cache for a entity on the grid at given time.

Parameters
intQuantsThe IntensiveQuantities object hint for a given degree of freedom.
globalIdxThe global space index for the entity where a hint is to be set.
timeIdxThe index used by the time discretization.

References Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCache_, Ewoms::FvBaseDiscretization< TypeTag >::intensiveQuantityCacheUpToDate_, and Ewoms::FvBaseDiscretization< TypeTag >::storeIntensiveQuantities_().

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updateFailed ( )
inlineinherited
template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updatePVWeights ( const ElementContext &  elemCtx) const
inlineinherited

Update the weights of all primary variables within an element given the complete set of intensive quantities.

template<class TypeTag >
void Ewoms::FvBaseDiscretization< TypeTag >::updateSuccessful ( )
inlineinherited

Called by the update() method if it was successful. This is primary a hook which the actual model can overload.

template<class TypeTag >
bool Ewoms::FvBaseDiscretization< TypeTag >::verbose_ ( ) const
inlineprotectedinherited

Returns whether messages should be printed.

References Ewoms::FvBaseDiscretization< TypeTag >::gridView_.

template<class TypeTag >
const VertexMapper& Ewoms::FvBaseDiscretization< TypeTag >::vertexMapper ( ) const
inlineinherited

Member Data Documentation

template<class TypeTag >
std::vector<Scalar> Ewoms::FvBaseDiscretization< TypeTag >::dofTotalVolume_
protectedinherited
template<class TypeTag >
Scalar Ewoms::FvBaseDiscretization< TypeTag >::gridTotalVolume_
protectedinherited
template<class TypeTag >
std::vector<bool> Ewoms::FvBaseDiscretization< TypeTag >::isLocalDof_
protectedinherited
template<class TypeTag >
std::vector<LocalLinearizer> Ewoms::FvBaseDiscretization< TypeTag >::localLinearizer_
protectedinherited
template<class TypeTag >
NewtonMethod Ewoms::FvBaseDiscretization< TypeTag >::newtonMethod_
protectedinherited
template<class TypeTag >
std::vector<bool> Ewoms::FvBaseDiscretization< TypeTag >::onBoundary_
protectedinherited

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