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. | |
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 | updatePrimaryStencil (const Element &elem) |
Update the primary topological part of the stencil, but nothing else. 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. | |
void | updateIntensiveQuantities (unsigned timeIdx) |
Compute the intensive quantities of all sub-control volumes of the current element for a single time index. More... | |
void | updatePrimaryIntensiveQuantities (unsigned 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, unsigned dofIdx, unsigned 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. | |
void | updateExtensiveQuantities (unsigned timeIdx) |
Compute the extensive quantities of all sub-control volume faces of the current element for a single time index. More... | |
void | setFocusDofIndex (unsigned dofIdx) |
Sets the degree of freedom on which the simulator is currently "focused" on. More... | |
unsigned | focusDofIndex () const |
Returns the degree of freedom on which the simulator is currently "focused" on. More... | |
const Simulator & | simulator () const |
Return a reference to the simulator. | |
const Problem & | problem () const |
Return a reference to the problem. | |
const Model & | model () const |
Return a reference to the model. | |
const GridView & | gridView () const |
Return a reference to the grid view. | |
const Element & | element () const |
Return the current element. | |
size_t | numDof (unsigned timeIdx) const |
Return the number of sub-control volumes of the current element. | |
size_t | numPrimaryDof (unsigned timeIdx) const |
Return the number of primary degrees of freedom of the current element. | |
size_t | numInteriorFaces (unsigned timeIdx) const |
Return the number of non-boundary faces which need to be considered for the flux apporixmation. | |
size_t | numBoundaryFaces (unsigned timeIdx) const |
Return the number of boundary faces which need to be considered for the flux apporixmation. | |
const Stencil & | stencil (unsigned timeIdx OPM_UNUSED) const |
Return the current finite element geometry. More... | |
const GlobalPosition & | pos (unsigned dofIdx, unsigned timeIdx OPM_UNUSED) const |
Return the position of a local entities in global coordinates. More... | |
unsigned | globalSpaceIndex (unsigned dofIdx, unsigned timeIdx) const |
Return the global spatial index for a sub-control volume. More... | |
Scalar | dofVolume (unsigned dofIdx, unsigned timeIdx) const |
Return the element-local volume associated with a degree of freedom. More... | |
Scalar | dofTotalVolume (unsigned dofIdx, unsigned 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. | |
const IntensiveQuantities & | intensiveQuantities (unsigned dofIdx, unsigned timeIdx) const |
Return a reference to the intensive quantities of a sub-control volume at a given time. More... | |
const IntensiveQuantities * | thermodynamicHint (unsigned dofIdx, unsigned timeIdx) const |
Return the thermodynamic hint for a given local index. More... | |
IntensiveQuantities & | intensiveQuantities (unsigned dofIdx, unsigned timeIdx) |
Return a reference to the intensive quantities of a sub-control volume at a given time. More... | |
PrimaryVariables & | primaryVars (unsigned dofIdx, unsigned timeIdx) |
Return the primary variables for a given local index. More... | |
const PrimaryVariables & | primaryVars (unsigned dofIdx, unsigned timeIdx) const |
Return the primary variables for a given local index. More... | |
bool | haveStashedIntensiveQuantities () const |
Returns true if no intensive quanties are stashed. More... | |
int | stashedDofIdx () const |
Return the (local) index of the DOF for which the primary variables were stashed. More... | |
void | stashIntensiveQuantities (unsigned dofIdx) |
Stash the intensive quantities for a degree of freedom on internal memory. More... | |
void | restoreIntensiveQuantities (unsigned 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. | |
const ExtensiveQuantities & | extensiveQuantities (unsigned fluxIdx, unsigned timeIdx OPM_UNUSED) const |
Return a reference to the extensive quantities of a sub-control volume face. More... | |
bool | enableStorageCache () const |
Returns true iff the cache for the storage term ought to be used for this context. More... | |
void | setEnableStorageCache (bool yesno) |
Specifies if the cache for the storage term ought to be used for this context. | |
Static Public Member Functions | |
static void * | operator new (size_t size) |
static void | operator delete (void *ptr) |
Protected Member Functions | |
void | updateIntensiveQuantities_ (unsigned timeIdx, size_t numDof) |
Update the first 'n' intensive quantities objects from the primary variables. More... | |
void | updateSingleIntQuants_ (const PrimaryVariables &priVars, unsigned dofIdx, unsigned timeIdx) |
Protected Attributes | |
IntensiveQuantities | intensiveQuantitiesStashed_ |
PrimaryVariables | priVarsStashed_ |
GradientCalculator | gradientCalculator_ |
std::vector< DofStore_, Ewoms::aligned_allocator< DofStore_, alignof(DofStore_)> > | dofVars_ |
std::vector< ExtensiveQuantities, Ewoms::aligned_allocator< ExtensiveQuantities, alignof(ExtensiveQuantities)> > | extensiveQuantities_ |
const Simulator * | simulatorPtr_ |
const Element * | elemPtr_ |
const GridView | gridView_ |
Stencil | stencil_ |
int | stashedDofIdx_ |
int | focusDofIdx_ |
bool | enableStorageCache_ |
This class stores an array of IntensiveQuantities objects, one intensive quantities object for each of the element's vertices.
|
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.)
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
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...
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Returns true iff the cache for the storage term ought to be used for this context.
If it is used, intensive quantities can only be accessed for the most recent time index. (time index 0.)
|
inline |
Return a reference to the extensive quantities of a sub-control volume face.
fluxIdx | The local index of the sub-control volume face for which the extensive quantities are requested |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Returns the degree of freedom on which the simulator is currently "focused" on.
|
inline |
Return the global spatial index for a sub-control volume.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Returns true if no intensive quanties are stashed.
In most cases quantities are stashed only if a partial derivative is to be calculated via finite difference methods.
|
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.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
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.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Return the position of a local entities in global coordinates.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Return the primary variables for a given local index.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Return the primary variables for a given local index.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Restores the intensive quantities for a degree of freedom from internal memory.
dofIdx | The local index of the degree of freedom in the current element. |
|
inline |
Sets the degree of freedom on which the simulator is currently "focused" on.
I.e., in the case of automatic differentiation, all derivatives are with regard to the primary variables of that degree of freedom. Only "primary" DOFs can be focused on.
|
inline |
Return the (local) index of the DOF for which the primary variables were stashed.
If none, then this returns -1.
|
inline |
Stash the intensive quantities for a degree of freedom on internal memory.
dofIdx | The local index of the degree of freedom in the current element. |
|
inline |
Return the current finite element geometry.
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Return the thermodynamic hint for a given local index.
dofIdx | The local index of the degree of freedom in the current element. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Construct all volume and extensive quantities of an element from scratch.
elem | The DUNE Codim<0> entity for which the volume variables ought to be calculated |
|
inline |
Compute the extensive quantities of all sub-control volume faces of the current element for a single time index.
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Compute the intensive quantities of all sub-control volumes of the current element for a single time index.
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Compute the intensive quantities of a single sub-control volume of the current element for a single time index.
priVars | The PrimaryVariables which should be used to calculate the intensive quantities. |
dofIdx | The local index in the current element of the sub-control volume which should be updated. |
timeIdx | The index of the solution vector used by the time discretization. |
|
inlineprotected |
Update the first 'n' intensive quantities objects from the primary variables.
This method considers the intensive quantities cache.
|
inline |
Compute the intensive quantities of all sub-control volumes of the current element for a single time index.
timeIdx | The index of the solution vector used by the time discretization. |
|
inline |
Update the primary topological part of the stencil, but nothing else.
elem | The grid element for which the finite volume geometry ought to be computed. |
|
inline |
Compute the finite volume geometry for an element.
elem | The grid element for which the finite volume geometry ought to be computed. |
|
inline |
Update the topological part of the stencil, but nothing else.
elem | The grid element for which the finite volume geometry ought to be computed. |