This class stores an array of IntensiveQuantities objects, one intensive quantities object for each of the element's vertices. More...

#include <fvbaseelementcontext.hh>

Public Member Functions

 FvBaseElementContext (const Simulator &simulator)
 The constructor. More...
 
void updateAll (const Element &elem)
 Construct all volume and extensive quantities of an element from scratch. More...
 
void updateStencil (const Element &elem)
 Compute the finite volume geometry for an element. More...
 
void updateStencilTopology (const Element &elem)
 Update the topological part of the stencil, but nothing else. More...
 
void updateAllIntensiveQuantities ()
 Compute the intensive quantities of all sub-control volumes of the current element for all time indices. More...
 
void updateIntensiveQuantities (int timeIdx)
 Compute the intensive quantities of all sub-control volumes of the current element for a single time index. More...
 
void updatePrimaryIntensiveQuantities (int timeIdx)
 Compute the intensive quantities of all sub-control volumes of the current element for a single time index. More...
 
void updateIntensiveQuantities (const PrimaryVariables &priVars, int dofIdx, int timeIdx)
 Compute the intensive quantities of a single sub-control volume of the current element for a single time index. More...
 
void updateAllExtensiveQuantities ()
 Compute the extensive quantities of all sub-control volume faces of the current element for all time indices. More...
 
void updateExtensiveQuantities (int timeIdx)
 Compute the extensive quantities of all sub-control volume faces of the current element for a single time index. More...
 
const Simulatorsimulator () const
 Return a reference to the simulator. More...
 
const Problem & problem () const
 Return a reference to the problem. More...
 
const Model & model () const
 Return a reference to the model. More...
 
const GridView & gridView () const
 Return a reference to the grid view. More...
 
const Element & element () const
 Return the current element. More...
 
int numDof (int timeIdx) const
 Return the number of sub-control volumes of the current element. More...
 
int numPrimaryDof (int timeIdx) const
 Return the number of primary degrees of freedom of the current element. More...
 
int numInteriorFaces (int timeIdx) const
 Return the number of non-boundary faces which need to be considered for the flux apporixmation. More...
 
int numBoundaryFaces (int timeIdx) const
 Return the number of boundary faces which need to be considered for the flux apporixmation. More...
 
const Stencil & stencil (int timeIdx) const
 Return the current finite element geometry. More...
 
const GlobalPosition & pos (int dofIdx, int timeIdx) const
 Return the position of a local entities in global coordinates. More...
 
int globalSpaceIndex (int dofIdx, int timeIdx) const
 Return the global spatial index for a sub-control volume. More...
 
Scalar dofVolume (int dofIdx, int timeIdx) const
 Return the element-local volume associated with a degree of freedom. More...
 
Scalar dofTotalVolume (int dofIdx, int timeIdx) const
 Return the total volume associated with a degree of freedom. More...
 
bool onBoundary () const
 Returns whether the current element is on the domain's boundary. More...
 
const IntensiveQuantities & intensiveQuantities (int dofIdx, int timeIdx) const
 Return a reference to the intensive quantities of a sub-control volume at a given time. More...
 
const IntensiveQuantities * thermodynamicHint (int dofIdx, int timeIdx) const
 Return the thermodynamic hint for a given local index. More...
 
IntensiveQuantities & intensiveQuantities (int dofIdx, int timeIdx)
 Return a reference to the intensive quantities of a sub-control volume at a given time. More...
 
PrimaryVariables & primaryVars (int dofIdx, int timeIdx)
 Return the primary variables for a given local index. More...
 
const PrimaryVariables & primaryVars (int dofIdx, int timeIdx) const
 Return the primary variables for a given local index. More...
 
void saveIntensiveQuantities (int dofIdx)
 Stash the intensive quantities for a degree of freedom on internal memory. More...
 
void restoreIntensiveQuantities (int dofIdx)
 Restores the intensive quantities for a degree of freedom from internal memory. More...
 
