Triumvirate C++ API 0.5.0
Three-point clustering measurements in large-scale structure analyses.
Loading...
Searching...
No Matches
trv::ParticleCatalogue Class Reference

Particle catalogue. More...

#include <particles.hpp>

+ Collaboration diagram for trv::ParticleCatalogue:

Public Member Functions

 ParticleCatalogue (int verbose=-1)
 Construct the particle catalogue with initial values.
 
 ~ParticleCatalogue ()
 Destruct the particle catalogue.
 
void initialise_particles (const int num)
 Initialise particle data container.
 
void finalise_particles ()
 Finalise particle data container.
 
void reset_particles ()
 Reset particle data container.
 
ParticleDataoperator[] (const int pid)
 Return individual particle information.
 
int load_catalogue_file (const std::string &catalogue_filepath, const std::string &catalogue_columns, double volume=0.)
 Read in a catalogue file.
 
int load_particle_data (std::vector< double > x, std::vector< double > y, std::vector< double > z, std::vector< double > nz, std::vector< double > ws, std::vector< double > wc)
 Read in particle data.
 
void calc_total_weights ()
 Calculate total overall weight of particles.
 
void calc_pos_extents (bool init=true)
 Calculate the extents of particle positions.
 
void offset_coords (const double dpos[3])
 Offset particle positions by a given vector.
 
void offset_coords_for_periodicity (const double boxsize[3])
 Offset particle positions for periodic boundary conditions.
 

Static Public Member Functions

static void centre_in_box (ParticleCatalogue &catalogue, const double boxsize[3])
 Centre a catalogue in a box.
 
static void centre_in_box (ParticleCatalogue &catalogue, ParticleCatalogue &catalogue_ref, const double boxsize[3])
 Centre a pair of catalogues in a box.
 
static void pad_in_box (ParticleCatalogue &catalogue, const double boxsize[3], const double boxsize_pad[3])
 Pad a catalogue in a box.
 
static void pad_in_box (ParticleCatalogue &catalogue, ParticleCatalogue &catalogue_ref, const double boxsize[3], const double boxsize_pad[3])
 Pad a pair of catalogues in a box.
 
static void pad_grids (ParticleCatalogue &catalogue, const double boxsize[3], const int ngrid[3], const double ngrid_pad[3])
 Pad a catalogue in a box.
 
static void pad_grids (ParticleCatalogue &catalogue, ParticleCatalogue &catalogue_ref, const double boxsize[3], const int ngrid[3], const double ngrid_pad[3])
 Pad a catalogue in a box.
 

Public Attributes

std::string source
 catalogue source
 
ParticleDatapdata
 particle data
 
int ntotal
 total number of particles
 
double wtotal
 total overall weight of particles
 
double wstotal
 total sample weight of particles
 
double pos_min [3]
 minimum values of particle coordinates
 
double pos_max [3]
 maximum values of particle coordinates
 
double pos_span [3]
 span of particle coordinates
 

Detailed Description

Particle catalogue.

The catalogue object contains particle data and summary information, as well as methods for computing its attributes.

Definition at line 68 of file particles.hpp.

Constructor & Destructor Documentation

◆ ParticleCatalogue()

trv::ParticleCatalogue::ParticleCatalogue ( int verbose = -1)
explicit

Construct the particle catalogue with initial values.

Parameters
verboseLogger verbosity (default is -1 for no change).
Note
verbose is optional and used to control the logging level when an instance is created as a standalone without ParameterSet .

Definition at line 37 of file particles.cpp.

+ Here is the call graph for this function:

◆ ~ParticleCatalogue()

trv::ParticleCatalogue::~ParticleCatalogue ( )

Destruct the particle catalogue.

Definition at line 54 of file particles.cpp.

+ Here is the call graph for this function:

Member Function Documentation

◆ initialise_particles()

void trv::ParticleCatalogue::initialise_particles ( const int num)

Initialise particle data container.

Attention
This method does not set the values of trv::ParticleCatalogue::pdata, trv::ParticleCatalogue::wtotal, trv::ParticleCatalogue::wstotal, trv::ParticleCatalogue::pos_min or trv::ParticleCatalogue::pos_max, or trv::ParticleCatalogue::pos_span.
Parameters
numNumber of data units (i.e. particles).

Definition at line 56 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finalise_particles()

void trv::ParticleCatalogue::finalise_particles ( )

Finalise particle data container.

Definition at line 77 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ reset_particles()

void trv::ParticleCatalogue::reset_particles ( )

Reset particle data container.

This is an explicit method to free the resources occupied by trv::ParticleCatalogue::pdata and may be called outside the class destructor.

Definition at line 81 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator[]()

ParticleData & trv::ParticleCatalogue::operator[] ( const int pid)

Return individual particle information.

Parameters
pidParticle index.
Returns
Individual particle data.

Definition at line 94 of file particles.cpp.

◆ load_catalogue_file()

int trv::ParticleCatalogue::load_catalogue_file ( const std::string & catalogue_filepath,
const std::string & catalogue_columns,
double volume = 0. )

Read in a catalogue file.

Parameters
catalogue_filepathCatalogue file path.
catalogue_columnsCatalogue data column names (comma-separated without space).
volumeCatalogue volume (default is 0.) used for computing the default 'nz' value when the field is missing.
Returns
Exit status.

Definition at line 103 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ load_particle_data()

int trv::ParticleCatalogue::load_particle_data ( std::vector< double > x,
std::vector< double > y,
std::vector< double > z,
std::vector< double > nz,
std::vector< double > ws,
std::vector< double > wc )

