class for collecting and calculating the energy and angular momemtum of the system
More...
#include <energy.hpp>
|
| EnergyAndMomemtum () |
|
void | clear () |
|
void | print (std::ostream &_fout=std::cout, const PS::S32 _width=16) |
| print title and values in one lines More...
|
|
void | printColumnTitle (std::ofstream &_fout, const PS::S32 _width=16) const |
| print titles of class members using column style More...
|
|
void | printColumn (std::ofstream &_fout, const PS::S32 _width=16) const |
| print data of class members using column style More...
|
|
void | writeAscii (FILE *_fout) |
|
void | writeBinary (FILE *_fout) |
|
template<class Tptcl > |
void | calc (const Tptcl *_particles, const PS::S32 _n_particle, const bool _init_flag=false, const PS::F64vec *_pos_offset=NULL, const PS::F64vec *_vel_offset=NULL) |
| calculate the system kinetic and potential energy of particles More...
|
|
template<class Tptcl > |
void | calc (const Tptcl *_particles, const PS::S32 *_particle_index, const PS::S32 _n_particle, const bool _init_flag=false) |
| calculate the system kinetic and potential energy of particles More...
|
|
void | getSumMultiNodes (const bool _init_flag=false) |
| get summation of kinetic, potential energy and angular momemtum of all MPI processes More...
|
|
void | saveEnergyError () |
| save current energy error More...
|
|
PS::F64 | getEnergyError () const |
| get energy error More...
|
|
PS::F64 | getMomentumError () const |
| get angular momemtum (value) error More...
|
|
class for collecting and calculating the energy and angular momemtum of the system
◆ EnergyAndMomemtum()
EnergyAndMomemtum::EnergyAndMomemtum |
( |
| ) |
|
|
inline |
◆ calc() [1/2]
template<class Tptcl >
void EnergyAndMomemtum::calc |
( |
const Tptcl * |
_particles, |
|
|
const PS::S32 * |
_particle_index, |
|
|
const PS::S32 |
_n_particle, |
|
|
const bool |
_init_flag = false |
|
) |
| |
|
inline |
calculate the system kinetic and potential energy of particles
Using particle index array to select particles
- Parameters
-
[in] | _particles | particle array |
[in] | _particle_index | index array to select particles |
[in] | _n_particle | number of particles |
[in] | _init_flag | if true, set etot, etot_sd and L reference |
◆ calc() [2/2]
template<class Tptcl >
void EnergyAndMomemtum::calc |
( |
const Tptcl * |
_particles, |
|
|
const PS::S32 |
_n_particle, |
|
|
const bool |
_init_flag = false , |
|
|
const PS::F64vec * |
_pos_offset = NULL , |
|
|
const PS::F64vec * |
_vel_offset = NULL |
|
) |
| |
|
inline |
calculate the system kinetic and potential energy of particles
- Parameters
-
[in] | _particles | particle array |
[in] | _n_particle | number of particles |
[in] | _init_flag | if true, set etot, etot_sd and L reference |
[in] | _vel_offset | velocity shift to calculate kinetic energy, if not given, assume it is zero |
◆ clear()
void EnergyAndMomemtum::clear |
( |
| ) |
|
|
inline |
◆ getEnergyError()
PS::F64 EnergyAndMomemtum::getEnergyError |
( |
| ) |
const |
|
inline |
◆ getMomentumError()
PS::F64 EnergyAndMomemtum::getMomentumError |
( |
| ) |
const |
|
inline |
get angular momemtum (value) error
◆ getSumMultiNodes()
void EnergyAndMomemtum::getSumMultiNodes |
( |
const bool |
_init_flag = false | ) |
|
|
inline |
get summation of kinetic, potential energy and angular momemtum of all MPI processes
- Parameters
-
[in] | _init_flag | if true, set etot, etot_sd and L reference |
◆ print()
void EnergyAndMomemtum::print |
( |
std::ostream & |
_fout = std::cout , |
|
|
const PS::S32 |
_width = 16 |
|
) |
| |
|
inline |
print title and values in one lines
print titles and values in one lines
- Parameters
-
[out] | _fout | std::ostream output object |
◆ printColumn()
void EnergyAndMomemtum::printColumn |
( |
std::ofstream & |
_fout, |
|
|
const PS::S32 |
_width = 16 |
|
) |
| const |
|
inline |
print data of class members using column style
print data of class members in one line for column style. Notice no newline is printed at the end
- Parameters
-
[out] | _fout | std::ostream output object |
[in] | _width | print width (defaulted 16) |
◆ printColumnTitle()
void EnergyAndMomemtum::printColumnTitle |
( |
std::ofstream & |
_fout, |
|
|
const PS::S32 |
_width = 16 |
|
) |
| const |
|
inline |
print titles of class members using column style
print titles of class members in one line for column style
- Parameters
-
[out] | _fout | std::ostream output object |
[in] | _width | print width (defaulted 16) |
◆ saveEnergyError()
void EnergyAndMomemtum::saveEnergyError |
( |
| ) |
|
|
inline |
save current energy error
◆ writeAscii()
void EnergyAndMomemtum::writeAscii |
( |
FILE * |
_fout | ) |
|
|
inline |
◆ writeBinary()
void EnergyAndMomemtum::writeBinary |
( |
FILE * |
_fout | ) |
|
|
inline |
◆ ekin
PS::F64 EnergyAndMomemtum::ekin |
◆ epot
PS::F64 EnergyAndMomemtum::epot |
◆ error_cum_pre
PS::F64 EnergyAndMomemtum::error_cum_pre |
◆ error_Lt_cum_pre
PS::F64 EnergyAndMomemtum::error_Lt_cum_pre |
◆ etot_ref
PS::F64 EnergyAndMomemtum::etot_ref |
PS::F64vec EnergyAndMomemtum::L |
◆ L_ref
PS::F64vec EnergyAndMomemtum::L_ref |
◆ Lt
PS::F64 EnergyAndMomemtum::Lt |
The documentation for this class was generated from the following file: