Swarm-NG  1.1
swarm::cpu::hermite_cpu< Monitor > Class Template Reference

CPU implementation of PEC2 Hermite integrator. More...

#include <hermite_cpu.hpp>

Inheritance diagram for swarm::cpu::hermite_cpu< Monitor >:
swarm::integrator

Public Member Functions

 hermite_cpu (const config &cfg)
 Construct for hermite_cpu class.
 
virtual void launch_integrator ()
 Integrater implementation provided by derived instance.
 
void calcForces (ensemble::SystemRef &sys, double acc[][3], double jerk[][3])
 Calculate the force field. More...
 
void integrate_system (ensemble::SystemRef sys)
 Integrate ensembles. More...
 
- Public Member Functions inherited from swarm::integrator
 integrator (const config &cfg)
 Inetgrator class should be configurable. Derived instances should also have a constructor with similar signature and pass on the config parameter.
 
virtual void integrate ()
 Interfaces function to integrate, for use by general user. More...
 
virtual void flush_log ()
 Flush the host log.
 
virtual defaultEnsembleget_ensemble ()
 Access the ensemble subject to integration.
 
virtual void set_ensemble (defaultEnsemble &ens)
 Set the ensemble subject to integration.
 
virtual void set_destination_time (const double &destination_time)
 Set the time marker to end the integration.
 
virtual void set_log_manager (log::Pmanager &l)
 accessor function to set the manager for log output
 

Static Public Member Functions

static double inner_product (const double a[3], const double b[3])
 defines inner product of two arrays
 
- Static Public Member Functions inherited from swarm::integrator
static shared_ptr< integratorcreate (const config &cfg)
 Loads an integrator using the plugin system. More...
 

Additional Inherited Members

- Static Public Attributes inherited from swarm::integrator
static const int _default_max_iterations = 10000000
 Default value for maximum number of iterations. c.f. _max_iterations.
 
static const int _default_max_attempts = 1000000
 Default value for maximum number of attempts. c.f. _max_attempts.
 
- Protected Attributes inherited from swarm::integrator
defaultEnsemble _ens
 ensemble to be integrated
 
double _destination_time
 the timestamp at which the integration should finish
 
log::Pmanager _logman
 log manager for log output, set to manager::default() by default
 
gpulog::host_log * _log
 log object, obtained from log manager
 
int _max_iterations
 Maximum number of iterations per each integration step. c.f. integrate for usage.
 
int _max_attempts
 Maximum number of attempts to complete the integration. c.f. integrate for usage.
 

Detailed Description

template<class Monitor>
class swarm::cpu::hermite_cpu< Monitor >

CPU implementation of PEC2 Hermite integrator.

This is used as a reference implementation to test other GPU implementations of other integrators

This integrator can be used as an example of CPU integrator

Definition at line 46 of file hermite_cpu.hpp.

Member Function Documentation

template<class Monitor >
void swarm::cpu::hermite_cpu< Monitor >::calcForces ( ensemble::SystemRef &  sys,
double  acc[][3],
double  jerk[][3] 
)
inline

Calculate the force field.

Clear acc and jerk

Loop through all pairs

Calculated the magnitude

Update acc/jerk for i

Update acc/jerk for j

Definition at line 74 of file hermite_cpu.hpp.

References peyton::constants::c, and swarm::cpu::hermite_cpu< Monitor >::inner_product().

Referenced by swarm::cpu::hermite_cpu< Monitor >::integrate_system().

template<class Monitor >
void swarm::cpu::hermite_cpu< Monitor >::integrate_system ( ensemble::SystemRef  sys)
inline

Integrate ensembles.

Predict

Copy positions

Integrate, Round one

Integrate, Round two

Definition at line 115 of file hermite_cpu.hpp.

References swarm::integrator::_destination_time, swarm::integrator::_log, swarm::integrator::_max_iterations, peyton::constants::c, and swarm::cpu::hermite_cpu< Monitor >::calcForces().

Referenced by swarm::cpu::hermite_cpu< Monitor >::launch_integrator().


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