Loading [MathJax]/extensions/tex2jax.js
ug4
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ug::SDIRK< TAlgebra > Class Template Reference

Singly Diagonal Implicit Runge Kutta Method. More...

#include <theta_time_step.h>

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

Public Types

typedef TAlgebra algebra_type
 Type of algebra.
 
typedef IDomainDiscretization< TAlgebra > domain_discretization_type
 Domain Discretization type.
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix.
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::MultiStepTimeDiscretization< TAlgebra >
typedef TAlgebra algebra_type
 Type of algebra.
 
typedef IDomainDiscretization< algebra_typedomain_discretization_type
 Domain Discretization type.
 
typedef CPUAlgebra::vector_type error_vector_type
 Type of algebra vector.
 
typedef algebra_type::matrix_type matrix_type
 Type of algebra matrix.
 
typedef algebra_type::vector_type vector_type
 Type of algebra vector.
 
- Public Types inherited from ug::ITimeDiscretization< TAlgebra >
typedef TAlgebra algebra_type
 Algebra type.
 
typedef IDomainDiscretization< TAlgebra > domain_discretization_type
 Domain Discretization type.
 
typedef algebra_type::vector_type vector_type
 Vector type.
 
- Public Types inherited from ug::IAssemble< TAlgebra >
typedef TAlgebra algebra_type
 Algebra type.
 
typedef TAlgebra::matrix_type matrix_type
 Type of algebra matrix.
 
typedef TAlgebra::vector_type vector_type
 Type of algebra vector.
 

Public Member Functions

void adjust_solution (vector_type &u, const GridLevel &gl)
 
void assemble_defect (vector_type &d, const vector_type &u, const GridLevel &gl)
 
void assemble_jacobian (matrix_type &J, const vector_type &u, const GridLevel &gl)
 
void assemble_linear (matrix_type &A, vector_type &b, const GridLevel &gl)
 
void assemble_rhs (vector_type &b, const GridLevel &gl)
 
void assemble_rhs (vector_type &b, const vector_type &u, const GridLevel &gl)
 
virtual size_t num_stages () const
 returns number of stages
 
virtual void prepare_step (SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt)
 prepares the assembling of Defect/Jacobian for a time step
 
 SDIRK (SmartPtr< IDomainDiscretization< TAlgebra > > spDD)
 default constructor (implicit Euler)
 
 SDIRK (SmartPtr< IDomainDiscretization< TAlgebra > > spDD, int order)
 theta = 1.0 -> Implicit Euler, 0.0 -> Explicit Euler
 
void set_order (int order)
 sets the scheme
 
virtual void set_stage (size_t stage)
 sets the stage
 
virtual ~SDIRK ()
 
- Public Member Functions inherited from ug::MultiStepTimeDiscretization< TAlgebra >
void adjust_solution (vector_type &u, const GridLevel &gl)
 
void assemble_defect (vector_type &d, const vector_type &u, const GridLevel &gl)
 
void assemble_jacobian (matrix_type &J, const vector_type &u, const GridLevel &gl)
 
void assemble_linear (matrix_type &A, vector_type &b, const GridLevel &gl)
 
void assemble_rhs (vector_type &b, const GridLevel &gl)
 
void assemble_rhs (vector_type &b, const vector_type &u, const GridLevel &gl)
 
void calc_error (const vector_type &u)
 
void calc_error (const vector_type &u, error_vector_type &u_vtk)
 
void calc_error (const vector_type &u, error_vector_type *u_vtk)
 Error estimator ///.
 
virtual void finish_step (SmartPtr< VectorTimeSeries< vector_type > > currSol)
 
virtual void finish_step_elem (SmartPtr< VectorTimeSeries< vector_type > > currSol, const GridLevel &gl)
 
virtual number future_time () const
 returns the future time point (i.e. the one that will be computed)
 
void invalidate_error ()
 
bool is_error_valid ()
 returns whether error indicators are valid
 
 MultiStepTimeDiscretization (SmartPtr< IDomainDiscretization< algebra_type > > spDD)
 constructor
 
virtual size_t num_prev_steps () const
 returns number of previous time steps needed
 
virtual void prepare_step_elem (SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt, const GridLevel &gl)
 prepares the assembling of Defect/Jacobian for a time step
 
virtual ~MultiStepTimeDiscretization ()
 
- Public Member Functions inherited from ug::ITimeDiscretization< TAlgebra >
virtual SmartPtr< IConstraint< TAlgebra > > constraint (size_t i)
 returns the i'th constraint
 
SmartPtr< IDomainDiscretization< TAlgebra > > domain_disc () const
 return underlying domain disc
 
 ITimeDiscretization (SmartPtr< IDomainDiscretization< TAlgebra > > spDD)
 create and set domain discretization
 
virtual size_t num_constraints () const
 returns the number of constraint
 
void prepare_step_elem (SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt)
 prepares the assembling of Defect/Jacobian for a time step
 
void finish_step_elem (SmartPtr< VectorTimeSeries< vector_type > > currSol)
 
- Public Member Functions inherited from ug::IAssemble< TAlgebra >
void adjust_solution (vector_type &u)
 
virtual void adjust_solution (vector_type &u, const GridLevel &gl)=0
 sets dirichlet values in solution vector
 
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
 
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)
 
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.
 
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
 
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.
 
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
 
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
 
virtual ~IAssemble ()
 Virtual Destructor.
 

Protected Member Functions

virtual number update_scaling (std::vector< number > &vSM, std::vector< number > &vSA, number dt)
 
virtual number update_scaling (std::vector< number > &vSM, std::vector< number > &vSA, number dt, number currentTime, ConstSmartPtr< VectorTimeSeries< vector_type > > prevSol)
 Error estimator ///.
 

