oomph::ExplicitTimeSteppableObject Class Reference

#include <explicit_timesteppers.h>

+ Inheritance diagram for oomph::ExplicitTimeSteppableObject:

Public Member Functions

 ExplicitTimeSteppableObject ()
 Empty constructor. More...
 
 ExplicitTimeSteppableObject (const ExplicitTimeSteppableObject &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeSteppableObject &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeSteppableObject ()
 Empty destructor. More...
 
virtual void get_dvaluesdt (DoubleVector &minv_res)
 
virtual void get_dofs (DoubleVector &dofs) const
 Function that gets the values of the dofs in the object. More...
 
virtual void get_dofs (const unsigned &t, DoubleVector &dofs) const
 Function that gets the history values of the dofs in the object. More...
 
virtual void set_dofs (const DoubleVector &dofs)
 Function that sets the values of the dofs in the object. More...
 
virtual void add_to_dofs (const double &lambda, const DoubleVector &increment_dofs)
 Function that adds the values to the dofs. More...
 
virtual void actions_before_explicit_stage ()
 
virtual void actions_after_explicit_stage ()
 
virtual void actions_before_explicit_timestep ()
 
virtual void actions_after_explicit_timestep ()
 
virtual doubletime ()
 
virtual Timetime_pt () const
 

Static Private Attributes

static double Dummy_time_value = 0.0
 Dummy value of time always set to zero. More...
 

Detailed Description

Class for objects than can be advanced in time by an Explicit Timestepper. WARNING: For explicit time stepping to work the object's residual function (as used by get_inverse_mass_matrix_times_residuals(..)) MUST be in the form r = f(t, u) - [timestepper approximation to dudt]! Standard implicit time stepping will work with plenty of residuals that don't fit into this form. Some examples where implicit time stepping will work fine but explicit will fail: 1) The negation of the above formula, this implementation will end up using dudt = - f(u,t). 2) A residual which is implicit or non-linear in dudt, such as r = dudt

  • u x dudt.

Constructor & Destructor Documentation

◆ ExplicitTimeSteppableObject() [1/2]

oomph::ExplicitTimeSteppableObject::ExplicitTimeSteppableObject ( )
inline

Empty constructor.

71 {}

◆ ExplicitTimeSteppableObject() [2/2]

oomph::ExplicitTimeSteppableObject::ExplicitTimeSteppableObject ( const ExplicitTimeSteppableObject )
delete

Broken copy constructor.

◆ ~ExplicitTimeSteppableObject()

virtual oomph::ExplicitTimeSteppableObject::~ExplicitTimeSteppableObject ( )
inlinevirtual

Empty destructor.

80 {}

Member Function Documentation

◆ actions_after_explicit_stage()

virtual void oomph::ExplicitTimeSteppableObject::actions_after_explicit_stage ( )
inlinevirtual

Empty virtual function that should be overloaded to update any dependent data or boundary conditions that should be advanced after each stage of an explicit time step (Runge-Kutta steps contain multiple stages per time step, most others only contain one).

Reimplemented in oomph::MyProblem, and TwoDDGProblem< ELEMENT >.

108 {}

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), oomph::Euler::timestep(), and oomph::EBDF3::timestep().

◆ actions_after_explicit_timestep()

virtual void oomph::ExplicitTimeSteppableObject::actions_after_explicit_timestep ( )
inlinevirtual

Empty virtual function that can be overloaded to do anything needed after an explicit step.

Reimplemented in oomph::Problem, and oomph::MyProblem.

116 {}

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), oomph::Euler::timestep(), and oomph::EBDF3::timestep().

◆ actions_before_explicit_stage()

virtual void oomph::ExplicitTimeSteppableObject::actions_before_explicit_stage ( )
inlinevirtual

Empty virtual function to do anything needed before a stage of an explicit time step (Runge-Kutta steps contain multiple stages per time step, most others only contain one).

Reimplemented in oomph::MyProblem.

102 {}

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), oomph::Euler::timestep(), and oomph::EBDF3::timestep().

◆ actions_before_explicit_timestep()

virtual void oomph::ExplicitTimeSteppableObject::actions_before_explicit_timestep ( )
inlinevirtual

Empty virtual function that can be overloaded to do anything needed before an explicit step.

Reimplemented in oomph::Problem, and oomph::MyProblem.

112 {}

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), oomph::Euler::timestep(), and oomph::EBDF3::timestep().

◆ add_to_dofs()

void oomph::ExplicitTimeSteppableObject::add_to_dofs ( const double lambda,
const DoubleVector increment_dofs 
)
virtual

Function that adds the values to the dofs.

Function that adds the lambda multiplied by the increment_dofs vector to the dofs in the object

Reimplemented in oomph::Problem.

