chombo-discharge
Loading...
Searching...
No Matches
Functions
DischargeIO Namespace Reference

Namespace which encapsulates chombo-discharge IO functionality. More...

Functions

std::string numberFmt (long long n, char a_sep=',') noexcept
 Number formatting method – writes big numbers using an input separator. E.g. the number 123456 is written as 123,456.
 
Vector< std::stringnumberFmt (const Vector< long long > &a_numbers, char a_sep=',') noexcept
 Number formatting game. This just prints the number 123456 as 123,456.
 
template<size_t M, size_t N>
void writeH5Part (std::string a_filename, const ParticleContainer< GenericParticle< M, N > > &a_particles, std::vector< std::string > a_realVars, std::vector< std::string > a_vectVars, RealVect a_shift, Real a_time) noexcept
 Write a particle container to an H5Part file. Good for quick and dirty visualization of particles.
 

Detailed Description

Namespace which encapsulates chombo-discharge IO functionality.

Function Documentation

◆ numberFmt() [1/2]

Vector< std::string > DischargeIO::numberFmt ( const Vector< long long > &  a_numbers,
char  a_sep = ',' 
)
noexcept

Number formatting game. This just prints the number 123456 as 123,456.

Parameters
[in]a_numbersNumbers to format as string with separator
[in]a_sepSeparator
Returns
Return value

◆ numberFmt() [2/2]

std::string DischargeIO::numberFmt ( long long  n,
char  a_sep = ',' 
)
noexcept

Number formatting method – writes big numbers using an input separator. E.g. the number 123456 is written as 123,456.

Parameters
[in]nNumber to format as string with separator
[in]a_sepSeparator
Returns
Return value

◆ writeH5Part()

template<size_t M, size_t N>
void DischargeIO::writeH5Part ( std::string  a_filename,
const ParticleContainer< GenericParticle< M, N > > &  a_particles,
std::vector< std::string a_realVars,
std::vector< std::string a_vectVars,
RealVect  a_shift,
Real  a_time 
)
noexcept

Write a particle container to an H5Part file. Good for quick and dirty visualization of particles.

Use case is pretty straightforward but the user might need to cast particle types. E.g. call

writeH5Part<M,N>(a_filename, (const ParticleContainer<GenericParticle<M,N>>&) a_particles, ...)

Template substitution is not straightforward for this one.

Parameters
[in]a_filenameFile name
[in]a_particlesParticles. Particle type must derive from GenericParticle<M, N>
[in]a_realVarsVariable names for the M real variables
[in]a_vectVarsVariable names for the N vector variables
[in]a_shiftParticle position shift
[in]a_timePhysical time