The common code for the linearizers of non-linear systems of equations. More...

#include <fvbaselinearizer.hh>

Public Types

enum  EntityColor { Red = 2, Yellow = 1, Green = 0 }
 The colors of elements and degrees of freedom required for partial relinearization. More...
 

Public Member Functions

 FvBaseLinearizer ()
 
 ~FvBaseLinearizer ()
 
void init (Simulator &simulator)
 Initialize the linearizer. More...
 
void recreateMatrix ()
 Causes the Jacobian matrix to be recreated in the next iteration. More...
 
void linearize ()
 Linearize the global non-linear system of equations. More...
 
void setLinearizationReusable (bool yesno=true)
 If linearization recycling is enabled, this method specifies whether the next call to linearize() just rescales the storage term or does a full relinearization. More...
 
void relinearizeAll ()
 If partial relinearization is enabled, this method causes all elements to be relinearized in the next linearize() call. More...
 
Scalar relinearizationAccuracy () const
 Returns the largest error of a "green" degree of freedom for the most recent call of the linearize() method. More...
 
Scalar maxDofError () const
 The maximum deflection seen for any DOF after an Newton update. More...
 
void updateRelinearizationErrors (const GlobalEqVector &uDelta, const GlobalEqVector &resid)
 Update the distance where the non-linear system was originally insistently linearized and the point where it will be linerized the next time. More...
 
void markDofRed (int dofIdx)
 Ensure that a given degree of freedom is relinarized in the next iteration. More...
 
EntityColor dofColor (int dofIdx) const
 Returns the "relinearization color" of a degree of freedom. More...
 
EntityColor elementColor (int elemIdx) const
 Returns the "relinearization color" of an element. More...
 
Scalar relinearizationTolerance () const
 Returns the maximum error for which a degree of freedom is not relinearized. More...
 
void setRelinearizationTolerance (Scalar tolerance)
 Sets the maximum error for which a degree of freedom is not relinearized. More...
 
Scalar dofError (int dofIdx) const
 Returns the error for a given degree of freedom after the last iteration. More...
 
const Matrix & matrix () const
 Return constant reference to global Jacobian matrix. More...
 
const GlobalEqVector & residual () const
 Return constant reference to global residual vector. More...
 

Static Public Member Functions

static void registerParameters ()
 Register all run-time parameters for the Jacobian linearizer. More...
 

Detailed Description

template<class TypeTag>
class Ewoms::FvBaseLinearizer< TypeTag >

The common code for the linearizers of non-linear systems of equations.

This class assumes that these system of equations to be linearized are stemming from models that use an finite volume scheme for spatial discretization and an Euler scheme for time discretization.

Constructor & Destructor Documentation

template<class TypeTag >
Ewoms::FvBaseLinearizer< TypeTag >::FvBaseLinearizer ( )
inline
template<class TypeTag >
Ewoms::FvBaseLinearizer< TypeTag >::~FvBaseLinearizer ( )
inline

Member Function Documentation

template<class TypeTag >
EntityColor Ewoms::FvBaseLinearizer< TypeTag >::dofColor ( int  dofIdx) const
inline

Returns the "relinearization color" of a degree of freedom.

References Ewoms::FvBaseLinearizer< TypeTag >::Red.

template<class TypeTag >
Scalar Ewoms::FvBaseLinearizer< TypeTag >::dofError ( int  dofIdx) const
inline

Returns the error for a given degree of freedom after the last iteration.

template<class TypeTag >
EntityColor Ewoms::FvBaseLinearizer< TypeTag >::elementColor ( int  elemIdx) const
inline

Returns the "relinearization color" of an element.

References Ewoms::FvBaseLinearizer< TypeTag >::Red.

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::init ( Simulator simulator)
inline

Initialize the linearizer.

At this point we can assume that all objects in the simulator have been allocated. We cannot assume that they are fully initialized, though.

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::linearize ( )
inline

Linearize the global non-linear system of equations.

That means that the global Jacobian of the residual is assembled and the residual is evaluated for the current solution.

The current state of affairs (esp. the previous and the current solutions) is represented by the model object.

References Ewoms::Simulator< TypeTag >::gridView().

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::markDofRed ( int  dofIdx)
inline

Ensure that a given degree of freedom is relinarized in the next iteration.

Calling this method usually means that the interpretation of the primary variables for the DOF has changed.

template<class TypeTag >
const Matrix& Ewoms::FvBaseLinearizer< TypeTag >::matrix ( ) const
inline

Return constant reference to global Jacobian matrix.

template<class TypeTag >
Scalar Ewoms::FvBaseLinearizer< TypeTag >::maxDofError ( ) const
inline

The maximum deflection seen for any DOF after an Newton update.

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::recreateMatrix ( )
inline

Causes the Jacobian matrix to be recreated in the next iteration.

template<class TypeTag >
static void Ewoms::FvBaseLinearizer< TypeTag >::registerParameters ( )
inlinestatic

Register all run-time parameters for the Jacobian linearizer.

References EWOMS_REGISTER_PARAM.

template<class TypeTag >
Scalar Ewoms::FvBaseLinearizer< TypeTag >::relinearizationAccuracy ( ) const
inline

Returns the largest error of a "green" degree of freedom for the most recent call of the linearize() method.

This only has an effect if partial Jacobian relinearization is enabled. If it is disabled, then this method always returns 0.

This returns the actual error computed as seen by computeColors(), not the tolerance which it was given.

template<class TypeTag >
Scalar Ewoms::FvBaseLinearizer< TypeTag >::relinearizationTolerance ( ) const
inline

Returns the maximum error for which a degree of freedom is not relinearized.

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::relinearizeAll ( )
inline

If partial relinearization is enabled, this method causes all elements to be relinearized in the next linearize() call.

References Ewoms::FvBaseLinearizer< TypeTag >::Red.

template<class TypeTag >
const GlobalEqVector& Ewoms::FvBaseLinearizer< TypeTag >::residual ( ) const
inline

Return constant reference to global residual vector.

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::setLinearizationReusable ( bool  yesno = true)
inline

If linearization recycling is enabled, this method specifies whether the next call to linearize() just rescales the storage term or does a full relinearization.

Parameters
yesnoIf true, only rescale; else always do a full relinearization.
template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::setRelinearizationTolerance ( Scalar  tolerance)
inline

Sets the maximum error for which a degree of freedom is not relinearized.

template<class TypeTag >
void Ewoms::FvBaseLinearizer< TypeTag >::updateRelinearizationErrors ( const GlobalEqVector &  uDelta,
const GlobalEqVector &  resid 
)
inline

Update the distance where the non-linear system was originally insistently linearized and the point where it will be linerized the next time.

This only has an effect if partial relinearize is enabled.

Parameters
uDeltaThe negative difference between the last and the next iterative solution.
residThe residual (right-hand side) for the current Newton iteration

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