Calculates the local residual and its Jacobian for a single element of the grid.
More...
#include <fvbaseadlocallinearizer.hh>
|
| FvBaseAdLocalLinearizer (const FvBaseAdLocalLinearizer &)=delete |
|
void | init (Simulator &simulator) |
| Initialize the local Jacobian object.
|
|
void | linearize (const Element &element) |
| Compute an element's local Jacobian matrix and evaluate its residual.
|
|
void | linearize (ElementContext &elemCtx, const Element &elem) |
| Compute an element's local Jacobian matrix and evaluate its residual.
|
|
LocalResidual & | localResidual () |
| Return reference to the local residual.
|
|
const LocalResidual & | localResidual () const |
| Return reference to the local residual.
|
|
const ScalarMatrixBlock & | jacobian (unsigned domainScvIdx, unsigned rangeScvIdx) const |
| Returns the local Jacobian matrix of the residual of a sub-control volume.
|
|
const ScalarVectorBlock & | residual (unsigned dofIdx) const |
| Returns the local residual of a sub-control volume.
|
|
|
static void | registerParameters () |
| Register all run-time parameters for the local jacobian.
|
|
|
Implementation & | asImp_ () |
|
const Implementation & | asImp_ () const |
|
const Simulator & | simulator_ () const |
|
const Problem & | problem_ () const |
|
const Model & | model_ () const |
|
void | resize_ (const ElementContext &elemCtx) |
| Resize all internal attributes to the size of the element.
|
|
void | reset_ (const ElementContext &) |
| Reset the all relevant internal attributes to 0.
|
|
void | updateLocalLinearization_ (const ElementContext &elemCtx, unsigned focusDofIdx) |
| Updates the current local Jacobian matrix with the partial derivatives of all equations for the degree of freedom associated with 'focusDofIdx'.
|
|
|
Simulator * | simulatorPtr_ |
|
Model * | modelPtr_ |
|
ElementContext * | internalElemContext_ |
|
LocalResidual | localResidual_ |
|
ScalarLocalBlockVector | residual_ |
|
ScalarLocalBlockMatrix | jacobian_ |
|
template<class TypeTag>
class Opm::FvBaseAdLocalLinearizer< TypeTag >
Calculates the local residual and its Jacobian for a single element of the grid.
This class uses automatic differentiation to calculate the partial derivatives (the alternative is finite differences).
◆ init()
Initialize the local Jacobian object.
At this point we can assume that everything has been allocated, although some objects may not yet be completely initialized.
- Parameters
-
simulator | The simulator object of the simulation. |
◆ jacobian()
Returns the local Jacobian matrix of the residual of a sub-control volume.
- Parameters
-
domainScvIdx | The local index of the sub control volume to which the primary variables are associated with |
rangeScvIdx | The local index of the sub control volume which contains the local residual |
◆ linearize() [1/2]
Compute an element's local Jacobian matrix and evaluate its residual.
The local Jacobian for a given context is defined as the derivatives of the residuals of all degrees of freedom featured by the stencil with regard to the primary variables of the stencil's "primary" degrees of freedom. Adding the local Jacobians for all elements in the grid will give the global Jacobian 'grad f(x)'.
- Parameters
-
element | The grid element for which the local residual and its local Jacobian should be calculated. |
◆ linearize() [2/2]
Compute an element's local Jacobian matrix and evaluate its residual.
The local Jacobian for a given context is defined as the derivatives of the residuals of all degrees of freedom featured by the stencil with regard to the primary variables of the stencil's "primary" degrees of freedom. Adding the local Jacobians for all elements in the grid will give the global Jacobian 'grad f(x)'.
After calling this method the ElementContext is in an undefined state, so do not use it anymore!
- Parameters
-
elemCtx | The element execution context for which the local residual and its local Jacobian should be calculated. |
◆ residual()
Returns the local residual of a sub-control volume.
- Parameters
-
dofIdx | The local index of the sub control volume |
The documentation for this class was generated from the following file: