Particles file loader/saver base class.
More...
#include <InputOutput/Particles.h>
|
| Particles (ProblemSetup &sim_data, unsigned int iset, unsigned int offset, unsigned int n=0) |
| Constructor.
|
|
virtual | ~Particles () |
| Destructor.
|
|
const std::string | file () |
| Get the last printed file path.
|
|
unsigned int | n () |
| Get the number of particles managed by this instance.
|
|
virtual void | waitForSavers () |
| Wait for the eventual parallel saving threads.
|
|
virtual void | save (float t)=0 |
| Save the data.
|
|
virtual void | load ()=0 |
| Load the data.
|
|
|
ProblemSetup & | simData () |
| Get the simulation data structure.
|
|
void | n (unsigned int n) |
| Set the number of particles managed by this instance.
|
|
const uivec2 | bounds () const |
| Get the particle index bounds of the "set of particles" managed by this class.
|
|
const unsigned int | setId () const |
| Get the "particles set" index associated with this class.
|
|
void | loadDefault () |
| Register some default arrays:
|
|
void | file (const std::string filename) |
| Set the file name.
|
|
unsigned int | file (const std::string basename, unsigned int start_index, unsigned int digits=5) |
|
std::vector< void * > | download (std::vector< std::string > fields) |
|
| InputOutput () |
| Constructor.
|
|
virtual | ~InputOutput () |
| Destructor.
|
|
Particles file loader/saver base class.
In AQUAgpusph the input/output managers are divided in 3 different types:
- The simulation configuration files manager
- The report file managers
- The particles output file managers
The particles files have 2 main objectives:
- Particles data loading at the start of simulations.
- Visualization of the simulation results.
- See also
- Aqua::InputOutput::InputOutput
-
Aqua::InputOutput::Report
-
Aqua::InputOutput::State
◆ Particles()
Aqua::InputOutput::Particles::Particles |
( |
ProblemSetup & |
sim_data, |
|
|
unsigned int |
iset, |
|
|
unsigned int |
offset, |
|
|
unsigned int |
n = 0 |
|
) |
| |
Constructor.
- Parameters
-
sim_data | Simulation data |
offset | First particle managed by this saver/loader |
iset | Particles set index |
n | Number of particles managed by this saver/loader. If 0, the number of particles will be obtained from the input file (thus only valid for loaders) |
◆ ~Particles()
Aqua::InputOutput::Particles::~Particles |
( |
| ) |
|
|
virtual |
◆ bounds()
const uivec2 Aqua::InputOutput::Particles::bounds |
( |
| ) |
const |
|
inlineprotected |
Get the particle index bounds of the "set of particles" managed by this class.
- Returns
- The index bounds (first and last particle).
◆ download()
std::vector< void * > Aqua::InputOutput::Particles::download |
( |
std::vector< std::string > |
fields | ) |
|
|
protected |
Download the data from the device, and store it
- Parameters
-
- Returns
- host allocated memory
- Note
- The returned data must be manually cleared.
◆ file() [1/3]
const std::string Aqua::InputOutput::Particles::file |
( |
| ) |
|
|
inline |
Get the last printed file path.
- Returns
- The last printed file, NULL if a file has not been printed yet.
◆ file() [2/3]
unsigned int Aqua::InputOutput::Particles::file |
( |
const std::string |
basename, |
|
|
unsigned int |
start_index, |
|
|
unsigned int |
digits = 5 |
|
) |
| |
|
protected |
Look for the first non-existing file path
- Parameters
-
basename | The base name of the file |
start_index | First index that will be checked. |
digits | Number of digits of the replaced integer number. If the number of digits of the integer value are greater than this value this parameter will be ignored, otherwise zeroes will be appended at the left of the decimal representation of the integer. |
- Returns
- The next non-existing file index.
- See also
- Aqua::newFilePath()
◆ file() [3/3]
void Aqua::InputOutput::Particles::file |
( |
const std::string |
filename | ) |
|
|
inlineprotected |
Set the file name.
- Parameters
-
filename | The new file to save/load. Optionally a null parameter can be passed in order to clear the stored file name. |
◆ loadDefault()
void Aqua::InputOutput::Particles::loadDefault |
( |
| ) |
|
|
protected |
Register some default arrays:
- iset
- id_sorted
- id_unsorted
◆ n() [1/2]
unsigned int Aqua::InputOutput::Particles::n |
( |
| ) |
|
|
inline |
Get the number of particles managed by this instance.
- Returns
- Number of particles
◆ n() [2/2]
void Aqua::InputOutput::Particles::n |
( |
unsigned int |
n | ) |
|
|
inlineprotected |
Set the number of particles managed by this instance.
- Returns
- Number of particles
◆ setId()
const unsigned int Aqua::InputOutput::Particles::setId |
( |
| ) |
const |
|
inlineprotected |
Get the "particles set" index associated with this class.
- Returns
- The "particles index" index.
◆ simData()
Get the simulation data structure.
- Returns
- Simulation data
◆ waitForSavers()
virtual void Aqua::InputOutput::Particles::waitForSavers |
( |
| ) |
|
|
inlinevirtual |
Wait for the eventual parallel saving threads.
Some savers may optionally launch parallel threads to save the data, in an asynchronous way, in order to improve the performance. In such a case, AQUAgpusph shall wait them to finish before proceeding to destroy the data
Reimplemented in Aqua::InputOutput::VTK.
The documentation for this class was generated from the following files:
- /home/pepe/SPH/Code/aquagpusph/include/InputOutput/Particles.h
- /home/pepe/SPH/Code/aquagpusph/src/InputOutput/Particles.cpp