ug4
ug::IAssemble< TAlgebra > Class Template Referenceabstract

Interface providing Jacobian and Defect of a discretization. More...

#include <assemble_interface.h>

+ Inheritance diagram for ug::IAssemble< TAlgebra >:

Public Types

typedef TAlgebra algebra_type
 Algebra type. More...
 
typedef TAlgebra::matrix_type matrix_type
 Type of algebra matrix. More...
 
typedef TAlgebra::vector_type vector_type
 Type of algebra vector. More...
 

Public Member Functions

void adjust_solution (vector_type &u)
 
virtual void adjust_solution (vector_type &u, const GridLevel &gl)=0
 sets dirichlet values in solution vector More...
 
void assemble_defect (vector_type &d, const vector_type &u)
 
virtual void assemble_defect (vector_type &d, const vector_type &u, const GridLevel &gl)=0
 assembles Defect More...
 
void assemble_jacobian (matrix_type &J, const vector_type &u)
 
virtual void assemble_jacobian (matrix_type &J, const vector_type &u, const GridLevel &gl)=0
 assembles Jacobian (or Approximation of Jacobian) More...
 
void assemble_linear (matrix_type &A, vector_type &b)
 
virtual void assemble_linear (matrix_type &A, vector_type &b, const GridLevel &gl)=0
 Assembles Matrix and Right-Hand-Side for a linear problem. More...
 
void assemble_mass_matrix (matrix_type &M, const vector_type &u)
 
virtual void assemble_mass_matrix (matrix_type &M, const vector_type &u, const GridLevel &gl)
 assembles mass matrix More...
 
void assemble_rhs (vector_type &b)
 
virtual void assemble_rhs (vector_type &b, const GridLevel &gl)=0
 Assembles Right-Hand-Side for a linear problem. More...
 
virtual void assemble_rhs (vector_type &rhs, const vector_type &u)
 
virtual void assemble_rhs (vector_type &rhs, const vector_type &u, const GridLevel &gl)=0
 assembles rhs More...
 
void assemble_stiffness_matrix (matrix_type &A, const vector_type &u)
 
virtual void assemble_stiffness_matrix (matrix_type &A, const vector_type &u, const GridLevel &gl)
 assembles stiffness matrix More...
 
virtual SmartPtr< IConstraint< TAlgebra > > constraint (size_t i)=0
 returns the i'th constraint More...
 
virtual size_t num_constraints () const =0
 returns the number of constraints More...
 
virtual ~IAssemble ()
 Virtual Destructor. More...
 
virtual SmartPtr< AssemblingTuner< TAlgebra > > ass_tuner ()=0
 
virtual ConstSmartPtr< AssemblingTuner< TAlgebra > > ass_tuner () const =0
 

Detailed Description

template<typename TAlgebra>
class ug::IAssemble< TAlgebra >

Interface providing Jacobian and Defect of a discretization.

Interface to generate Jacobi-Matrices and Defect-Vectors for a nonlinear problem and to compute Matrix and Right-Hand Side for a linear problem.

The Interface can be used directly to compute Jacobian and Defect (resp. Mass-Stiffness-matrix_type and right-hand side) in case of nonlinear (resp. linear) problem. Furthermore, the interface is used in the NewtonSolver and MultiGridSolver. The NewtonSolver uses the functions assemble_defect+assemble_jacobian or assemble_jacobian_defect. The MultiGridSolver uses the function assemble_jacobian in order to assemble coarse grid Matrices.

