ug4
ug::CompositeTimeDiscretization< TAlgebra > Class Template Reference

combine several time discretizations into one More...

#include <composite_time_disc.h>

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

Classes

class  CompositeAssTuner
 

Public Types

typedef TAlgebra algebra_type
 
typedef algebra_type::matrix_type matrix_type
 
typedef algebra_type::vector_type vector_type
 
- Public Types inherited from ug::IAssemble< TAlgebra >
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 add_time_disc (SmartPtr< ITimeDiscretization< TAlgebra > > tDisc)
 
void adjust_solution (vector_type &u, const GridLevel &gl)
 sets dirichlet values in solution vector More...
 
void assemble_defect (vector_type &d, const vector_type &u, const GridLevel &gl)
 assembles Defect More...
 
void assemble_jacobian (matrix_type &J, const vector_type &u, const GridLevel &gl)
 assembles Jacobian (or Approximation of Jacobian) More...
 
void assemble_linear (matrix_type &A, vector_type &b, const GridLevel &gl)
 Assembles Matrix and Right-Hand-Side for a linear problem. More...
 
void assemble_rhs (vector_type &b, const GridLevel &gl)
 
void assemble_rhs (vector_type &b, const vector_type &u, const GridLevel &gl)
 
virtual SmartPtr< IConstraint< TAlgebra > > constraint (size_t i)
 returns the i'th constraint More...
 
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) More...
 
virtual size_t num_constraints () const
 returns the number of constraints More...
 
virtual size_t num_prev_steps () const
 returns number of previous time steps needed More...
 
virtual size_t num_stages () const
 returns the number of stages More...
 
virtual void prepare_step (SmartPtr< VectorTimeSeries< vector_type > > prevSol, number dt)
 prepares the assembling of Defect/Jacobian for a time step More...
 
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 More...
 
virtual void set_stage (size_t stage)
 sets the stage More...
 
virtual SmartPtr< AssemblingTuner< TAlgebra > > ass_tuner ()
 
virtual ConstSmartPtr< AssemblingTuner< TAlgebra > > ass_tuner () const
 
- Public Member Functions inherited from ug::IAssemble< TAlgebra >
void adjust_solution (vector_type &u)
 
void assemble_defect (vector_type &d, const vector_type &u)
 
void assemble_jacobian (matrix_type &J, const vector_type &u)
 
void assemble_linear (matrix_type &A, vector_type &b)
 
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 &rhs, const vector_type &u)
 
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 ~IAssemble ()
 Virtual Destructor. More...
 

Protected Attributes

std::vector< SmartPtr< ITimeDiscretization< TAlgebra > > > m_vTimeDisc
 

Detailed Description

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

combine several time discretizations into one

Member Typedef Documentation

◆ algebra_type

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

◆ matrix_type

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

◆ vector_type

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

Member Function Documentation

◆ add_time_disc()

template<typename TAlgebra >
void ug::CompositeTimeDiscretization< TAlgebra >::add_time_disc ( SmartPtr< ITimeDiscretization< TAlgebra > >  tDisc)
inline

◆ adjust_solution()

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

sets dirichlet values in solution vector

Sets dirichlet values of the NumericalSolution u when components are dirichlet

Parameters
[out]uNumerical Solution
[in]glGrid Level

Implements ug::IAssemble< TAlgebra >.

◆ ass_tuner() [1/2]

template<typename TAlgebra >
SmartPtr< AssemblingTuner< TAlgebra > > ug::CompositeTimeDiscretization< TAlgebra >::ass_tuner
virtual

Implements ug::IAssemble< TAlgebra >.

References make_sp().

◆ ass_tuner() [2/2]

template<typename TAlgebra >
ConstSmartPtr< AssemblingTuner< TAlgebra > > ug::CompositeTimeDiscretization< TAlgebra >::ass_tuner
virtual

Implements ug::IAssemble< TAlgebra >.

References UG_THROW.

◆ assemble_defect()

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

assembles Defect

