GraviDy  1.0
Gravitational Dynamics N-body integrator
Public Member Functions | Public Attributes | List of all members
Hermite4MPI Class Reference

Class which implements on the MPI the structure of the Hermite4 scheme. More...

#include <Hermite4MPI.hpp>

Inheritance diagram for Hermite4MPI:
Inheritance graph
[legend]
Collaboration diagram for Hermite4MPI:
Collaboration graph
[legend]

Public Member Functions

 Hermite4MPI (NbodySystem *ns, Logger *logger, NbodyUtils *nu, int rank, int nproc)
 Constructor that uses its parent one. More...
 
 ~Hermite4MPI ()
 Destructor that free memory of two tmp arrays. More...
 
void alloc_slaves_memory (int rank)
 Method in charge of allocating the memory and initializing the data for all the data structures in all the slaves. More...
 
void force_calculation (Predictor pi, Predictor pj, Forces &fi)
 Method that calculate the gravitational interaction between two particles. More...
 
void init_acc_jrk ()
 Method that initializes the acceleration and it first derivative. More...
 
void update_acc_jrk (unsigned int nact)
 Method that call the force_calculation method for every $i-$ and $j$ particles interaction of the $N_{act}$ ones. More...
 
void predicted_pos_vel (double ITIME)
 Method that predict all the particles to the current integration time. More...
 
void correction_pos_vel (double ITIME, unsigned int nact)
 Method that correct the positions and velocities of the particles at the end of every integration step. More...
 
void integration ()
 Integration virtual method to be implemented. More...
 
- Public Member Functions inherited from Hermite4
 Hermite4 (NbodySystem *ns, Logger *logger, NbodyUtils *nu)
 Constructor in charge of calling the allocation and initialization methods. More...
 
 ~Hermite4 ()
 Destructor in charge of calling the method that free the memory. More...
 
unsigned int find_particles_to_move (double ITIME)
 Method in charge of finding all the particles that need to be updated on the following integration step. More...
 
void next_integration_time (double &ATIME)
 Methods that look for the next integration time, looking for the minimum combination of timestep and current time of all the particles of the system. More...
 
void init_dt (double &ATIME, float ETA, double ITIME)
 Initialization of the timesteps of the system. More...
 
void save_old_acc_jrk (unsigned int nact)
 Method in charge of saving the old values of the acceleration and its first derivative to be use in the Corrector integration step. More...
 
void alloc_arrays_host ()
 Method in charge of the memory allocation of all the data structures. More...
 
void free_arrays_host ()
 Method in charge of the memory deallocation of all the data structures. More...
 
void init_data ()
 Method that initialize all the data structures that will be used in the integration of hte system. More...
 
virtual void predicted_pos_vel (double itime, double *t, double4 *r, double4 *v, Forces *f, Predictor *p)
 Prediction virtual method to be implemented. More...
 
virtual void correction_pos_vel (double itime, unsigned int nact, double *dt, double *t, unsigned int *move, Predictor *p, Forces *f, Forces *old, double3 *a2, double3 *a3, double4 *r, double4 *v)
 Correction virtual method to be implemented. More...
 
virtual void init_acc_jrk (Predictor *p, Forces *f)
 Force initialization virtual method to be implemented. More...
 
virtual void update_acc_jrk (unsigned int nact, unsigned int *move, Predictor *p, Forces *f)
 Force update virtual method to be implemented. More...
 

Public Attributes

int rank
 
int nproc
 
int tag
 
MPI_Status status
 
MPI_Datatype f_type
 
MPI_Op f_op
 
unsigned int chunk_size
 
unsigned int chunk_begin
 
unsigned int chunk_end
 
Forcestmp_f
 
- Public Attributes inherited from Hermite4
NbodySystemns
 NbodySystem object reference. More...
 
Loggerlogger
 Logger object reference. More...
 
NbodyUtilsnu
 NbodyUtils object reference. More...
 

Detailed Description

Class which implements on the MPI the structure of the Hermite4 scheme.

This contains all the implementations of the requirements processes to perform the integration, like the initialization of the forces, the prediction, the correction, and the general integration of the system.

Please note that this class uses the variable MPI_NUM_SLAVES to set an upper limit for the amount of slaves that can be use.

Constructor & Destructor Documentation

§ Hermite4MPI()

Hermite4MPI::Hermite4MPI ( NbodySystem ns,
Logger logger,
NbodyUtils nu,
int  rank,
int  nproc 
)

Constructor that uses its parent one.

Additionally, this method allocates and initialize the memory on each slave, defining before the size of the data to be transfer.

§ ~Hermite4MPI()

Hermite4MPI::~Hermite4MPI ( )

Destructor that free memory of two tmp arrays.

Member Function Documentation

§ alloc_slaves_memory()

void Hermite4MPI::alloc_slaves_memory ( int  rank)

Method in charge of allocating the memory and initializing the data for all the data structures in all the slaves.

§ correction_pos_vel()

void Hermite4MPI::correction_pos_vel ( double  ITIME,
unsigned int  nact 
)

Method that correct the positions and velocities of the particles at the end of every integration step.

§ force_calculation()

void Hermite4MPI::force_calculation ( Predictor  pi,
Predictor  pj,
Forces fi 
)
virtual

Method that calculate the gravitational interaction between two particles.

Reimplemented from Hermite4.

§ init_acc_jrk()

void Hermite4MPI::init_acc_jrk ( )

Method that initializes the acceleration and it first derivative.

§ integration()

void Hermite4MPI::integration ( )
virtual

Integration virtual method to be implemented.

Reimplemented from Hermite4.

§ predicted_pos_vel()

void Hermite4MPI::predicted_pos_vel ( double  ITIME)

Method that predict all the particles to the current integration time.

§ update_acc_jrk()

void Hermite4MPI::update_acc_jrk ( unsigned int  nact)

Method that call the force_calculation method for every $i-$ and $j$ particles interaction of the $N_{act}$ ones.

Member Data Documentation

§ chunk_begin

unsigned int Hermite4MPI::chunk_begin

§ chunk_end

unsigned int Hermite4MPI::chunk_end

§ chunk_size

unsigned int Hermite4MPI::chunk_size

§ f_op

MPI_Op Hermite4MPI::f_op

§ f_type

MPI_Datatype Hermite4MPI::f_type

§ nproc

int Hermite4MPI::nproc

§ rank

int Hermite4MPI::rank

§ status

MPI_Status Hermite4MPI::status

§ tag

int Hermite4MPI::tag

§ tmp_f

Forces* Hermite4MPI::tmp_f

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