OneStepTheta< number, PDEOperator > Class Template Reference

Developer Documentation: MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator > Class Template Reference
Developer Documentation
MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator > Class Template Referencefinal

#include <one_step_theta.hpp>

Inheritance diagram for MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >:
[legend]
Collaboration diagram for MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >:
[legend]

Public Types

using VectorType = dealii::LinearAlgebra::distributed::Vector< number >
 
using BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector< number >
 

Public Member Functions

 OneStepTheta (const PDEOperator &pde_operator, const TimeIntegratorData< number > &time_integrator_data_in, const LinearSolverData< number > &linear_solver_data_in)
 
unsigned int required_solution_history_size () const override
 
void perform_time_step (const number current_time, const number time_step, SolutionHistory< VectorType > &solution_history, const std::function< void(number, number, VectorType &, const VectorType &)> &pre_processing, const std::function< void(number, number, VectorType &, const VectorType &)> &post_processing) override
 
void reinit (const VectorType &vector_template) override
 
void reinit (const SolutionHistory< VectorType > &solution_history) override
 
- Public Member Functions inherited from MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >
 TimeIntegratorBase (const TimeIntegratorData< number > &time_integrator_data_in)
 
virtual ~TimeIntegratorBase ()=default
 
TimeIntegratorSchemes get_integrator_type () const
 
void set_monitoring_vector (VectorType &monitoring_vector_in)
 
void reset_monitoring_vector ()
 

Private Attributes

number Theta_
 
number dt_
 
number old_time_
 
VectorType old_solution_
 
VectorType right_hand_side_
 
VectorType buffer
 
const PDEOperator & pde_operator
 
const LinearSolverData< number > & linear_solver_data
 

Additional Inherited Members

- Protected Attributes inherited from MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >
const TimeIntegratorData< number > time_integrator_data
 
VectorTypemonitoring_vector = nullptr
 

Member Typedef Documentation

◆ BlockVectorType

template<typename number , typename PDEOperator >
using MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::BlockVectorType = dealii::LinearAlgebra::distributed::BlockVector<number>

◆ VectorType

template<typename number , typename PDEOperator >
using MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::VectorType = dealii::LinearAlgebra::distributed::Vector<number>

Constructor & Destructor Documentation

◆ OneStepTheta()

template<typename number , typename PDEOperator >
MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::OneStepTheta ( const PDEOperator &  pde_operator,
const TimeIntegratorData< number > &  time_integrator_data_in,
const LinearSolverData< number > &  linear_solver_data_in 
)
inline

Member Function Documentation

◆ perform_time_step()

template<typename number , typename PDEOperator >
void MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::perform_time_step ( const number  current_time,
const number  time_step,
SolutionHistory< VectorType > &  solution_history,
const std::function< void(number, number, VectorType &, const VectorType &)> &  pre_processing,
const std::function< void(number, number, VectorType &, const VectorType &)> &  post_processing 
)
inlineoverridevirtual

Performs one time step according to the one-step theta method u(t+dt) = u(t) + dt*theta*F(u(t+dt)) + dt*(1-theta)*F(u(t)) So far only a linear operator is possible. This results in a linear system of equations. The right hand side of System consists of quantities known at time t, which are stored in rhs. Current solution of solution history is updated according to the solution of the linear system.

In addition, if monitoring_vector is set in the base class the right-hand-side of the resulting linear equation system is copied to the monitoring vector.

Parameters
current_timeCurrent time.
time_stepCurrent time step size.
solution_historySolution history object providing the current and all required previous solutions.
pre_processingFunction which is executed at the beginning before the actual time step computations. Three variables are passed to the function: the current time, the vector which is later used as rhs vector in the linear solver, and the current solution.
post_processingFunction which is executed at the end of the time step computation. Three variables are passed to the function: the current time after the time step, i.e. n+1, the solution vector which is then the final solution of the time step and the current solution. Note, that these to vectors are the same.
Exceptions
Thefunction throws an exception if the linear solver does not converge.

Implements MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.

◆ reinit() [1/2]

template<typename number , typename PDEOperator >
void MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::reinit ( const SolutionHistory< VectorType > &  solution_history)
inlineoverridevirtual

Sets up the necessary internal data structures by internally calling reinit(solution_history.get_current_solution()).

Reimplemented from MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.

◆ reinit() [2/2]

template<typename number , typename PDEOperator >
void MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::reinit ( const VectorType vector_template)
inlineoverridevirtual

Allocate memory for the required vectors used during the integration. This function needs to be called once before the function perform_time_step() can be called.

Parameters
vector_templateReference vector used to define the partitioning for all internal vectors.

Implements MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.

◆ required_solution_history_size()

template<typename number , typename PDEOperator >
unsigned int MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::required_solution_history_size ( ) const
inlineoverridevirtual

This function returns the number of previous solutions required. Note that a corresponding solution history must be of the size previous_solutions_required+1 to account for the current solution.

Implements MeltPoolDG::TimeIntegration::TimeIntegratorBase< number >.

Member Data Documentation

◆ buffer

template<typename number , typename PDEOperator >
VectorType MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::buffer
mutableprivate

◆ dt_

template<typename number , typename PDEOperator >
number MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::dt_
mutableprivate

◆ linear_solver_data

template<typename number , typename PDEOperator >
const LinearSolverData<number>& MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::linear_solver_data
private

◆ old_solution_

template<typename number , typename PDEOperator >
VectorType MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::old_solution_
mutableprivate

◆ old_time_

template<typename number , typename PDEOperator >
number MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::old_time_
mutableprivate

◆ pde_operator

template<typename number , typename PDEOperator >
const PDEOperator& MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::pde_operator
private

◆ right_hand_side_

template<typename number , typename PDEOperator >
VectorType MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::right_hand_side_
mutableprivate

◆ Theta_

template<typename number , typename PDEOperator >
number MeltPoolDG::TimeIntegration::OneStepTheta< number, PDEOperator >::Theta_
private

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