const GradientCalculator & gradientCalculator () const
 Return a reference to the gradient calculation class of the chosen spatial discretization. More...
 
const ExtensiveQuantities & extensiveQuantities (int fluxIdx, int timeIdx) const
 Return a reference to the extensive quantities of a sub-control volume face. More...
 

Protected Member Functions

void updateIntensiveQuantities_ (int timeIdx, int numDof)
 Update the first 'n' intensive quantities objects from the primary variables. More...
 
void updateSingleIntQuants_ (const PrimaryVariables &priVars, int dofIdx, int timeIdx)
 

Protected Attributes

DofVarsVector dofVars_
 
IntensiveQuantities intensiveQuantitiesSaved_
 
PrimaryVariables priVarsSaved_
 
GradientCalculator gradientCalculator_
 
ExtensiveQuantitiesVector extensiveQuantities_
 
const SimulatorsimulatorPtr_
 
const Element * elemPtr_
 
const GridView gridView_
 
Stencil stencil_
 

Detailed Description

template<class TypeTag>
class Ewoms::FvBaseElementContext< TypeTag >

This class stores an array of IntensiveQuantities objects, one intensive quantities object for each of the element's vertices.

Constructor & Destructor Documentation

template<class TypeTag >
Ewoms::FvBaseElementContext< TypeTag >::FvBaseElementContext ( const Simulator simulator)
inlineexplicit

Member Function Documentation

template<class TypeTag >
Scalar Ewoms::FvBaseElementContext< TypeTag >::dofTotalVolume ( int  dofIdx,
int  timeIdx 
) const
inline

Return the total volume associated with a degree of freedom.

"Total" means the volume controlled by a degree of freedom disregarding the element. (For example in the vertex-centered finite volume method, a control volume typically encompasses parts of multiple elements.)

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::globalSpaceIndex(), and Ewoms::FvBaseElementContext< TypeTag >::model().

template<class TypeTag >
Scalar Ewoms::FvBaseElementContext< TypeTag >::dofVolume ( int  dofIdx,
int  timeIdx 
) const
inline

Return the element-local volume associated with a degree of freedom.

In the case of the vertex-centered finite volume method, this is different from the total volume because a finite volume usually spans multiple elements...

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::stencil().

template<class TypeTag >
const Element& Ewoms::FvBaseElementContext< TypeTag >::element ( ) const
inline
template<class TypeTag >
const ExtensiveQuantities& Ewoms::FvBaseElementContext< TypeTag >::extensiveQuantities ( int  fluxIdx,
int  timeIdx 
) const
inline

Return a reference to the extensive quantities of a sub-control volume face.

Parameters
fluxIdxThe local index of the sub-control volume face for which the extensive quantities are requested
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::extensiveQuantities_.

template<class TypeTag >
int Ewoms::FvBaseElementContext< TypeTag >::globalSpaceIndex ( int  dofIdx,
int  timeIdx 
) const
inline

Return the global spatial index for a sub-control volume.

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::stencil().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::dofTotalVolume(), and Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities_().

template<class TypeTag >
const GradientCalculator& Ewoms::FvBaseElementContext< TypeTag >::gradientCalculator ( ) const
inline

Return a reference to the gradient calculation class of the chosen spatial discretization.

References Ewoms::FvBaseElementContext< TypeTag >::gradientCalculator_.

template<class TypeTag >
const GridView& Ewoms::FvBaseElementContext< TypeTag >::gridView ( ) const
inline

Return a reference to the grid view.

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

template<class TypeTag >
const IntensiveQuantities& Ewoms::FvBaseElementContext< TypeTag >::intensiveQuantities ( int  dofIdx,
int  timeIdx 
) const
inline

Return a reference to the intensive quantities of a sub-control volume at a given time.

If the time step index is not given, return the volume variables for the current time.

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, and Ewoms::FvBaseElementContext< TypeTag >::numDof().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities_().

