oomph::LowStorageRungeKutta< ORDER > Class Template Reference

#include <explicit_timesteppers.h>

+ Inheritance diagram for oomph::LowStorageRungeKutta< ORDER >:

Public Member Functions

 LowStorageRungeKutta ()
 Constructor, set the type. More...
 
 LowStorageRungeKutta (const LowStorageRungeKutta &)=delete
 Broken copy constructor. More...
 
void operator= (const LowStorageRungeKutta &)=delete
 Broken assignment operator. More...
 
void timestep (ExplicitTimeSteppableObject *const &object_pt, const double &dt)
 Function that is used to advance the solution by time dt. More...
 
 LowStorageRungeKutta ()
 
void timestep (ExplicitTimeSteppableObject *const &object_pt, const double &dt)
 Pure virtual function that is used to advance time in the object. More...
 
- Public Member Functions inherited from oomph::ExplicitTimeStepper
 ExplicitTimeStepper ()
 Empty Constructor. More...
 
 ExplicitTimeStepper (const ExplicitTimeStepper &)=delete
 Broken copy constructor. More...
 
void operator= (const ExplicitTimeStepper &)=delete
 Broken assignment operator. More...
 
virtual ~ExplicitTimeStepper ()
 Empty virtual destructor — no memory is allocated in this class. More...
 

Private Attributes

Vector< doubleA
 
Vector< doubleB
 
Vector< doubleC
 

Additional Inherited Members

- Protected Attributes inherited from oomph::ExplicitTimeStepper
std::string Type
 

Detailed Description

template<unsigned ORDER>
class oomph::LowStorageRungeKutta< ORDER >

=========================================================== Runge Kutta Timestepping that uses low storage

Constructor & Destructor Documentation

◆ LowStorageRungeKutta() [1/3]

template<unsigned ORDER>
oomph::LowStorageRungeKutta< ORDER >::LowStorageRungeKutta

Constructor, set the type.

328  {
329  Type = "LowStorageRungeKutta";
330  }
std::string Type
Definition: explicit_timesteppers.h:136

◆ LowStorageRungeKutta() [2/3]

template<unsigned ORDER>
oomph::LowStorageRungeKutta< ORDER >::LowStorageRungeKutta ( const LowStorageRungeKutta< ORDER > &  )
delete

Broken copy constructor.

◆ LowStorageRungeKutta() [3/3]

350  {
351  Type = "LowStorageRungeKutta";
352 
353  A.resize(5);
354  A[0] = 0.0;
355  A[1] = -567301805773.0 / 1357537059087.0;
356  A[2] = -2404267990393.0 / 2016746695238.0;
357  A[3] = -3550918686646.0 / 2091501179385.0;
358  A[4] = -1275806237668.0 / 842570457699.0;
359 
360  B.resize(5);
361  B[0] = 1432997174477.0 / 9575080441755.0;
362  B[1] = 5161836677717.0 / 13612068292357.0;
363  B[2] = 1720146321549.0 / 2090206949498.0;
364  B[3] = 3134564353537.0 / 4481467310338.0;
365  B[4] = 2277821191437.0 / 14882151754819.0;
366 
367  C.resize(5);
368  C[0] = B[0];
369  C[1] = 2526269341429.0 / 6820363962896.0;
370  C[2] = 2006345519317.0 / 3224310063776.0;
371  C[3] = 2802321613138.0 / 2924317926251.0;
372  C[4] = 1.0;
373  }
The matrix class, also used for vectors and row-vectors.
Definition: Eigen/Eigen/src/Core/Matrix.h:186
EIGEN_DEVICE_FUNC constexpr EIGEN_STRONG_INLINE void resize(Index rows, Index cols)
Definition: PlainObjectBase.h:294
Definition: matrices.h:74

References Eigen::PlainObjectBase< Derived >::resize().

Member Function Documentation

◆ operator=()

template<unsigned ORDER>
void oomph::LowStorageRungeKutta< ORDER >::operator= ( const LowStorageRungeKutta< ORDER > &  )
delete

Broken assignment operator.

◆ timestep() [1/2]

void oomph::LowStorageRungeKutta< 4 >::timestep ( ExplicitTimeSteppableObject *const &  object_pt,
const double dt 
)
virtual

Pure virtual function that is used to advance time in the object.

Implements oomph::ExplicitTimeStepper.

380  {
381  object_pt->actions_before_explicit_timestep();
382 
383  // Store the initial time
384  const double initial_time = object_pt->time();
385  // Temporary storage
386  DoubleVector k;
387 
388  // Temporary storage for the inverse mass matrix multiplied by the residuals
389  DoubleVector minv_res;
390 
391  // Loop over the number of steps in the scheme
392  for (unsigned i = 0; i < 5; i++)
393  {
394  object_pt->actions_before_explicit_stage();
395 
396  // Get the inverse mass matrix multiplied by the current value
397  // of the residuals
398  object_pt->get_dvaluesdt(minv_res);
399  // Get the values of k
400  const unsigned n_dof = minv_res.nrow();
401 
402  // First time round resize k and initialise to zero
403  if (i == 0)
404  {
405  k.build(minv_res.distribution_pt(), 0.0);
406  }
407  // Now construct the next value of k
408  for (unsigned n = 0; n < n_dof; n++)
409  {
410  k[n] *= A[i];
411  k[n] += dt * minv_res[n];
412  }
413 
414  // Add to the residuals
415  object_pt->add_to_dofs(B[i], k);
416  // Set the new time
417  object_pt->time() = initial_time + C[i] * dt;
418 
419  object_pt->actions_after_explicit_stage();
420  }
421 
422  object_pt->actions_after_explicit_timestep();
423  }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
std::vector< double > DoubleVector
loads clump configuration
Definition: ClumpInput.h:26
char char char int int * k
Definition: level2_impl.h:374

References oomph::ExplicitTimeSteppableObject::actions_after_explicit_stage(), oomph::ExplicitTimeSteppableObject::actions_after_explicit_timestep(), oomph::ExplicitTimeSteppableObject::actions_before_explicit_stage(), oomph::ExplicitTimeSteppableObject::actions_before_explicit_timestep(), oomph::ExplicitTimeSteppableObject::add_to_dofs(), oomph::DistributableLinearAlgebraObject::distribution_pt(), oomph::ExplicitTimeSteppableObject::get_dvaluesdt(), i, k, n, oomph::DistributableLinearAlgebraObject::nrow(), and oomph::ExplicitTimeSteppableObject::time().

◆ timestep() [2/2]

template<unsigned ORDER>
void oomph::LowStorageRungeKutta< ORDER >::timestep ( ExplicitTimeSteppableObject *const &  object_pt,
const double dt 
)
virtual

Function that is used to advance the solution by time dt.

Broken default timestep for LowStorageRungeKutta.

Implements oomph::ExplicitTimeStepper.

338  {
339  std::ostringstream error_stream;
340  error_stream << "Timestep not implemented for order " << ORDER << "\n";
341  throw OomphLibError(
342  error_stream.str(), OOMPH_CURRENT_FUNCTION, OOMPH_EXCEPTION_LOCATION);
343  }
#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.

Member Data Documentation

◆ A

template<unsigned ORDER>
Vector<double> oomph::LowStorageRungeKutta< ORDER >::A
private

◆ B

template<unsigned ORDER>
Vector<double> oomph::LowStorageRungeKutta< ORDER >::B
private

◆ C

template<unsigned ORDER>
Vector<double> oomph::LowStorageRungeKutta< ORDER >::C
private

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