114  {
115  std::ostringstream error_stream;
116  error_stream
117  << "Empty default function called.\n"
118  << "The function must add lambda multiplied by the contents of the\n"
119  << "input vector to the degrees of freedom in the object.\n"
120  << "Note: It is the responsibility of the object to ensure that the\n"
121  << " the degrees of freedom are in the same order as those \n"
122  << " returned by get_dvaluesdt()\n";
123 
124  throw OomphLibError(
125  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
126  }
#define OOMPH_EXCEPTION_LOCATION
Definition: oomph_definitions.h:61
#define OOMPH_CURRENT_FUNCTION
Definition: oomph_definitions.h:86

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), and oomph::Euler::timestep().

◆ get_dofs() [1/2]

void oomph::ExplicitTimeSteppableObject::get_dofs ( const unsigned t,
DoubleVector dofs 
) const
virtual

Function that gets the history values of the dofs in the object.

Function that should get the values of the dofs in the object.

Reimplemented in oomph::Problem.

79  {
80  std::ostringstream error_stream;
81  error_stream
82  << "Empty default function called.\n"
83  << "The function must return the t'th history values of the degrees of \n"
84  << "freedom in the object.\n"
85  << "Note: It is the responsibility of the object to set the size\n"
86  << "of the vector\n";
87 
88  throw OomphLibError(
90  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

◆ get_dofs() [2/2]

void oomph::ExplicitTimeSteppableObject::get_dofs ( DoubleVector dofs) const
virtual

Function that gets the values of the dofs in the object.

Function that should get the values of the dofs in the object.

Reimplemented in oomph::Problem.

61  {
62  std::ostringstream error_stream;
63  error_stream
64  << "Empty default function called.\n"
65  << "The function must return the current values of the degrees of \n"
66  << "freedom in the object.\n"
67  << "Note: It is the responsibility of the object to set the size\n"
68  << "of the vector\n";
69 
70  throw OomphLibError(
72  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), and oomph::EBDF3::timestep().

◆ get_dvaluesdt()

void oomph::ExplicitTimeSteppableObject::get_dvaluesdt ( DoubleVector minv_res)
virtual

A single virtual function that returns the residuals vector multiplied by the inverse mass matrix

Reimplemented in oomph::Problem.

42  {
43  std::ostringstream error_stream;
44  error_stream
45  << "Empty default function called.\n"
46  << "The function must return the solution x of the linear system\n"
47  << " M x = R\n"
48  << "in order for the object to be used by an ExplicitTimeStepper.\n"
49  << "NOTE: It is the responsibility of the object to set the size \n"
50  << " of the vector x\n";
51 
52 
53  throw OomphLibError(
55  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), oomph::Euler::timestep(), and oomph::EBDF3::timestep().

◆ operator=()

void oomph::ExplicitTimeSteppableObject::operator= ( const ExplicitTimeSteppableObject )
delete

Broken assignment operator.

◆ set_dofs()

void oomph::ExplicitTimeSteppableObject::set_dofs ( const DoubleVector dofs)
virtual

Function that sets the values of the dofs in the object.

Reimplemented in oomph::Problem.

96  {
97  std::ostringstream error_stream;
98  error_stream
99  << "Empty default function called.\n"
100  << "The function must set the current values of the degrees of \n"
101  << "freedom in the object.\n";
102 
103  throw OomphLibError(
104  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
105  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), and oomph::EBDF3::timestep().

◆ time()

double & oomph::ExplicitTimeSteppableObject::time ( )
virtual

Broken virtual function that should be overloaded to return access to the local time in the object

Virtual function that should be overloaded to return access to the local time in the object

Reimplemented in oomph::Problem.

133  {
134  std::ostringstream error_stream;
135  error_stream << "Empty default function called.\n"
136  << "The function must return a reference to the local time in "
137  "the object\n";
138 
139  throw OomphLibError(
140  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
141 
142  return Dummy_time_value;
143  }
static double Dummy_time_value
Dummy value of time always set to zero.
Definition: explicit_timesteppers.h:67

References Dummy_time_value, OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by SSP_RungeKutta< ORDER >::timestep(), oomph::RungeKutta< ORDER >::timestep(), oomph::LowStorageRungeKutta< ORDER >::timestep(), oomph::Euler::timestep(), and oomph::EBDF3::timestep().

◆ time_pt()

Time * oomph::ExplicitTimeSteppableObject::time_pt ( ) const
virtual

Virtual function that should be overloaded to return a pointer to a Time object.

Reimplemented in oomph::Problem.

148  {
149  std::ostringstream error_stream;
150  error_stream
151  << "Empty default function called.\n"
152  << "The function must return a pointer to an oomph-lib Time object.\n";
153  throw OomphLibError(
154  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
155 
156  return 0;
157  }

References OOMPH_CURRENT_FUNCTION, and OOMPH_EXCEPTION_LOCATION.

Referenced by oomph::EBDF3::timestep().

Member Data Documentation

◆ Dummy_time_value

double oomph::ExplicitTimeSteppableObject::Dummy_time_value = 0.0
staticprivate

Dummy value of time always set to zero.

Referenced by time().


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