MultiParser Class Reference

AMR-Wind API: amr_wind::utils::MultiParser Class Reference
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
Loading...
Searching...
No Matches
amr_wind::utils::MultiParser Class Reference

#include <MultiParser.H>

Public Member Functions

 MultiParser (const std::string &default_prefix, const std::string &prefix)
 
const amrex::ParmParse & default_params () const
 Return the ParmParse instance for the default namespace.
 
const amrex::ParmParse & params () const
 Return the ParmParse instance for the specialized namespace.
 
bool contains (const std::string &name) const
 Check if the keyword is present in either namespace.
 
void get (const std::string &name, vs::Vector &value) const
 
void query (const std::string &name, vs::Vector &value) const
 
void get_either (const std::string &name, vs::Vector &value) const
 
void query_either (const std::string &name, vs::Vector &value) const
 
template<typename T >
void get (const std::string &name, T &value) const
 Get the value for the keyword entry from either namespace.
 
template<typename T >
void getarr (const std::string &name, T &value) const
 Get a vector of values for the given keyword entry from either namespace.
 
template<typename T >
void query (const std::string &name, T &value) const
 Query the value for the keyword entry from either namespace.
 
template<typename T >
void queryarr (const std::string &name, T &value) const
 

Private Attributes

amrex::ParmParse m_pp_default
 
amrex::ParmParse m_pp
 

Detailed Description

Utility to parse inputs from multiple namespaces.

This class is a thin-wrapper around AMReX ParmParse utility to query user inputs from two different namespaces (default and specialized). This allows the user to consolidate common options within a default section and then override specific values in the specialization section.

Constructor & Destructor Documentation

◆ MultiParser()

amr_wind::utils::MultiParser::MultiParser ( const std::string & default_prefix,
const std::string & prefix )
inline

Member Function Documentation

◆ contains()

bool amr_wind::utils::MultiParser::contains ( const std::string & name) const
inline

Check if the keyword is present in either namespace.

◆ default_params()

const amrex::ParmParse & amr_wind::utils::MultiParser::default_params ( ) const
inline

Return the ParmParse instance for the default namespace.

◆ get() [1/2]

template<typename T >
void amr_wind::utils::MultiParser::get ( const std::string & name,
T & value ) const
inline

Get the value for the keyword entry from either namespace.

◆ get() [2/2]

void amr_wind::utils::MultiParser::get ( const std::string & name,
vs::Vector & value ) const
inline

Get a vector from the input file

Parameters
[in]nameKeyword to search for
[out]valueVector value

◆ get_either()

void amr_wind::utils::MultiParser::get_either ( const std::string & name,
vs::Vector & value ) const
inline

Get a vector from the input file, but could be specified uniform instead

Parameters
[in]nameKeyword to search for
[out]valueVector value

◆ getarr()

template<typename T >
void amr_wind::utils::MultiParser::getarr ( const std::string & name,
T & value ) const
inline

Get a vector of values for the given keyword entry from either namespace.

◆ params()

const amrex::ParmParse & amr_wind::utils::MultiParser::params ( ) const
inline

Return the ParmParse instance for the specialized namespace.

◆ query() [1/2]

template<typename T >
void amr_wind::utils::MultiParser::query ( const std::string & name,
T & value ) const
inline

Query the value for the keyword entry from either namespace.

◆ query() [2/2]

void amr_wind::utils::MultiParser::query ( const std::string & name,
vs::Vector & value ) const
inline

Query and return if a vector exists in the input file

Parameters
[in]nameKeyword to search for
[out]valueVector value

◆ query_either()

void amr_wind::utils::MultiParser::query_either ( const std::string & name,
vs::Vector & value ) const
inline

Query and return if a scalar (uniform) or vector exists in input file

Parameters
[in]nameKeyword to search for
[out]valueVector value

◆ queryarr()

template<typename T >
void amr_wind::utils::MultiParser::queryarr ( const std::string & name,
T & value ) const
inline

Query a vector of values for the given keyword entry from either namespace

Member Data Documentation

◆ m_pp

amrex::ParmParse amr_wind::utils::MultiParser::m_pp
private

◆ m_pp_default

amrex::ParmParse amr_wind::utils::MultiParser::m_pp_default
private

The documentation for this class was generated from the following file:
  • /home/runner/work/amr-wind/amr-wind/amr-wind/core/MultiParser.H