libMesh
|
This class provides the ability to map between arbitrary, user-defined strings and several data types. More...
#include <parameters.h>
Classes | |
class | Parameter |
Concrete definition of a parameter value for a specified type. More... | |
class | Value |
Abstract definition of a parameter value. More... | |
Public Types | |
typedef std::map< std::string, std::unique_ptr< Value >, std::less<> > | map_type |
The type of the map that we store internally. More... | |
typedef map_type::iterator | iterator |
Parameter map iterator. More... | |
typedef map_type::const_iterator | const_iterator |
Constant parameter map iterator. More... | |
Public Member Functions | |
Parameters ()=default | |
Default constructor. More... | |
Parameters (const Parameters &) | |
Copy constructor. More... | |
virtual | ~Parameters ()=default |
Destructor. More... | |
virtual Parameters & | operator= (const Parameters &source) |
Assignment operator. More... | |
virtual Parameters & | operator+= (const Parameters &source) |
Addition/Assignment operator. More... | |
template<typename T > | |
bool | have_parameter (std::string_view) const |
template<typename T > | |
const T & | get (std::string_view) const |
template<typename T > | |
void | insert (const std::string &) |
Inserts a new Parameter into the object but does not return a writable reference. More... | |
template<typename T > | |
T & | set (const std::string &) |
virtual void | set_attributes (const std::string &, bool) |
Overridable function to set any extended attributes for classes inheriting from this class. More... | |
void | remove (std::string_view) |
Removes the specified parameter from the list, if it exists. More... | |
std::size_t | n_parameters () const |
template<typename T > | |
unsigned int | n_parameters () const |
virtual void | clear () |
Clears internal data structures & frees any allocated memory. More... | |
void | print (std::ostream &os=libMesh::out) const |
Prints the contents, by default to libMesh::out. More... | |
iterator | begin () |
Iterator pointing to the beginning of the set of parameters. More... | |
const_iterator | begin () const |
Iterator pointing to the beginning of the set of parameters. More... | |
iterator | end () |
Iterator pointing to the end of the set of parameters. More... | |
const_iterator | end () const |
Iterator pointing to the end of the set of parameters. More... | |
Protected Attributes | |
map_type | _values |
Data structure to map names with values. More... | |
This class provides the ability to map between arbitrary, user-defined strings and several data types.
This can be used to provide arbitrary user-specified options.
Definition at line 67 of file parameters.h.
typedef map_type::const_iterator libMesh::Parameters::const_iterator |
Constant parameter map iterator.
Definition at line 257 of file parameters.h.
typedef map_type::iterator libMesh::Parameters::iterator |
Parameter map iterator.
Definition at line 252 of file parameters.h.
typedef std::map<std::string, std::unique_ptr<Value>, std::less<> > libMesh::Parameters::map_type |
The type of the map that we store internally.
Definition at line 247 of file parameters.h.
|
default |
Default constructor.
|
inline |
Copy constructor.
Makes an independent copy by cloning the contents of the passed-in Parameters object.
Definition at line 351 of file parameters.h.
|
virtualdefault |
Destructor.
|
inline |
Iterator pointing to the beginning of the set of parameters.
Definition at line 510 of file parameters.h.
References _values.
|
inline |
Iterator pointing to the beginning of the set of parameters.
Definition at line 516 of file parameters.h.
References _values.
|
inlinevirtual |
Clears internal data structures & frees any allocated memory.
Definition at line 324 of file parameters.h.
References _values.
Referenced by libMesh::EquationSystems::clear(), and operator=().
|
inline |
Iterator pointing to the end of the set of parameters.
Definition at line 522 of file parameters.h.
References _values.
|
inline |
Iterator pointing to the end of the set of parameters.
Definition at line 528 of file parameters.h.
References _values.
|
inline |
Definition at line 426 of file parameters.h.
References _values, libMesh::demangle(), libMesh::libmesh_assert(), and libMesh::Quality::name().
Referenced by add_M_C_K_helmholtz(), assemble_cd(), assemble_divgrad(), assemble_ellipticdg(), assemble_func(), assemble_helmholtz(), assemble_poisson(), assemble_SchroedingerEquation(), assemble_shell(), assemble_stokes(), assemble_wave(), libMesh::FrequencySystem::clear_all(), libMesh::compute_error(), compute_jacobian(), compute_residual(), LinearElasticityWithContact::compute_stresses(), LargeDeformationElasticity::compute_stresses(), designed_for_side_elems(), exact_derivative(), exact_solution(), exact_value(), fe_assembly(), fill_dirichlet_bc(), libMesh::ImplicitSystem::get_linear_solve_parameters(), libMesh::FEComputeData::init(), libMesh::FrequencySystem::init_data(), Biharmonic::JR::InitialDensityBall(), Biharmonic::JR::InitialDensityRod(), Biharmonic::JR::InitialDensityStrip(), LargeDeformationElasticity::jacobian(), line_print(), main(), libMesh::FrequencySystem::n_frequencies(), LargeDeformationElasticity::residual(), LinearElasticityWithContact::residual_and_jacobian(), libMesh::FrequencySystem::set_current_frequency(), libMesh::NonlinearImplicitSystem::set_solver_parameters(), SolidSystem::side_time_derivative(), libMesh::RBConstruction::solve_for_matrix_and_rhs(), libMesh::EigenSystem::solve_helper(), ParametersTest::testMap(), and ParametersTest::testScalar().
|
inline |
true
if a parameter of type T
with a specified name exists, false
otherwise.If RTTI has been disabled then we return true
if a parameter of specified name exists regardless of its type.
Definition at line 395 of file parameters.h.
References _values, libMesh::cast_ptr(), and libMesh::Quality::name().
Referenced by libMesh::FrequencySystem::clear_all(), designed_for_side_elems(), libMesh::ImplicitSystem::get_linear_solve_parameters(), libMesh::FEComputeData::init(), libMesh::FrequencySystem::init_data(), libMesh::NonlinearImplicitSystem::set_solver_parameters(), libMesh::EigenSystem::solve(), libMesh::CondensedEigenSystem::solve(), and libMesh::EigenSystem::solve_helper().
|
inline |
Inserts a new Parameter into the object but does not return a writable reference.
The value of the newly inserted parameter may not be valid.
Definition at line 458 of file parameters.h.
References _values, libMesh::Quality::name(), and set_attributes().
|
inline |
Definition at line 148 of file parameters.h.
References _values.
|
inline |
Definition at line 497 of file parameters.h.
References _values.
|
inlinevirtual |
Addition/Assignment operator.
Inserts copies of all parameters from source
. Any parameters of the same name already in this
are replaced.
Definition at line 341 of file parameters.h.
References _values, and value.
|
inlinevirtual |
Assignment operator.
Removes all parameters in this
and inserts copies of all parameters from source
Definition at line 332 of file parameters.h.
References clear().
|
inline |
Prints the contents, by default to libMesh::out.
Definition at line 360 of file parameters.h.
References _values.
Referenced by libMesh::operator<<().
|
inline |
Removes the specified parameter from the list, if it exists.
Definition at line 484 of file parameters.h.
References _values, and libMesh::Quality::name().
Referenced by libMesh::FrequencySystem::clear_all().
|
inline |
get()
member. Definition at line 469 of file parameters.h.
References _values, libMesh::Quality::name(), and set_attributes().
Referenced by assemble_SchroedingerEquation(), libMesh::NewmarkSystem::clear(), libMesh::EquationSystems::EquationSystems(), init_cd(), HeatSystem::init_data(), Biharmonic::JR::initialize(), initialize(), main(), libMesh::NewmarkSystem::NewmarkSystem(), libMesh::NonlinearImplicitSystem::NonlinearImplicitSystem(), run_timestepping(), libMesh::FrequencySystem::set_current_frequency(), libMesh::FrequencySystem::set_frequencies(), libMesh::FrequencySystem::set_frequencies_by_range(), libMesh::FrequencySystem::set_frequencies_by_steps(), libMesh::NewmarkSystem::set_newmark_parameters(), setup(), ParametersTest::testMap(), ParametersTest::testScalar(), and SystemsTest::testSetSystemParameterOverEquationSystem().
|
inlinevirtual |
Overridable function to set any extended attributes for classes inheriting from this class.
Definition at line 138 of file parameters.h.
|
protected |
Data structure to map names with values.
Definition at line 284 of file parameters.h.
Referenced by begin(), clear(), end(), get(), have_parameter(), insert(), n_parameters(), operator+=(), print(), remove(), and set().