Read in particle data.

Parameters
x,y,z,nz,ws,wcParticle data by column.
Returns
Exit status.

Definition at line 266 of file particles.cpp.

+ Here is the call graph for this function:

◆ calc_total_weights()

void trv::ParticleCatalogue::calc_total_weights ( )

Calculate total overall weight of particles.

Attention
This method resets trv::ParticleCatalogue::wtotal and trv::ParticleCatalogue::wstotal.

Definition at line 323 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ calc_pos_extents()

void trv::ParticleCatalogue::calc_pos_extents ( bool init = true)

Calculate the extents of particle positions.

Parameters
initInitialisation flag (default is true).
Attention
This method resets trv::ParticleCatalogue::pos_min, trv::ParticleCatalogue::pos_max and trv::ParticleCatalogue::pos_span.

Definition at line 357 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ offset_coords()

void trv::ParticleCatalogue::offset_coords ( const double dpos[3])

Offset particle positions by a given vector.

The position specified by the input vector is the new origin.

Parameters
dpos(Subtractive) offset position vector.

Definition at line 411 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ offset_coords_for_periodicity()

void trv::ParticleCatalogue::offset_coords_for_periodicity ( const double boxsize[3])

Offset particle positions for periodic boundary conditions.

Parameters
boxsizePeriodic box size in each dimension.

Definition at line 431 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ centre_in_box() [1/2]

void trv::ParticleCatalogue::centre_in_box ( ParticleCatalogue & catalogue,
const double boxsize[3] )
static

Centre a catalogue in a box.

Parameters
catalogueParticle catalogue.
boxsizeBox size in each dimension.

Definition at line 454 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ centre_in_box() [2/2]

void trv::ParticleCatalogue::centre_in_box ( ParticleCatalogue & catalogue,
ParticleCatalogue & catalogue_ref,
const double boxsize[3] )
static

Centre a pair of catalogues in a box.

The secondary catalogue's centre is used as the reference point to also offset the primary catalogue's particle positions.

Parameters
cataloguePrimary particle catalogue.
catalogue_refSecondary reference particle catalogue.
boxsizeBox size in each dimension.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 485 of file particles.cpp.

+ Here is the call graph for this function:

◆ pad_in_box() [1/2]

void trv::ParticleCatalogue::pad_in_box ( ParticleCatalogue & catalogue,
const double boxsize[3],
const double boxsize_pad[3] )
static

Pad a catalogue in a box.

The amount of padding is a fraction of the box size.

Parameters
catalogueParticle catalogue.
boxsizeBox size in each dimension.
boxsize_padBox size padding factor in each dimension.

Definition at line 533 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pad_in_box() [2/2]

void trv::ParticleCatalogue::pad_in_box ( ParticleCatalogue & catalogue,
ParticleCatalogue & catalogue_ref,
const double boxsize[3],
const double boxsize_pad[3] )
static

Pad a pair of catalogues in a box.

The amount of padding is a fraction of the box size.

The secondary catalogue's extents are used as the reference points to also offset the primary catalogue's particle positions.

Parameters
cataloguePrimary particle catalogue.
catalogue_refSecondary reference particle catalogue.
boxsizeBox size in each dimension.
boxsize_padBox size padding factor in each dimension.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 562 of file particles.cpp.

+ Here is the call graph for this function:

◆ pad_grids() [1/2]

void trv::ParticleCatalogue::pad_grids ( ParticleCatalogue & catalogue,
const double boxsize[3],
const int ngrid[3],
const double ngrid_pad[3] )
static

Pad a catalogue in a box.

The amount of padding is a multiple of the mesh grid size.

Parameters
catalogueParticle catalogue.
boxsizeBox size in each dimension.
ngridGrid number in each dimension.
ngrid_padGrid number factor for padding.

Definition at line 608 of file particles.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ pad_grids() [2/2]

void trv::ParticleCatalogue::pad_grids ( ParticleCatalogue & catalogue,
ParticleCatalogue & catalogue_ref,
const double boxsize[3],
const int ngrid[3],
const double ngrid_pad[3] )
static

Pad a catalogue in a box.

The amount of padding is a multiple of the mesh grid size.

The secondary catalogue's extents are used as the reference points to also offset the primary catalogue's particle positions.

Parameters
cataloguePrimary particle catalogue.
catalogue_refSecondary reference particle catalogue.
boxsizeBox size in each dimension.
ngridGrid number in each dimension.
ngrid_padGrid number factor for padding.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 625 of file particles.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ source

std::string trv::ParticleCatalogue::source

catalogue source

Definition at line 70 of file particles.hpp.

◆ pdata

ParticleData* trv::ParticleCatalogue::pdata

particle data

Definition at line 72 of file particles.hpp.

◆ ntotal

int trv::ParticleCatalogue::ntotal

total number of particles

Definition at line 74 of file particles.hpp.

◆ wtotal

double trv::ParticleCatalogue::wtotal

total overall weight of particles

Definition at line 75 of file particles.hpp.

◆ wstotal

double trv::ParticleCatalogue::wstotal

total sample weight of particles

Definition at line 76 of file particles.hpp.

◆ pos_min

double trv::ParticleCatalogue::pos_min[3]

minimum values of particle coordinates

Definition at line 78 of file particles.hpp.

◆ pos_max

double trv::ParticleCatalogue::pos_max[3]

maximum values of particle coordinates

Definition at line 79 of file particles.hpp.

◆ pos_span

double trv::ParticleCatalogue::pos_span[3]

span of particle coordinates

Definition at line 80 of file particles.hpp.


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