![]() |
Shamrock 2025.10.0
Astrophysical Code
|
A class to represent a single block of data in a Phantom dump. More...
#include <shammodels/sph/include/shammodels/sph/io/PhantomDump.hpp>
Collaboration diagram for shammodels::sph::PhantomDumpBlock:Public Types | |
| using | fort_real = f64 |
| The type for Phantom's real type. | |
| using | fort_int = int |
| The type for Phantom's integer type. | |
Public Member Functions | |
| u64 | get_ref_fort_int (std::string s) |
Gets the index of a block of type fort_int with the given name. | |
| u64 | get_ref_i8 (std::string s) |
Gets the index of a block of type i8 with the given name. | |
| u64 | get_ref_i16 (std::string s) |
Gets the index of a block of type i16 with the given name. | |
| u64 | get_ref_i32 (std::string s) |
Gets the index of a block of type i32 with the given name. | |
| u64 | get_ref_i64 (std::string s) |
Gets the index of a block of type i64 with the given name. | |
| u64 | get_ref_fort_real (std::string s) |
Gets the index of a block of type fort_real with the given name. | |
| u64 | get_ref_f32 (std::string s) |
Gets the index of a block of type f32 with the given name. | |
| u64 | get_ref_f64 (std::string s) |
Gets the index of a block of type f64 with the given name. | |
| void | print_state () |
| Prints the state of the block. | |
| void | write (shambase::FortranIOFile &phfile, i64 tot_count, std::array< i32, 8 > numarray) |
| Writes a block to a file. | |
| template<class T > | |
| void | fill_vec (std::string field_name, std::vector< T > &vec) |
| Fills a vector with the values of a given field name. | |
Static Public Member Functions | |
| static PhantomDumpBlock | from_file (shambase::FortranIOFile &phfile, i64 tot_count, std::array< i32, 8 > numarray) |
| Reads a block from a file. | |
Public Attributes | |
| i64 | tot_count |
| The total number of values in the block. | |
| std::vector< PhantomDumpBlockArray< fort_int > > | blocks_fort_int |
The blocks of values of type fort_int. | |
| std::vector< PhantomDumpBlockArray< i8 > > | blocks_i8 |
The blocks of values of type i8. | |
| std::vector< PhantomDumpBlockArray< i16 > > | blocks_i16 |
The blocks of values of type i16. | |
| std::vector< PhantomDumpBlockArray< i32 > > | blocks_i32 |
The blocks of values of type i32. | |
| std::vector< PhantomDumpBlockArray< i64 > > | blocks_i64 |
The blocks of values of type i64. | |
| std::vector< PhantomDumpBlockArray< fort_real > > | blocks_fort_real |
The blocks of values of type fort_real. | |
| std::vector< PhantomDumpBlockArray< f32 > > | blocks_f32 |
The blocks of values of type f32. | |
| std::vector< PhantomDumpBlockArray< f64 > > | blocks_f64 |
The blocks of values of type f64. | |
A class to represent a single block of data in a Phantom dump.
| T | The type of the values in the block. |
Definition at line 185 of file PhantomDump.hpp.
| using shammodels::sph::PhantomDumpBlock::fort_int = int |
The type for Phantom's integer type.
Definition at line 192 of file PhantomDump.hpp.
The type for Phantom's real type.
Definition at line 190 of file PhantomDump.hpp.
|
inline |
Fills a vector with the values of a given field name.
| field_name | the name of the field to look for |
| vec | the vector to fill |
Definition at line 307 of file PhantomDump.hpp.
|
static |
Reads a block from a file.
| phfile | the file to read from |
| tot_count | the total number of values to read |
| numarray | the number of values of each type |
Definition at line 153 of file PhantomDump.cpp.
| u64 shammodels::sph::PhantomDumpBlock::get_ref_f32 | ( | std::string | s | ) |
Gets the index of a block of type f32 with the given name.
| s | The name of the block to search for. |
0 if no such block exists. Definition at line 243 of file PhantomDump.cpp.
| u64 shammodels::sph::PhantomDumpBlock::get_ref_f64 | ( | std::string | s | ) |
Gets the index of a block of type f64 with the given name.
| s | The name of the block to search for. |
0 if no such block exists. | u64 shammodels::sph::PhantomDumpBlock::get_ref_fort_int | ( | std::string | s | ) |
Gets the index of a block of type fort_int with the given name.
| s | The name of the block to search for. |
0 if no such block exists. | u64 shammodels::sph::PhantomDumpBlock::get_ref_fort_real | ( | std::string | s | ) |
Gets the index of a block of type fort_real with the given name.
| s | The name of the block to search for. |
0 if no such block exists. Definition at line 219 of file PhantomDump.cpp.
| u64 shammodels::sph::PhantomDumpBlock::get_ref_i16 | ( | std::string | s | ) |
Gets the index of a block of type i16 with the given name.
| s | The name of the block to search for. |
0 if no such block exists. | u64 shammodels::sph::PhantomDumpBlock::get_ref_i32 | ( | std::string | s | ) |
Gets the index of a block of type i32 with the given name.
| s | The name of the block to search for. |
0 if no such block exists. | u64 shammodels::sph::PhantomDumpBlock::get_ref_i64 | ( | std::string | s | ) |
Gets the index of a block of type i64 with the given name.
| s | The name of the block to search for. |
0 if no such block exists. | u64 shammodels::sph::PhantomDumpBlock::get_ref_i8 | ( | std::string | s | ) |
Gets the index of a block of type i8 with the given name.
| s | The name of the block to search for. |
0 if no such block exists. | void shammodels::sph::PhantomDumpBlock::print_state | ( | ) |
Prints the state of the block.
Definition at line 117 of file PhantomDump.cpp.
| void shammodels::sph::PhantomDumpBlock::write | ( | shambase::FortranIOFile & | phfile, |
| i64 | tot_count, | ||
| std::array< i32, 8 > | numarray | ||
| ) |
Writes a block to a file.
| phfile | the file to write to |
| tot_count | the total number of values to write |
| numarray | the number of values of each type |
Definition at line 189 of file PhantomDump.cpp.
| std::vector<PhantomDumpBlockArray<f32> > shammodels::sph::PhantomDumpBlock::blocks_f32 |
The blocks of values of type f32.
Definition at line 207 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<f64> > shammodels::sph::PhantomDumpBlock::blocks_f64 |
The blocks of values of type f64.
Definition at line 209 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<fort_int> > shammodels::sph::PhantomDumpBlock::blocks_fort_int |
The blocks of values of type fort_int.
Definition at line 195 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<fort_real> > shammodels::sph::PhantomDumpBlock::blocks_fort_real |
The blocks of values of type fort_real.
Definition at line 205 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<i16> > shammodels::sph::PhantomDumpBlock::blocks_i16 |
The blocks of values of type i16.
Definition at line 199 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<i32> > shammodels::sph::PhantomDumpBlock::blocks_i32 |
The blocks of values of type i32.
Definition at line 201 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<i64> > shammodels::sph::PhantomDumpBlock::blocks_i64 |
The blocks of values of type i64.
Definition at line 203 of file PhantomDump.hpp.
| std::vector<PhantomDumpBlockArray<i8> > shammodels::sph::PhantomDumpBlock::blocks_i8 |
The blocks of values of type i8.
Definition at line 197 of file PhantomDump.hpp.
| i64 shammodels::sph::PhantomDumpBlock::tot_count |
The total number of values in the block.
Definition at line 187 of file PhantomDump.hpp.