template<class TypeTag >
IntensiveQuantities& Ewoms::FvBaseElementContext< TypeTag >::intensiveQuantities ( int  dofIdx,
int  timeIdx 
)
inline

Return a reference to the intensive quantities of a sub-control volume at a given time.

If the time step index is not given, return the volume variables for the current time.

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, and Ewoms::FvBaseElementContext< TypeTag >::numDof().

template<class TypeTag >
int Ewoms::FvBaseElementContext< TypeTag >::numBoundaryFaces ( int  timeIdx) const
inline

Return the number of boundary faces which need to be considered for the flux apporixmation.

References Ewoms::FvBaseElementContext< TypeTag >::stencil().

template<class TypeTag >
int Ewoms::FvBaseElementContext< TypeTag >::numInteriorFaces ( int  timeIdx) const
inline

Return the number of non-boundary faces which need to be considered for the flux apporixmation.

References Ewoms::FvBaseElementContext< TypeTag >::stencil().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateExtensiveQuantities().

template<class TypeTag >
int Ewoms::FvBaseElementContext< TypeTag >::numPrimaryDof ( int  timeIdx) const
inline

Return the number of primary degrees of freedom of the current element.

References Ewoms::FvBaseElementContext< TypeTag >::stencil().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updatePrimaryIntensiveQuantities().

template<class TypeTag >
bool Ewoms::FvBaseElementContext< TypeTag >::onBoundary ( ) const
inline

Returns whether the current element is on the domain's boundary.

References Ewoms::FvBaseElementContext< TypeTag >::element().

template<class TypeTag >
const GlobalPosition& Ewoms::FvBaseElementContext< TypeTag >::pos ( int  dofIdx,
int  timeIdx 
) const
inline

Return the position of a local entities in global coordinates.

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::stencil_.

template<class TypeTag >
PrimaryVariables& Ewoms::FvBaseElementContext< TypeTag >::primaryVars ( int  dofIdx,
int  timeIdx 
)
inline

Return the primary variables for a given local index.

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, and Ewoms::FvBaseElementContext< TypeTag >::numDof().

template<class TypeTag >
const PrimaryVariables& Ewoms::FvBaseElementContext< TypeTag >::primaryVars ( int  dofIdx,
int  timeIdx 
) const
inline

Return the primary variables for a given local index.

Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, and Ewoms::FvBaseElementContext< TypeTag >::numDof().

template<class TypeTag >
const Problem& Ewoms::FvBaseElementContext< TypeTag >::problem ( ) const
inline
template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::restoreIntensiveQuantities ( int  dofIdx)
inline

Restores the intensive quantities for a degree of freedom from internal memory.

Parameters
dofIdxThe local index of the degree of freedom in the current element.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, Ewoms::FvBaseElementContext< TypeTag >::intensiveQuantitiesSaved_, and Ewoms::FvBaseElementContext< TypeTag >::priVarsSaved_.

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::saveIntensiveQuantities ( int  dofIdx)
inline

Stash the intensive quantities for a degree of freedom on internal memory.

Parameters
dofIdxThe local index of the degree of freedom in the current element.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, Ewoms::FvBaseElementContext< TypeTag >::intensiveQuantitiesSaved_, Ewoms::FvBaseElementContext< TypeTag >::numDof(), and Ewoms::FvBaseElementContext< TypeTag >::priVarsSaved_.

template<class TypeTag >
const Simulator& Ewoms::FvBaseElementContext< TypeTag >::simulator ( ) const
inline
template<class TypeTag >
const IntensiveQuantities* Ewoms::FvBaseElementContext< TypeTag >::thermodynamicHint ( int  dofIdx,
int  timeIdx 
) const
inline

Return the thermodynamic hint for a given local index.

See also
Discretization::thermodynamicHint(int, int)
Parameters
dofIdxThe local index of the degree of freedom in the current element.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, and Ewoms::FvBaseElementContext< TypeTag >::numDof().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateAll ( const Element &  elem)
inline

