![]() |
OGS 6.2.1-710-gde5194452.dirty.20191209112531
|
Forward Euler scheme.
Definition at line 312 of file TimeDiscretization.h.
#include <TimeDiscretization.h>
Public Member Functions | |
ForwardEuler () | |
~ForwardEuler () override | |
void | setInitialState (const double t0, GlobalVector const &x0) override |
Sets the initial condition. More... | |
double | getRelativeChangeFromPreviousTimestep (GlobalVector const &x, MathLib::VecNormType norm_type) override |
void | pushState (const double, GlobalVector const &x, InternalMatrixStorage const &) override |
void | popState (GlobalVector &x) override |
void | nextTimestep (const double t, const double delta_t) override |
double | getCurrentTime () const override |
double | getCurrentTimeIncrement () const override |
GlobalVector const & | getCurrentX (const GlobalVector &) const override |
double | getNewXWeight () const override |
Returns ![]() | |
void | getWeightedOldX (GlobalVector &y) const override |
Returns ![]() | |
bool | isLinearTimeDisc () const override |
double | getDxDx () const override |
GlobalVector const & | getXOld () const |
Returns the solution from the preceding timestep. More... | |
![]() | |
TimeDiscretization ()=default | |
void | getXdot (GlobalVector const &x_at_new_timestep, GlobalVector &xdot) const |
virtual | ~TimeDiscretization ()=default |
virtual bool | needsPreload () const |
Private Attributes | |
double | _t = std::numeric_limits<double>::quiet_NaN() |
![]() | |
double | _t_old |
double | _delta_t |
the timestep size More... | |
GlobalVector & | _x_old |
the solution from the preceding timestep More... | |
Additional Inherited Members | |
![]() | |
double | computeRelativeChangeFromPreviousTimestep (GlobalVector const &x, GlobalVector const &x_old, MathLib::VecNormType norm_type) |
![]() | |
std::unique_ptr< GlobalVector > | _dx |
Used to store ![]() | |
|
inline |
Definition at line 315 of file TimeDiscretization.h.
|
inlineoverride |
Definition at line 319 of file TimeDiscretization.h.
References NumLib::GlobalVectorProvider::provider, and NumLib::VectorProvider::releaseVector().
|
inlineoverridevirtual |
Returns , i.e., the time at which the equation will be assembled.
Implements NumLib::TimeDiscretization.
Definition at line 352 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Returns , i.e., the time at which the equation will be assembled.
Implements NumLib::TimeDiscretization.
Definition at line 357 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Returns , i.e., the state at which the equation will be assembled.
This method is overridden in the ForwardEuler scheme.
Reimplemented from NumLib::TimeDiscretization.
Definition at line 359 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Returns .
The ForwardEuler scheme overrides this.
Reimplemented from NumLib::TimeDiscretization.
Definition at line 376 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Returns .
Implements NumLib::TimeDiscretization.
Definition at line 365 of file TimeDiscretization.h.
|
overridevirtual |
Get the relative change of solutions between two successive time steps by .
x | The solution at the current timestep. |
norm_type | The type of global vector norm. |
Implements NumLib::TimeDiscretization.
Definition at line 62 of file TimeDiscretization.cpp.
References NumLib::TimeDiscretization::computeRelativeChangeFromPreviousTimestep().
|
inlineoverridevirtual |
Returns .
Implements NumLib::TimeDiscretization.
Definition at line 366 of file TimeDiscretization.h.
References MathLib::LinAlg::copy(), and MathLib::LinAlg::scale().
|
inline |
Returns the solution from the preceding timestep.
Definition at line 378 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Tell whether this scheme inherently requires a nonlinear solver or not.
The ForwardEuler scheme is inherently linear in that sense, the others are not.
Reimplemented from NumLib::TimeDiscretization.
Definition at line 375 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Indicate that the computation of a new timestep is being started now.
delta_t
must not change throughout the entire time integration process! This is not checked by this code! Implements NumLib::TimeDiscretization.
Definition at line 345 of file TimeDiscretization.h.
|
inlineoverridevirtual |
Restores the given vector x to its old value. Used only for repeating of the time step with new time step size when the current time step is rejected. The restored x is only used as an initial guess for linear solver in the first Picard nonlinear iteration.
x | The solution at the current time step, which is going to be reset to its previous value. |
Implements NumLib::TimeDiscretization.
Definition at line 340 of file TimeDiscretization.h.
References MathLib::LinAlg::copy().
|
inlineoverridevirtual |
Indicate that the current timestep is done and that you will proceed to the next one.
t | The current timestep. |
x | The solution at the current timestep. |
strg | Trigger storing some internal state. Currently only used by the CrankNicolson scheme. |
Implements NumLib::TimeDiscretization.
Definition at line 334 of file TimeDiscretization.h.
References MathLib::LinAlg::copy().
|
inlineoverridevirtual |
Sets the initial condition.
Implements NumLib::TimeDiscretization.
Definition at line 324 of file TimeDiscretization.h.
References MathLib::LinAlg::copy().
|
private |
the timestep size
Definition at line 384 of file TimeDiscretization.h.
|
private |
Definition at line 380 of file TimeDiscretization.h.
|
private |
the time of the preceding timestep
Definition at line 381 of file TimeDiscretization.h.
|
private |
the solution from the preceding timestep
Definition at line 386 of file TimeDiscretization.h.