template<typename ParticleSys>
hub::RunArgs class

Template parameters
ParticleSys Any implementation of concept ParticleSystem.

Run arguments that is used to set all arguments needed by Simulator.

The pre_operations(), post_operations(), stop_operations() and check_stops() will be called in a simulation in this way.

...
auto sys; // particle system that is going to be evolved.
for( ;check_stops(sys);){
    pre_operations(sys);
    ...//step integration.
    post_operations(sys);
}
stop_operations(sys);
...

Public types

using Callback = std::function<void(ParticleSys&, Scalar)>
using StopCall = std::function<bool(ParticleSys&, Scalar)>

Public functions

void operations(ParticleSys& particle_sys, Scalar step_size) const
void stop_operations(ParticleSys& particle_sys, Scalar step_size) const
void start_operations(ParticleSys& particle_sys, Scalar step_size) const
auto check_stops(ParticleSys& particle_sys, Scalar step_size) const -> bool
template<typename Func, typename... Args>
void add_operation(Func func, Args && ... args)
template<typename Func, typename... Args>
void add_stop_point_operation(Func func, Args && ... args)
template<typename Func, typename... Args>
void add_start_point_operation(Func func, Args && ... args)
template<typename Func, typename... Args>
void add_stop_condition(Func func, Args && ... args)
void add_stop_condition(Scalar end)
auto is_end_time_set() const -> bool
auto is_stop_condition_set() const -> bool

Public variables

Scalar step_size
Scalar end_time
Scalar atol
Scalar rtol

Typedef documentation

template<typename ParticleSys>
using hub::RunArgs<ParticleSys>::Callback = std::function<void(ParticleSys&, Scalar)>

Callback function type for pre-operation, pos-operation and stop operation.

template<typename ParticleSys>
using hub::RunArgs<ParticleSys>::StopCall = std::function<bool(ParticleSys&, Scalar)>

Callback function type for stop condition.

Function documentation

template<typename ParticleSys>
void hub::RunArgs<ParticleSys>::operations(ParticleSys& particle_sys, Scalar step_size) const

Parameters
particle_sys in/out The particle system that is going to be operated.
step_size in The current step size.

Call the all registered operation functions by sequence.

template<typename ParticleSys>
void hub::RunArgs<ParticleSys>::stop_operations(ParticleSys& particle_sys, Scalar step_size) const

Parameters
particle_sys in/out The particle system that is going to be operated.
step_size in The current step size.

Call the all registered stop-operation functions by sequence.

template<typename ParticleSys>
void hub::RunArgs<ParticleSys>::start_operations(ParticleSys& particle_sys, Scalar step_size) const

Parameters
particle_sys in/out The particle system that is going to be operated.
step_size in The current step size.

Call the all registered start-operation functions by sequence.

template<typename ParticleSys>
bool hub::RunArgs<ParticleSys>::check_stops(ParticleSys& particle_sys, Scalar step_size) const

Parameters
particle_sys in The particle system that is going to be checked
step_size in The current step size.

Check the all registered stop condition functions by sequence. If any of them is satisfied, return true.

template<typename ParticleSys> template<typename Func, typename... Args>
void hub::RunArgs<ParticleSys>::add_operation(Func func, Args && ... args)

Template parameters
Func Callable type that is convertible to member type Callback.
Args Type of the binding arguments.
Parameters
func in Callable object.
args in Binding arguments.If func accepts more than one arguments, you can bind the rest arguments here.

Register a callable object(function pointer, functor, lambda,etc...) to start point and every post-step.

template<typename ParticleSys> template<typename Func, typename... Args>
void hub::RunArgs<ParticleSys>::add_stop_point_operation(Func func, Args && ... args)

Template parameters
Func Callable type that is convertible to member type Callback.
Args Type of the binding arguments.
Parameters
func in Callable object.
args in Binding arguments. If func accepts more than one arguments, you can bind the rest arguments here.

Register a callable object(function pointer, functor, lambda,etc...) to stop-point-operations.

template<typename ParticleSys> template<typename Func, typename... Args>
void hub::RunArgs<ParticleSys>::add_start_point_operation(Func func, Args && ... args)

Template parameters
Func Callable type that is convertible to member type Callback.
Args Type of the binding arguments.
Parameters
func in Callable object.
args in Binding arguments. If func accepts more than one arguments, you can bind the rest arguments here.

Register a callable object(function pointer, functor, lambda,etc...) to start-point-operations.

template<typename ParticleSys> template<typename Func, typename... Args>
void hub::RunArgs<ParticleSys>::add_stop_condition(Func func, Args && ... args)

Template parameters
Func Callable type that is convertible to member type Stopback.
Args Type of the binding arguments.
Parameters
func in Callable object.
args in Binding arguments. If func accepts more than one arguments, you can bind the rest arguments here.

Register a callable object(function pointer, functor, lambda,etc...) to stop conditions.

template<typename ParticleSys>
void hub::RunArgs<ParticleSys>::add_stop_condition(Scalar end)

Parameters
end in Duration time of the integration.

Add the duration time of the integration as a stop condition.

template<typename ParticleSys>
bool hub::RunArgs<ParticleSys>::is_end_time_set() const

Returns boolean

Check if the integration duration time is set.

template<typename ParticleSys>
bool hub::RunArgs<ParticleSys>::is_stop_condition_set() const

Returns boolean

Check if any of the stop condition(except the duration time) is set.

Variable documentation

template<typename ParticleSys>
Scalar hub::RunArgs<ParticleSys>::step_size

Initial step size for the integration of the Simulator.

template<typename ParticleSys>
Scalar hub::RunArgs<ParticleSys>::end_time

The time duration for the integration of the Simulator.

template<typename ParticleSys>
Scalar hub::RunArgs<ParticleSys>::atol

The absolute error tolerance.

template<typename ParticleSys>
Scalar hub::RunArgs<ParticleSys>::rtol

The relative error tolerance.