Construct all volume and extensive quantities of an element from scratch.

Parameters
elemThe DUNE Codim<0> entity for which the volume variables ought to be calculated

References Ewoms::FvBaseElementContext< TypeTag >::updateAllExtensiveQuantities(), Ewoms::FvBaseElementContext< TypeTag >::updateAllIntensiveQuantities(), and Ewoms::FvBaseElementContext< TypeTag >::updateStencil().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateAllExtensiveQuantities ( )
inline

Compute the extensive quantities of all sub-control volume faces of the current element for all time indices.

References Ewoms::FvBaseElementContext< TypeTag >::updateExtensiveQuantities().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateAll().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateAllIntensiveQuantities ( )
inline

Compute the intensive quantities of all sub-control volumes of the current element for all time indices.

References Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateAll().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateExtensiveQuantities ( int  timeIdx)
inline

Compute the extensive quantities of all sub-control volume faces of the current element for a single time index.

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

References Ewoms::FvBaseElementContext< TypeTag >::extensiveQuantities_, Ewoms::FvBaseElementContext< TypeTag >::gradientCalculator_, and Ewoms::FvBaseElementContext< TypeTag >::numInteriorFaces().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateAllExtensiveQuantities().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities ( int  timeIdx)
inline

Compute the intensive quantities of all sub-control volumes of the current element for a single time index.

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

References Ewoms::FvBaseElementContext< TypeTag >::numDof(), and Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities_().

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateAllIntensiveQuantities().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities ( const PrimaryVariables &  priVars,
int  dofIdx,
int  timeIdx 
)
inline

Compute the intensive quantities of a single sub-control volume of the current element for a single time index.

Parameters
priVarsThe PrimaryVariables which should be used to calculate the intensive quantities.
dofIdxThe local index in the current element of the sub-control volume which should be updated.
timeIdxThe index of the solution vector used by the time discretization.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, Ewoms::FvBaseElementContext< TypeTag >::numDof(), and Ewoms::FvBaseElementContext< TypeTag >::updateSingleIntQuants_().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updatePrimaryIntensiveQuantities ( int  timeIdx)
inline

Compute the intensive quantities of all sub-control volumes of the current element for a single time index.

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

References Ewoms::FvBaseElementContext< TypeTag >::numPrimaryDof(), and Ewoms::FvBaseElementContext< TypeTag >::updateIntensiveQuantities_().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateSingleIntQuants_ ( const PrimaryVariables &  priVars,
int  dofIdx,
int  timeIdx 
)
inlineprotected
template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateStencil ( const Element &  elem)
inline

Compute the finite volume geometry for an element.

Parameters
elemThe grid element for which the finite volume geometry ought to be computed.

References Ewoms::FvBaseElementContext< TypeTag >::dofVars_, Ewoms::FvBaseElementContext< TypeTag >::elemPtr_, Ewoms::FvBaseElementContext< TypeTag >::extensiveQuantities_, and Ewoms::FvBaseElementContext< TypeTag >::stencil_.

Referenced by Ewoms::FvBaseElementContext< TypeTag >::updateAll().

template<class TypeTag >
void Ewoms::FvBaseElementContext< TypeTag >::updateStencilTopology ( const Element &  elem)
inline

Update the topological part of the stencil, but nothing else.

Parameters
elemThe grid element for which the finite volume geometry ought to be computed.

References Ewoms::FvBaseElementContext< TypeTag >::elemPtr_, and Ewoms::FvBaseElementContext< TypeTag >::stencil_.

Member Data Documentation

template<class TypeTag >
GradientCalculator Ewoms::FvBaseElementContext< TypeTag >::gradientCalculator_
protected
template<class TypeTag >
const GridView Ewoms::FvBaseElementContext< TypeTag >::gridView_
protected
template<class TypeTag >
IntensiveQuantities Ewoms::FvBaseElementContext< TypeTag >::intensiveQuantitiesSaved_
protected

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