|
| SinglestepTimeloop ()=default |
| no allocation More...
|
|
| SinglestepTimeloop (std::function< void(value_type, const ContainerType &, value_type &, ContainerType &, value_type)> step, value_type dt=0) |
| Construct using a std::function . More...
|
|
template<class Stepper , class ODE > |
| SinglestepTimeloop (Stepper &&stepper, ODE &&ode, value_type dt=0) |
| Bind the step function of a single step stepper. More...
|
|
template<class ... Params> |
void | construct (Params &&...ps) |
| Perfect forward parameters to one of the constructors. More...
|
|
void | set_dt (value_type dt) |
| Set the constant timestep to be used in the integrate functions. More...
|
|
void | integrate_steps (value_type t0, const container_type &u0, value_type t1, container_type &u1, unsigned steps) |
| Integrate differential equation with a fixed number of steps. More...
|
|
virtual SinglestepTimeloop * | clone () const |
| Abstract copy method that returns a copy of *this on the heap. More...
|
|
void | integrate (value_type t0, const ContainerType &u0, value_type t1, ContainerType &u1) |
| Integrate a differential equation between given bounds. More...
|
|
void | integrate (value_type &t0, const ContainerType &u0, value_type t1, ContainerType &u1, enum to mode) |
| Build your own timeloop. More...
|
|
value_type | get_dt () const |
| The current timestep. More...
|
|
virtual aTimeloop * | clone () const =0 |
| Abstract copy method that returns a copy of *this on the heap. More...
|
|
virtual | ~aTimeloop () |
|
template<class ContainerType>
struct dg::SinglestepTimeloop< ContainerType >
Integrate using a for loop and a fixed time-step.
The implementation (of integrate) is equivalent to
unsigned N = round((t1 - t0)/dt);
for( unsigned i=0; i<N; i++)
step( t0, u1, t0, u1, dt);
void copy(const ContainerTypeIn &source, ContainerTypeOut &target)
Definition: blas1.h:164
where dt
is a given constant. If t1
needs to be matched exactly, the last timestep is shortened accordingly.
- See also
- AdaptiveTimeloop, MultistepTimeloop
- Template Parameters
-
ContainerType | Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag . Among others
dg::HVec (serial), dg::DVec (cuda / omp), dg::MHVec (mpi + serial) or dg::MDVec (mpi + cuda / omp)
std::vector<dg::DVec> (vector of shared device vectors), std::array<double, 4> (array of 4 doubles) or std::map < std::string, dg::DVec> ( a map of named vectors)
double (scalar) and other primitive types ...
If there are several ContainerTypes in the argument list, then TensorTraits must exist for all of them |
- See also
- See The dg dispatch system for a detailed explanation of our type dispatch system