Opm::TpsaLinearizer< TypeTag > Class Template Reference

Linearizes TPSA equations and generates system matrix and residual for linear solver. More...

#include <tpsalinearizer.hpp>

Public Member Functions

 TpsaLinearizer ()
 Constructor. More...
 
void init (Simulator &simulator)
 Initialize the linearizer. More...
 
void eraseMatrix ()
 Causes the Jacobian matrix to be recreated from scratch before the next iteration. More...
 
void finalize ()
 Finalize creation of Jacobian matrix and make ready for linear solver. More...
 
template<class SubDomainType >
void resetSystem_ (const SubDomainType &domain)
 Initializing and/or reset residual and Jacobian. More...
 
void linearize ()
 Linearize the non-linear system. More...
 
void linearizeDomain ()
 Linearize the non-linear system for the spatial domain. More...
 
template<class SubDomainType >
void linearizeDomain (const SubDomainType &domain)
 Linearize the non-linear system for the spatial domain. More...
 
void linearizeAuxiliaryEquations ()
 Linearize auxillary equation. More...
 
void setResAndJacobi (VectorBlock &res, MatrixBlock &bMat, const ADVectorBlock &resid) const
 Extract local residuals and sub-block Jacobians from locally computed AD residual. More...
 
void updateBoundaryConditionData ()
 Update boundary condition information. More...
 
const SparseMatrixAdapter & jacobian () const
 Get Jacobian matrix. More...
 
SparseMatrixAdapter & jacobian ()
 Get Jacobian matrix. More...
 
const GlobalEqVector & residual () const
 Get residual vector. More...
 
GlobalEqVector & residual ()
 Get residual vector. More...
 
const LinearizationTypegetLinearizationType () const
 Get linearization type. More...
 
std::map< unsigned, Constraints > constraintsMap () const
 Get constraints map. More...
 
void setLinearizationType (LinearizationType linearizationType)
 Set linearization type. More...
 

Detailed Description

template<class TypeTag>
class Opm::TpsaLinearizer< TypeTag >

Linearizes TPSA equations and generates system matrix and residual for linear solver.

Constructor & Destructor Documentation

◆ TpsaLinearizer()

template<class TypeTag >
Opm::TpsaLinearizer< TypeTag >::TpsaLinearizer ( )
inline

Constructor.

Member Function Documentation

◆ constraintsMap()

template<class TypeTag >
std::map< unsigned, Constraints > Opm::TpsaLinearizer< TypeTag >::constraintsMap ( ) const
inline

Get constraints map.

Returns
Constraints map
Note
No constraints implemented in TPSA

◆ eraseMatrix()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::eraseMatrix ( )
inline

Causes the Jacobian matrix to be recreated from scratch before the next iteration.

This method is usually called if the sparsity pattern has changed for some reason. (e.g. by modifications of the grid or changes of the auxiliary equations.)

Referenced by Opm::TpsaLinearizer< TypeTag >::init().

◆ finalize()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::finalize ( )
inline

Finalize creation of Jacobian matrix and make ready for linear solver.

◆ getLinearizationType()

template<class TypeTag >
const LinearizationType & Opm::TpsaLinearizer< TypeTag >::getLinearizationType ( ) const
inline

Get linearization type.

Returns
Reference to the linearization object

The LinearizationType controls the scheme used and the focus time index. The default is fully implicit scheme, and focus index equal to 0, i.e. current time (end of step).

◆ init()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::init ( Simulator &  simulator)
inline

Initialize the linearizer.

Parameters
simulatorSimulator object

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

References Opm::TpsaLinearizer< TypeTag >::eraseMatrix().

◆ jacobian() [1/2]

template<class TypeTag >
SparseMatrixAdapter & Opm::TpsaLinearizer< TypeTag >::jacobian ( )
inline

Get Jacobian matrix.

Returns
Reference to (sparse) Jacobian matrix object

◆ jacobian() [2/2]

template<class TypeTag >
const SparseMatrixAdapter & Opm::TpsaLinearizer< TypeTag >::jacobian ( ) const
inline

Get Jacobian matrix.

Returns
Reference to (sparse) Jacobian matrix object

◆ linearize()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::linearize ( )
inline

◆ linearizeAuxiliaryEquations()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::linearizeAuxiliaryEquations ( )
inline

Linearize auxillary equation.

Referenced by Opm::TpsaLinearizer< TypeTag >::linearize().

◆ linearizeDomain() [1/2]

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::linearizeDomain ( )
inline

Linearize the non-linear system for the spatial domain.

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 Opm::TpsaLinearizer< TypeTag >::linearizeDomain().

Referenced by Opm::TpsaLinearizer< TypeTag >::linearize(), and Opm::TpsaLinearizer< TypeTag >::linearizeDomain().

◆ linearizeDomain() [2/2]

template<class TypeTag >
template<class SubDomainType >
void Opm::TpsaLinearizer< TypeTag >::linearizeDomain ( const SubDomainType &  domain)
inline

Linearize the non-linear system for the spatial domain.

Parameters
domain(Sub-)domain to linearize

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 Opm::TpsaLinearizer< TypeTag >::linearizeDomain(), and Opm::TpsaLinearizer< TypeTag >::resetSystem_().

◆ resetSystem_()

template<class TypeTag >
template<class SubDomainType >
void Opm::TpsaLinearizer< TypeTag >::resetSystem_ ( const SubDomainType &  domain)
inline

Initializing and/or reset residual and Jacobian.

Parameters
domain(Sub-)domain to reset

Referenced by Opm::TpsaLinearizer< TypeTag >::linearizeDomain().

◆ residual() [1/2]

template<class TypeTag >
GlobalEqVector & Opm::TpsaLinearizer< TypeTag >::residual ( )
inline

Get residual vector.

Returns
Reference to the residual

◆ residual() [2/2]

template<class TypeTag >
const GlobalEqVector & Opm::TpsaLinearizer< TypeTag >::residual ( ) const
inline

Get residual vector.

Returns
Reference to the residual

◆ setLinearizationType()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::setLinearizationType ( LinearizationType  linearizationType)
inline

Set linearization type.

Parameters
linearizationTypeLinearization object

◆ setResAndJacobi()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::setResAndJacobi ( VectorBlock &  res,
MatrixBlock &  bMat,
const ADVectorBlock &  resid 
) const
inline

Extract local residuals and sub-block Jacobians from locally computed AD residual.

Parameters
resResidual to set
bMatBlock matrix from Jacobian to set
residComputed AD residual

◆ updateBoundaryConditionData()

template<class TypeTag >
void Opm::TpsaLinearizer< TypeTag >::updateBoundaryConditionData ( )
inline

Update boundary condition information.


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