Protected Attributes

number m_lastTime
 
int m_order
 
size_t m_stage
 
number m_Time0
 
- Protected Attributes inherited from ug::MultiStepTimeDiscretization< TAlgebra >
number m_dt
 Time Step size.
 
number m_futureTime
 Future Time.
 
SmartPtr< VectorTimeSeries< vector_type > > m_pPrevSol
 Previous solutions.
 
size_t m_prevSteps
 number of previous steps needed.
 
std::vector< numberm_vScaleMass
 Scaling for mass part.
 
std::vector< numberm_vScaleStiff
 Scaling for stiffness part.
 
- Protected Attributes inherited from ug::ITimeDiscretization< TAlgebra >
SmartPtr< IDomainDiscretization< TAlgebra > > m_spDomDisc
 Domain Discretization.
 

Detailed Description

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

Singly Diagonal Implicit Runge Kutta Method.

Member Typedef Documentation

◆ algebra_type

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

Type of algebra.

◆ domain_discretization_type

template<typename TAlgebra >
typedef IDomainDiscretization<TAlgebra> ug::SDIRK< TAlgebra >::domain_discretization_type

Domain Discretization type.

◆ matrix_type

template<typename TAlgebra >
typedef algebra_type::matrix_type ug::SDIRK< TAlgebra >::matrix_type

Type of algebra matrix.

◆ vector_type

template<typename TAlgebra >
typedef algebra_type::vector_type ug::SDIRK< TAlgebra >::vector_type

Type of algebra vector.

Constructor & Destructor Documentation

◆ SDIRK() [1/2]

template<typename TAlgebra >
ug::SDIRK< TAlgebra >::SDIRK ( SmartPtr< IDomainDiscretization< TAlgebra > >  spDD)
inline

default constructor (implicit Euler)

References ug::MultiStepTimeDiscretization< TAlgebra >::m_prevSteps.

◆ SDIRK() [2/2]

template<typename TAlgebra >
ug::SDIRK< TAlgebra >::SDIRK ( SmartPtr< IDomainDiscretization< TAlgebra > >  spDD,
int  order 
)
inline

◆ ~SDIRK()

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

Member Function Documentation

◆ adjust_solution()

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

◆ assemble_defect()

template<typename TAlgebra >
void ug::SDIRK< TAlgebra >::assemble_defect ( vector_type d,
const vector_type u,
const GridLevel gl 
)

References UG_CATCH_THROW.

◆ assemble_jacobian()

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

References UG_CATCH_THROW.

◆ assemble_linear()

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

References UG_THROW.

◆ assemble_rhs() [1/2]

template<typename TAlgebra >
void ug::SDIRK< TAlgebra >::assemble_rhs ( vector_type b,
const GridLevel gl 
)

References UG_THROW.

◆ assemble_rhs() [2/2]

template<typename TAlgebra >
void ug::SDIRK< TAlgebra >::assemble_rhs ( vector_type b,
const vector_type u,
const GridLevel gl 
)

References UG_THROW.

◆ num_stages()

template<typename TAlgebra >
virtual size_t ug::SDIRK< TAlgebra >::num_stages ( ) const
inlinevirtual

returns number of stages

Implements ug::ITimeDiscretization< TAlgebra >.

References ug::SDIRK< TAlgebra >::m_order, and UG_THROW.

◆ prepare_step()

template<typename TAlgebra >
void ug::SDIRK< TAlgebra >::prepare_step ( SmartPtr< VectorTimeSeries< vector_type > >  prevSol,
number  dt 
)
virtual

prepares the assembling of Defect/Jacobian for a time step

This function supplies the TimeDiscretization with previous time steps and step size before the assembling routines can be called.

Parameters
[in]prevSolthe solution at the previous time steps
[in]dtsize of time step

Reimplemented from ug::MultiStepTimeDiscretization< TAlgebra >.

References UG_CATCH_THROW.

◆ set_order()

template<typename TAlgebra >
void ug::SDIRK< TAlgebra >::set_order ( int  order)
inline

sets the scheme

References ug::SDIRK< TAlgebra >::m_order, and UG_THROW.

Referenced by ug::SDIRK< TAlgebra >::SDIRK().

◆ set_stage()

template<typename TAlgebra >
void ug::SDIRK< TAlgebra >::set_stage ( size_t  stage)
virtual

sets the stage

Implements ug::ITimeDiscretization< TAlgebra >.

◆ update_scaling() [1/2]

template<typename TAlgebra >
number ug::SDIRK< TAlgebra >::update_scaling ( std::vector< number > &  vSM,
std::vector< number > &  vSA,
number  dt 
)
protectedvirtual

References UG_THROW.

◆ update_scaling() [2/2]

template<typename TAlgebra >
virtual number ug::SDIRK< TAlgebra >::update_scaling ( std::vector< number > &  vSM,
std::vector< number > &  vSA,
number  dt,
number  currentTime,
ConstSmartPtr< VectorTimeSeries< vector_type > >  prevSol 
)
inlineprotectedvirtual

Error estimator ///.

updates the scaling factors, returns the future time

Implements ug::MultiStepTimeDiscretization< TAlgebra >.

References UG_THROW.

Member Data Documentation

◆ m_lastTime

template<typename TAlgebra >
number ug::SDIRK< TAlgebra >::m_lastTime
protected

◆ m_order

template<typename TAlgebra >
int ug::SDIRK< TAlgebra >::m_order
protected

◆ m_stage

template<typename TAlgebra >
size_t ug::SDIRK< TAlgebra >::m_stage
protected

◆ m_Time0

template<typename TAlgebra >
number ug::SDIRK< TAlgebra >::m_Time0
protected

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