chombo-discharge
Functions
DischargeIO Namespace Reference

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

Functions

std::string numberFmt (const long long a_number, char a_sep=',') noexcept
 Number formatting method – writes big numbers using an input separator. E.g. the number 123456 is written as 123,456. More...
 
Vector< std::string > numberFmt (const Vector< long long > a_numbers, char a_sep=',') noexcept
 Number formatting game. This just prints the number 123456 as 123,456. More...
 
template<size_t M, size_t N>
void writeH5Part (const std::string a_filename, const ParticleContainer< GenericParticle< M, N >> &a_particles, const std::vector< std::string > a_realVars=std::vector< std::string >(), const std::vector< std::string > a_vectVars=std::vector< std::string >(), const RealVect a_shift=RealVect::Zero, const Real a_time=0.0) noexcept
 A shameless copy of Chombo's writeEBHDF5 but including the lower-left corner of the physical domain as well. More...
 

Detailed Description

Namespace which encapsulates chombo-discharge IO functionality.

Function Documentation

◆ numberFmt() [1/2]

std::string DischargeIO::numberFmt ( const long long  a_number,
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]a_numberNumber to format as string with separator
[in]a_sepSeparator

◆ numberFmt() [2/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

◆ writeH5Part()

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

A shameless copy of Chombo's writeEBHDF5 but including the lower-left corner of the physical domain as well.

User are not supported to call this. Driver will perform calls to writeEBHDF5Header and writeEBHDF5Level

Parameters
[in]a_filenameFile name
[in]a_variableNamesGrid variable names
[in]a_gridsGrids on each AMR level
[in]a_dataData on the AMR levels
[in]a_domainsGrid domains
[in]a_dxGrid resolutions
[in]a_refinementRatiosRefinement ratios
[in]a_dtTime step
[in]a_timeTime
[in]a_probLoLower-left physical corner
[in]a_numLevelsNumber of AMR levels
[in]a_numGhostNumber of ghost cells included in the output.

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_shiftTime