MFEM  v4.0
Finite element discretization library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Attributes | List of all members
mfem::ODESolver Class Referenceabstract

Abstract class for solving systems of ODEs: dx/dt = f(x,t) More...

#include <ode.hpp>

Inherited by mfem::ARKODESolver, mfem::BackwardEulerSolver, mfem::CVODESolver, mfem::ExplicitRKSolver, mfem::ForwardEulerSolver, mfem::GeneralizedAlphaSolver, mfem::ImplicitMidpointSolver, mfem::PetscODESolver, mfem::RK2Solver, mfem::RK3SSPSolver, mfem::RK4Solver, mfem::SDIRK23Solver, mfem::SDIRK33Solver, and mfem::SDIRK34Solver.

Collaboration diagram for mfem::ODESolver:
[legend]

Public Member Functions

 ODESolver ()
 
virtual void Init (TimeDependentOperator &f)
 Associate a TimeDependentOperator with the ODE solver. More...
 
virtual void Step (Vector &x, double &t, double &dt)=0
 Perform a time step from time t [in] to time t [out] based on the requested step size dt [in]. More...
 
virtual void Run (Vector &x, double &t, double &dt, double tf)
 Perform time integration from time t [in] to time tf [in]. More...
 
virtual ~ODESolver ()
 

Protected Attributes

TimeDependentOperatorf
 Pointer to the associated TimeDependentOperator. More...
 
MemoryType mem_type
 

Detailed Description

Abstract class for solving systems of ODEs: dx/dt = f(x,t)

Definition at line 22 of file ode.hpp.

Constructor & Destructor Documentation

mfem::ODESolver::ODESolver ( )
inline

Definition at line 30 of file ode.hpp.

virtual mfem::ODESolver::~ODESolver ( )
inlinevirtual

Definition at line 94 of file ode.hpp.

Member Function Documentation

void mfem::ODESolver::Init ( TimeDependentOperator f)
virtual

Associate a TimeDependentOperator with the ODE solver.

This method has to be called:

Reimplemented in mfem::PetscODESolver, mfem::GeneralizedAlphaSolver, mfem::ARKODESolver, mfem::SDIRK33Solver, mfem::SDIRK34Solver, mfem::SDIRK23Solver, mfem::ImplicitMidpointSolver, mfem::BackwardEulerSolver, mfem::CVODESolver, mfem::ExplicitRKSolver, mfem::RK4Solver, mfem::RK3SSPSolver, mfem::RK2Solver, and mfem::ForwardEulerSolver.

Definition at line 18 of file ode.cpp.

virtual void mfem::ODESolver::Run ( Vector x,
double &  t,
double &  dt,
double  tf 
)
inlinevirtual

Perform time integration from time t [in] to time tf [in].

Parameters
[in,out]xApproximate solution.
[in,out]tTime associated with the approximate solution x.
[in,out]dtTime step size.
[in]tfRequested final time.

The default implementation makes consecutive calls to Step() until reaching tf. The following rules describe the common behavior of the method:

  • The input x [in] is the approximate solution for the input time t [in].
  • The input dt [in] is the initial time step size.
  • The output dt [out] is the last time step taken by the method which may be smaller or larger than the input dt [in] value, e.g. because of time step control.
  • The output value of t [out] is not smaller than tf [in].

Reimplemented in mfem::PetscODESolver.

Definition at line 89 of file ode.hpp.

virtual void mfem::ODESolver::Step ( Vector x,
double &  t,
double &  dt 
)
pure virtual

Perform a time step from time t [in] to time t [out] based on the requested step size dt [in].

Parameters
[in,out]xApproximate solution.
[in,out]tTime associated with the approximate solution x.
[in,out]dtTime step size.

The following rules describe the common behavior of the method:

  • The input x [in] is the approximate solution for the input time t [in].
  • The input dt [in] is the desired time step size, defining the desired target time: t [target] = t [in] + dt [in].
  • The output x [out] is the approximate solution for the output time t [out].
  • The output dt [out] is the last time step taken by the method which may be smaller or larger than the input dt [in] value, e.g. because of time step control.
  • The method may perform more than one time step internally; in this case dt [out] is the last internal time step size.
  • The output value of t [out] may be smaller or larger than t [target], however, it is not smaller than t [in] + dt [out], if at least one internal time step was performed.
  • The value x [out] may be obtained by interpolation using internally stored data.
  • In some cases, the contents of x [in] may not be used, e.g. when x [out] from a previous Step() call was obtained by interpolation.
  • In consecutive calls to this method, the output t [out] of one Step() call has to be the same as the input t [in] to the next Step() call.
  • If the previous rule has to be broken, e.g. to restart a time stepping sequence, then the ODE solver must be re-initialized by calling Init() between the two Step() calls.

Implemented in mfem::PetscODESolver, mfem::GeneralizedAlphaSolver, mfem::ARKODESolver, mfem::SDIRK33Solver, mfem::SDIRK34Solver, mfem::SDIRK23Solver, mfem::ImplicitMidpointSolver, mfem::BackwardEulerSolver, mfem::CVODESolver, mfem::ExplicitRKSolver, mfem::RK4Solver, mfem::RK3SSPSolver, mfem::RK2Solver, and mfem::ForwardEulerSolver.

Member Data Documentation

TimeDependentOperator* mfem::ODESolver::f
protected

Pointer to the associated TimeDependentOperator.

Definition at line 26 of file ode.hpp.

MemoryType mfem::ODESolver::mem_type
protected

Definition at line 27 of file ode.hpp.


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