Tempus Version of the Day
Time Integration
Loading...
Searching...
No Matches
Tempus::DAEStructure< Scalar > Class Template Reference

Structure of an index-1 differential-algebraic system. More...

#include <Tempus_DAEStructure.hpp>

Public Types

typedef Thyra::VectorBase< Scalar > Vector
typedef Thyra::MultiVectorBase< Scalar > MultiVector
typedef Teuchos::ScalarTraits< Scalar >::magnitudeType Mag

Public Member Functions

 DAEStructure (const Teuchos::RCP< const Vector > &algebraic_mask)
 Constructor from the mask of the algebraic equations (entries 0 or 1).
Teuchos::RCP< const Vector > getAlgebraicMask () const
 Mask of the algebraic equations (1 on the algebraic equations).
Teuchos::RCP< const Vector > getDifferentialMask () const
 Mask of the other equations (1 - mask of the algebraic equations).
void zeroAlgebraicComponents (MultiVector &v) const
 v <- P_d v: zero the algebraic components of each column of v
void zeroDifferentialComponents (MultiVector &v) const
 v <- P_a v: zero the differential components of each column of v
void checkMassMatrix (const Thyra::ModelEvaluator< Scalar > &model, const Thyra::ModelEvaluatorBase::InArgs< Scalar > &inArgs, const std::string &caller) const
 Check that the rows of the algebraic equations of the mass matrix df/dx_dot (model evaluated with alpha = 1, beta = 0 at inArgs) are zero.

Static Public Member Functions

static const std::string & algebraicMaskName ()
 Name of the parameter giving the mask of the algebraic equations.

Private Attributes

Teuchos::RCP< const Vector > algebraic_mask_
Teuchos::RCP< const Vector > differential_mask_

Detailed Description

template<class Scalar>
class Tempus::DAEStructure< Scalar >

Structure of an index-1 differential-algebraic system.

The equations f(x_dot, x, p, t) = 0 are split into differential and algebraic equations. The algebraic equations are rows of the mass matrix E = df/dx_dot that are zero, e.g. constraints solved at each time (the velocity equations of a coupled velocity-thickness ice sheet model), or Dirichlet conditions written as f_i = x_i - d_i(p,t). The structure is given by a mask in the residual space, equal to 1 on the algebraic equations and 0 elsewhere: only the equations are flagged, not the unknowns. With A = df/dx and the diagonal masks P_a and P_d = I - P_a of the algebraic and differential equations, the system has index 1 when the matrix C = P_a A + P_d E (rows of df/dx for the algebraic equations, rows of df/dx_dot for the others) is nonsingular: differentiating the algebraic equations once in time gives C x_dot = -(P_a df/dt + P_d f(0, x, p, t)), which determines x_dot. Semi-explicit DAEs, x = (x_d, x_a) with E = [E_dd 0; 0 0] and df_a/dx_a nonsingular, are the typical case.

The structure is given to Tempus with the parameter "Algebraic Equations Mask" of the "Sensitivities" sublist, a Teuchos::RCP<const Thyra::VectorBase<Scalar> > (see getDAEStructure()). It is currently used by IntegratorAdjointSensitivity, to compute the jumps of the adjoint of "Final Time" and "Sum Over Times" responses (see AdjointDAEJumpSolver). The forward integration does not use it: the forward stepper must be suited to index-1 DAEs (e.g. Backward Euler) and must not compute consistent initial conditions.

Definition at line 55 of file Tempus_DAEStructure.hpp.

Member Typedef Documentation

◆ Vector

template<class Scalar>
typedef Thyra::VectorBase<Scalar> Tempus::DAEStructure< Scalar >::Vector

Definition at line 57 of file Tempus_DAEStructure.hpp.

◆ MultiVector

template<class Scalar>
typedef Thyra::MultiVectorBase<Scalar> Tempus::DAEStructure< Scalar >::MultiVector

Definition at line 58 of file Tempus_DAEStructure.hpp.

◆ Mag

template<class Scalar>
typedef Teuchos::ScalarTraits<Scalar>::magnitudeType Tempus::DAEStructure< Scalar >::Mag

Definition at line 59 of file Tempus_DAEStructure.hpp.

Constructor & Destructor Documentation

◆ DAEStructure()

template<class Scalar>
Tempus::DAEStructure< Scalar >::DAEStructure ( const Teuchos::RCP< const Vector > & algebraic_mask)
inlineexplicit

Constructor from the mask of the algebraic equations (entries 0 or 1).

Definition at line 69 of file Tempus_DAEStructure.hpp.

Member Function Documentation

◆ algebraicMaskName()

template<class Scalar>
const std::string & Tempus::DAEStructure< Scalar >::algebraicMaskName ( )
inlinestatic

Name of the parameter giving the mask of the algebraic equations.

Definition at line 62 of file Tempus_DAEStructure.hpp.

◆ getAlgebraicMask()

template<class Scalar>
Teuchos::RCP< const Vector > Tempus::DAEStructure< Scalar >::getAlgebraicMask ( ) const
inline

Mask of the algebraic equations (1 on the algebraic equations).

Definition at line 95 of file Tempus_DAEStructure.hpp.

◆ getDifferentialMask()

template<class Scalar>
Teuchos::RCP< const Vector > Tempus::DAEStructure< Scalar >::getDifferentialMask ( ) const
inline

Mask of the other equations (1 - mask of the algebraic equations).

Definition at line 101 of file Tempus_DAEStructure.hpp.

◆ zeroAlgebraicComponents()

template<class Scalar>
void Tempus::DAEStructure< Scalar >::zeroAlgebraicComponents ( MultiVector & v) const
inline

v <- P_d v: zero the algebraic components of each column of v

Definition at line 107 of file Tempus_DAEStructure.hpp.

◆ zeroDifferentialComponents()

template<class Scalar>
void Tempus::DAEStructure< Scalar >::zeroDifferentialComponents ( MultiVector & v) const
inline

v <- P_a v: zero the differential components of each column of v

Definition at line 114 of file Tempus_DAEStructure.hpp.

◆ checkMassMatrix()

template<class Scalar>
void Tempus::DAEStructure< Scalar >::checkMassMatrix ( const Thyra::ModelEvaluator< Scalar > & model,
const Thyra::ModelEvaluatorBase::InArgs< Scalar > & inArgs,
const std::string & caller ) const
inline

Check that the rows of the algebraic equations of the mass matrix df/dx_dot (model evaluated with alpha = 1, beta = 0 at inArgs) are zero.

The mass matrix is applied to a random vector. Models without W_op are not checked.

Definition at line 126 of file Tempus_DAEStructure.hpp.

Member Data Documentation

◆ algebraic_mask_

template<class Scalar>
Teuchos::RCP<const Vector> Tempus::DAEStructure< Scalar >::algebraic_mask_
private

Definition at line 160 of file Tempus_DAEStructure.hpp.

◆ differential_mask_

template<class Scalar>
Teuchos::RCP<const Vector> Tempus::DAEStructure< Scalar >::differential_mask_
private

Definition at line 161 of file Tempus_DAEStructure.hpp.


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