Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
shammodels::sph::PhantomDumpBlockArray< T > Struct Template Reference

A helper 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::PhantomDumpBlockArray< T >:

Public Member Functions

void write (shambase::FortranIOFile &phfile, i64 tot_count)
 Writes a block to a file.
 
template<class Tb >
void fill_vec (std::string field_name, std::vector< Tb > &vec)
 Fills a vector with the values of a given field name.
 
void print_state ()
 Prints the state of the block.
 

Static Public Member Functions

static PhantomDumpBlockArray from_file (shambase::FortranIOFile &phfile, i64 tot_count)
 Reads a block from a file.
 

Public Attributes

std::string tag
 The tag of the block.
 
std::vector< T > vals
 The values of the block.
 

Detailed Description

template<class T>
struct shammodels::sph::PhantomDumpBlockArray< T >

A helper class to represent a single block of data in a Phantom dump.

A single block of data in a Phantom dump consists of a 16-character tag, followed by a variable number of values of a given type. This class represents such a block.

Template Parameters
TThe type of the values in the block.

Definition at line 130 of file PhantomDump.hpp.

Member Function Documentation

◆ fill_vec()

template<class T >
template<class Tb >
void shammodels::sph::PhantomDumpBlockArray< T >::fill_vec ( std::string  field_name,
std::vector< Tb > &  vec 
)
inline

Fills a vector with the values of a given field name.

Parameters
field_namethe name of the field to look for
vecthe vector to fill

Definition at line 166 of file PhantomDump.hpp.

◆ from_file()

template<class T >
shammodels::sph::PhantomDumpBlockArray< T > shammodels::sph::PhantomDumpBlockArray< T >::from_file ( shambase::FortranIOFile phfile,
i64  tot_count 
)
static

Reads a block from a file.

Parameters
phfilethe file to read from
tot_countthe total number of values to read
Returns
the block that was read

Definition at line 36 of file PhantomDump.cpp.

+ Here is the call graph for this function:

◆ print_state()

template<class T >
void shammodels::sph::PhantomDumpBlockArray< T >::print_state ( )

Prints the state of the block.

Definition at line 54 of file PhantomDump.cpp.

◆ write()

template<class T >
void shammodels::sph::PhantomDumpBlockArray< T >::write ( shambase::FortranIOFile phfile,
i64  tot_count 
)

Writes a block to a file.

Parameters
phfilethe file to write to
tot_countthe total number of values to write

Definition at line 46 of file PhantomDump.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ tag

template<class T >
std::string shammodels::sph::PhantomDumpBlockArray< T >::tag

The tag of the block.

Definition at line 135 of file PhantomDump.hpp.

◆ vals

template<class T >
std::vector<T> shammodels::sph::PhantomDumpBlockArray< T >::vals

The values of the block.

Definition at line 140 of file PhantomDump.hpp.


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