To give an idea of the usage, an implementation should obey this rules:

  • Time dependent nonlinear problem \( \partial_t u + A(u) = f \). Using a l-step time stepping, the defect will be

    \[ d(u^k) = \sum_{i=0}^{l-1} s_{m,i} M(u^{k-i}) + s_{a,i} \{A(u^{k-i}) - f\} \]

    and assemble_linear will return false.
  • Time dependent linear problem \( \partial_t u + A*u = f \). Using a l-step time stepping, the defect will be

    \[ d(u^k) = \sum_{i=0}^{l-1} s_{m,i} M*u^{k-i} + s_{a,i} \{A*u^{k-i} - f \} J(u^k) = s_{m,0}*M + s_{a,0} A \]

    and assemble_linear will compute \( A = s_{m,0}*M + s_{a,0} A \) and \( b = - \{ \sum_{i=1}^{l-1} s_{m,i} M*u^{k-i} + s_{a,i} \{A*u^{k-i} - f\} \} + s_{a,0} * f \)
  • Stationary Non-linear Problem \( A(u) = f \). Then, the defect will be

    \[ d(u) = A(u) - f \]

    and assemble_linear will return false.
  • Stationary linear Problem \( A*u = f \). Then, the defect will be

    \[ d(u) = A*u - f J(u) = A \]

    and assemble_linear will compute \( A = A \) and \( b = f \).

    Template Parameters
    TAlgebraAlgebra type

Member Typedef Documentation

◆ algebra_type

template<typename TAlgebra >
typedef TAlgebra ug::IAssemble< TAlgebra >::algebra_type

Algebra type.

◆ matrix_type

template<typename TAlgebra >
typedef TAlgebra::matrix_type ug::IAssemble< TAlgebra >::matrix_type

Type of algebra matrix.

◆ vector_type

template<typename TAlgebra >
typedef TAlgebra::vector_type ug::IAssemble< TAlgebra >::vector_type

Type of algebra vector.

Constructor & Destructor Documentation

◆ ~IAssemble()

template<typename TAlgebra >
virtual ug::IAssemble< TAlgebra >::~IAssemble ( )
inlinevirtual

Virtual Destructor.

Member Function Documentation

◆ adjust_solution() [1/2]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::adjust_solution ( vector_type u)
inline

◆ adjust_solution() [2/2]

template<typename TAlgebra >
virtual void ug::IAssemble< TAlgebra >::adjust_solution ( vector_type u,
const GridLevel gl 
)
pure virtual

◆ ass_tuner() [1/2]

◆ ass_tuner() [2/2]

◆ assemble_defect() [1/2]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::assemble_defect ( vector_type d,
const vector_type u 
)
inline

◆ assemble_defect() [2/2]

◆ assemble_jacobian() [1/2]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::assemble_jacobian ( matrix_type J,
const vector_type u 
)
inline

◆ assemble_jacobian() [2/2]

template<typename TAlgebra >
virtual void ug::IAssemble< TAlgebra >::assemble_jacobian ( matrix_type J,
const vector_type u,
const GridLevel gl 
)
pure virtual

◆ assemble_linear() [1/2]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::assemble_linear ( matrix_type A,
vector_type b 
)
inline

◆ assemble_linear() [2/2]

template<typename TAlgebra >
virtual void ug::IAssemble< TAlgebra >::assemble_linear ( matrix_type A,
vector_type b,
const GridLevel gl 
)
pure virtual

◆ assemble_mass_matrix() [1/2]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::assemble_mass_matrix ( matrix_type M,
const vector_type u 
)
inline

◆ assemble_mass_matrix() [2/2]

◆ assemble_rhs() [1/4]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::assemble_rhs ( vector_type b)
inline

◆ assemble_rhs() [2/4]

◆ assemble_rhs() [3/4]

template<typename TAlgebra >
virtual void ug::IAssemble< TAlgebra >::assemble_rhs ( vector_type rhs,
const vector_type u 
)
inlinevirtual

◆ assemble_rhs() [4/4]

◆ assemble_stiffness_matrix() [1/2]

template<typename TAlgebra >
void ug::IAssemble< TAlgebra >::assemble_stiffness_matrix ( matrix_type A,
const vector_type u 
)
inline

◆ assemble_stiffness_matrix() [2/2]

◆ constraint()

◆ num_constraints()


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