#include <src/args-callback/callbacks.hpp>
template<typename Operation>
StepSlice class
Template parameters | |
---|---|
Operation | Callable object. |
Contents
Create a wrapper on callable object(function pointer, functor, lambda) of which accepts one parameter. The wrapped callable object will be invoked for equal spacing steps. This class is basically used to implement equal step operation in simulations. For example, one can provide a printer [](auto&p){std::cout << p << std::endl;}
as the pre_step_operation in RunArgs to output the state of the integrated system. This printer then will be invoked before every step integration. The output might be very dense sometimes, thus outputting the result of every step is somewhat heavy. If one wraps the printer with StepSlice, ‘StepSlice([](auto&p){std::cout << p << ’
'}, 10)`, then the output will be performed every 10 steps.
Constructors, destructors, conversion operators
Public functions
- auto operator=(StepSlice const&) -> StepSlice& defaulted
- auto operator=(StepSlice&&) -> StepSlice& defaulted
-
template<typename ParticleSys>auto operator()(ParticleSys& ptc, typename ParticleSys::Scalar step_size) >>, void > -> auto
-
template<typename ParticleSys>auto operator()(ParticleSys& ptc, typename ParticleSys::Scalar step_size) >>, bool > -> auto
- void reset_slice_params(size_t step_interval)
Function documentation
template<typename Operation>
hub:: callback:: StepSlice<Operation>:: StepSlice() defaulted
Default constructor.
template<typename Operation>
hub:: callback:: StepSlice<Operation>:: StepSlice(Operation const& opt,
size_t step_interval = 1) explicit
Parameters | |
---|---|
opt in | Callable object. |
step_interval in | Step interval. |
Constructor of step slice.
template<typename Operation>
template<typename ParticleSys>
auto hub:: callback:: StepSlice<Operation>:: operator()(ParticleSys& ptc,
typename ParticleSys::Scalar step_size) >>, void >
Template parameters | |
---|---|
ParticleSys | Any type used as call back parameter. |
Parameters | |
ptc in/out | Input parameter. |
step_size in | The step size of the integration. |
Callable interface.
template<typename Operation>
template<typename ParticleSys>
auto hub:: callback:: StepSlice<Operation>:: operator()(ParticleSys& ptc,
typename ParticleSys::Scalar step_size) >>, bool >
Template parameters | |
---|---|
ParticleSys | Any type used as call back parameter. |
Parameters | |
ptc in/out | Input parameter. |
step_size in | The step size of the integration. |
Returns | auto bool. |
Callable interface.
template<typename Operation>
void hub:: callback:: StepSlice<Operation>:: reset_slice_params(size_t step_interval)
Parameters | |
---|---|
step_interval in | Step interval. |
Reset the slice parameters.