MFEM v4.8.0
Finite element discretization library
Loading...
Searching...
No Matches
mfem::SecondOrderODESolver Class Referenceabstract

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

#include <ode.hpp>

Inheritance diagram for mfem::SecondOrderODESolver:
[legend]
Collaboration diagram for mfem::SecondOrderODESolver:
[legend]

Public Member Functions

 SecondOrderODESolver ()
 
virtual void Init (SecondOrderTimeDependentOperator &f)
 Associate a TimeDependentOperator with the ODE solver.
 
virtual void Step (Vector &x, Vector &dxdt, real_t &t, real_t &dt)=0
 Perform a time step from time t [in] to time t [out] based on the requested step size dt [in].
 
void EulerStep (Vector &x, Vector &dxdt, real_t &t, real_t &dt)
 
void MidPointStep (Vector &x, Vector &dxdt, real_t &t, real_t &dt)
 
virtual void Run (Vector &x, Vector &dxdt, real_t &t, real_t &dt, real_t tf)
 Perform time integration from time t [in] to time tf [in].
 
ODEStateDataGetState ()
 Functions for getting the state vectors.
 
const ODEStateDataGetState () const
 
int GetStateSize ()
 Returns how many State vectors the ODE requires.
 
virtual ~SecondOrderODESolver ()
 

Static Public Member Functions

static MFEM_EXPORT SecondOrderODESolverSelect (const int ode_solver_type)
 Function selecting the desired SecondOrderODESolver.
 

Static Public Attributes

static MFEM_EXPORT std::string Types
 Help info for SecondOrderODESolver options.
 

Protected Attributes

SecondOrderTimeDependentOperatorf
 Pointer to the associated TimeDependentOperator.
 
MemoryType mem_type
 
ODEStateDataVector state
 

Detailed Description

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

Definition at line 704 of file ode.hpp.

Constructor & Destructor Documentation

◆ SecondOrderODESolver()

mfem::SecondOrderODESolver::SecondOrderODESolver ( )
inline

Definition at line 713 of file ode.hpp.

◆ ~SecondOrderODESolver()

virtual mfem::SecondOrderODESolver::~SecondOrderODESolver ( )
inlinevirtual

Definition at line 801 of file ode.hpp.

Member Function Documentation

◆ EulerStep()

void mfem::SecondOrderODESolver::EulerStep ( Vector & x,
Vector & dxdt,
real_t & t,
real_t & dt )

Definition at line 1091 of file ode.cpp.

◆ GetState() [1/2]

ODEStateData & mfem::SecondOrderODESolver::GetState ( )
inline

Functions for getting the state vectors.

Definition at line 789 of file ode.hpp.

◆ GetState() [2/2]

const ODEStateData & mfem::SecondOrderODESolver::GetState ( ) const
inline

Definition at line 790 of file ode.hpp.

◆ GetStateSize()

int mfem::SecondOrderODESolver::GetStateSize ( )
inline

Returns how many State vectors the ODE requires.

Definition at line 793 of file ode.hpp.

◆ Init()

void mfem::SecondOrderODESolver::Init ( SecondOrderTimeDependentOperator & f)
virtual

Associate a TimeDependentOperator with the ODE solver.

This method has to be called:

Reimplemented in mfem::GeneralizedAlpha2Solver.

Definition at line 1119 of file ode.cpp.

◆ MidPointStep()

void mfem::SecondOrderODESolver::MidPointStep ( Vector & x,
Vector & dxdt,
real_t & t,
real_t & dt )

Definition at line 1105 of file ode.cpp.

◆ Run()

virtual void mfem::SecondOrderODESolver::Run ( Vector & x,
Vector & dxdt,
real_t & t,
real_t & dt,
real_t tf )
inlinevirtual

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

Parameters
[in,out]xApproximate solution.
[in,out]dxdtApproximate rate.
[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 dxdt [in] is the approximate rate 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].

Definition at line 783 of file ode.hpp.

◆ Select()

SecondOrderODESolver * mfem::SecondOrderODESolver::Select ( const int ode_solver_type)
static

Function selecting the desired SecondOrderODESolver.

Definition at line 1061 of file ode.cpp.

◆ Step()

virtual void mfem::SecondOrderODESolver::Step ( Vector & x,
Vector & dxdt,
real_t & t,
real_t & 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]dxdtApproximate rate.
[in,out]tTime associated with the approximate solution x and rate @ dxdt
[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 dxdt [in] is the approximate rate 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 dxdt [out] is the approximate rate 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::GeneralizedAlpha2Solver, and mfem::NewmarkSolver.

Member Data Documentation

◆ f

SecondOrderTimeDependentOperator* mfem::SecondOrderODESolver::f
protected

Pointer to the associated TimeDependentOperator.

Definition at line 708 of file ode.hpp.

◆ mem_type

MemoryType mfem::SecondOrderODESolver::mem_type
protected

Definition at line 709 of file ode.hpp.

◆ state

ODEStateDataVector mfem::SecondOrderODESolver::state
protected

Definition at line 710 of file ode.hpp.

◆ Types

std::string mfem::SecondOrderODESolver::Types
static
Initial value:
=
"ODE solver: \n\t"
" [0--10] - GeneralizedAlpha(0.1 * s),\n\t"
" 11 - Average Acceleration, 12 - Linear Acceleration\n\t"
" 13 - CentralDifference, 14 - FoxGoodwin"

Help info for SecondOrderODESolver options.

Definition at line 796 of file ode.hpp.


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