Assembles Defect at a given Solution u.

Parameters
[out]dDefect d(u) to be filled
[in]uCurrent iterate
[in]glGrid Level

Implements ug::IAssemble< TAlgebra >.

References UG_COND_THROW.

◆ assemble_jacobian()

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

assembles Jacobian (or Approximation of Jacobian)

Assembles Jacobian at a given iterate u.

Parameters
[out]JJacobian J(u) matrix to be filled
[in]uCurrent iterate
[in]glGrid Level

Implements ug::IAssemble< TAlgebra >.

References UG_COND_THROW.

◆ assemble_linear()

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

Assembles Matrix and Right-Hand-Side for a linear problem.

Assembles matrix_type and Right-Hand-Side for a linear problem

Parameters
[out]AMass-/Stiffness- Matrix
[out]bRight-Hand-Side
[in]glGrid Level

Implements ug::IAssemble< TAlgebra >.

References UG_COND_THROW.

◆ assemble_rhs() [1/2]

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

Implements ug::IAssemble< TAlgebra >.

References UG_COND_THROW.

◆ assemble_rhs() [2/2]

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

Implements ug::IAssemble< TAlgebra >.

References UG_COND_THROW.

◆ constraint()

template<typename TAlgebra >
SmartPtr< IConstraint< TAlgebra > > ug::CompositeTimeDiscretization< TAlgebra >::constraint ( size_t  i)
virtual

returns the i'th constraint

Implements ug::IAssemble< TAlgebra >.

References UG_COND_THROW.

◆ finish_step()

template<typename TAlgebra >
void ug::CompositeTimeDiscretization< TAlgebra >::finish_step ( SmartPtr< VectorTimeSeries< vector_type > >  currSol)
virtual

finishes a time step and allows to adapt data depending on the current solution elemDisc-wise This function is called after the assembling routines at the end of a time step.

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

◆ finish_step_elem()

template<typename TAlgebra >
void ug::CompositeTimeDiscretization< TAlgebra >::finish_step_elem ( SmartPtr< VectorTimeSeries< vector_type > >  currSol,
const GridLevel gl 
)
virtual

finishes a time step and allows to adapt data depending on the current solution element-wise This function is called after the assembling routines at the end of a time step. Within this function "fsh_timestep_elem" is called which allows modifying data depending on the current solution at element-level.

Parameters
[in]currSolthe current solution
[in]ddDoF Distribution

◆ future_time()

template<typename TAlgebra >
number ug::CompositeTimeDiscretization< TAlgebra >::future_time
virtual

returns the future time point (i.e. the one that will be computed)

References UG_THROW.

◆ num_constraints()

template<typename TAlgebra >
size_t ug::CompositeTimeDiscretization< TAlgebra >::num_constraints
virtual

returns the number of constraints

Implements ug::IAssemble< TAlgebra >.

◆ num_prev_steps()

template<typename TAlgebra >
size_t ug::CompositeTimeDiscretization< TAlgebra >::num_prev_steps
virtual

returns number of previous time steps needed

◆ num_stages()

template<typename TAlgebra >
size_t ug::CompositeTimeDiscretization< TAlgebra >::num_stages
virtual

returns the number of stages

◆ prepare_step()

template<typename TAlgebra >
void ug::CompositeTimeDiscretization< 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

◆ prepare_step_elem()

template<typename TAlgebra >
void ug::CompositeTimeDiscretization< TAlgebra >::prepare_step_elem ( SmartPtr< VectorTimeSeries< vector_type > >  prevSol,
number  dt,
const GridLevel gl 
)
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. A sub-routine at element-level ("prep_timestep_elem") is called within this function.

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

◆ set_stage()

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

sets the stage

Member Data Documentation

◆ m_vTimeDisc

template<typename TAlgebra >
std::vector<SmartPtr<ITimeDiscretization<TAlgebra> > > ug::CompositeTimeDiscretization< TAlgebra >::m_vTimeDisc
protected

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