WarpX
Loading...
Searching...
No Matches
detail Namespace Reference

Classes

struct  char_to_explicit_char
 
struct  char_to_explicit_char< false >
 
struct  char_to_explicit_char< true >
 

Functions

std::string snakeToCamel (const std::string &snake_string)
 Convert a snake_case string to a camelCase one.
 
std::string getSeriesOptions (std::string const &operator_type, std::map< std::string, std::string > const &operator_parameters, std::string const &engine_type, std::map< std::string, std::string > const &engine_parameters)
 
std::pair< std::string, std::string > name2openPMD (std::string const &fullName)
 
std::vector< std::string > getParticlePositionComponentLabels (amrex::Vector< int > const &write_real_comp, amrex::Vector< std::string > const &real_comp_names)
 
std::vector< std::string > getFieldAxisLabels (bool const var_in_theta_mode)
 
std::vector< std::string > getFieldComponentLabels (bool const var_in_theta_mode)
 
std::map< openPMD::UnitDimension, double > getUnitDimension (std::string const &record_name)
 
void setOpenPMDUnit (openPMD::Mesh mesh, const std::string &field_name)
 For a given field that is to be written to an openPMD file, set the metadata that indicates the physical unit.
 
template<typename T>
auto get_or_throw (std::string const &prefix, std::string const &name)
 

Function Documentation

◆ get_or_throw()

template<typename T>
auto detail::get_or_throw ( std::string const & prefix,
std::string const & name )

Helper Function for Property Getters

This queries an amrex::ParmParse entry. This throws a std::runtime_error if the entry is not found.

This handles the most common throw exception logic in WarpX instead of going over library boundaries via amrex::Abort().

Template Parameters
Ttype of the amrex::ParmParse entry
Parameters
prefixthe prefix, e.g., "warpx" or "amr"
namethe actual key of the entry, e.g., "particle_shape"
Returns
the queried value (or throws if not found)

◆ getFieldAxisLabels()

std::vector< std::string > detail::getFieldAxisLabels ( bool const var_in_theta_mode)
inline

Return the axis (index) names of a mesh

This will be returned in C order. This is inverse of the Fortran order of the index labels for the AMReX FArrayBox.

Parameters
var_in_theta_modeindicate if this field will be output with theta modes (instead of a reconstructed 2D slice)

◆ getFieldComponentLabels()

std::vector< std::string > detail::getFieldComponentLabels ( bool const var_in_theta_mode)
inline

Return the component names of a mesh

Parameters
var_in_theta_modeindicate if this field will be output with theta modes (instead of a reconstructed 2D slice)

◆ getParticlePositionComponentLabels()

std::vector< std::string > detail::getParticlePositionComponentLabels ( amrex::Vector< int > const & write_real_comp,
amrex::Vector< std::string > const & real_comp_names )
inline

Return the user-selected components for particle positions

Parameters
[in]write_real_compThe real attribute ids, from WarpX
[in]real_comp_namesThe real attribute names, from WarpX

◆ getSeriesOptions()

std::string detail::getSeriesOptions ( std::string const & operator_type,
std::map< std::string, std::string > const & operator_parameters,
std::string const & engine_type,
std::map< std::string, std::string > const & engine_parameters )
inline

Create the option string

Returns
JSON option string for openPMD::Series

◆ getUnitDimension()

std::map< openPMD::UnitDimension, double > detail::getUnitDimension ( std::string const & record_name)
inline

Get the openPMD physical dimensionality of a record

Parameters
record_namename of the openPMD record
Returns
map with base quantities and power scaling

◆ name2openPMD()

std::pair< std::string, std::string > detail::name2openPMD ( std::string const & fullName)
inline

Unclutter a real_names to openPMD record

Parameters
fullNamename as in real_names variable
Returns
pair of openPMD record and component name

◆ setOpenPMDUnit()

void detail::setOpenPMDUnit ( openPMD::Mesh mesh,
const std::string & field_name )
inline

For a given field that is to be written to an openPMD file, set the metadata that indicates the physical unit.

◆ snakeToCamel()

std::string detail::snakeToCamel ( const std::string & snake_string)
inline

Convert a snake_case string to a camelCase one.

WarpX uses snake_case internally for some component names, but OpenPMD assumes "_" indicates vector or tensor fields.

Returns
camelCase version of input