20#ifndef LIBMESH_RB_PARAMETERS_H
21#define LIBMESH_RB_PARAMETERS_H
24#include "libmesh/libmesh_common.h"
79 RBParameters(
const std::map<std::string, Real> & parameter_map);
86 std::map<std::string,std::vector<RBParameter>>::const_iterator
begin()
const;
87 std::map<std::string,std::vector<RBParameter>>::const_iterator
end()
const;
88 std::map<std::string,std::vector<RBParameter>>::const_iterator
extra_begin()
const;
89 std::map<std::string,std::vector<RBParameter>>::const_iterator
extra_end()
const;
108 typedef std::map<std::string, std::vector<RBParameter>>::const_iterator
MapIter;
112 const std::size_t sample_vec_index,
113 const std::size_t value_vec_index)
174 return !(other == *
this);
227 bool has_value(
const std::string & param_name)
const;
429 std::string
get_string(
unsigned precision=6,
int max_values=5)
const;
434 void print(
unsigned precision=6,
int max_values=5)
const;
442 void set_value_helper(std::map<std::string, std::vector<RBParameter>> & map,
443 const std::string & param_name,
444 const std::size_t index,
Define a constant iterator for iterating over the map of parameters.
std::size_t _sample_vec_index
std::size_t _value_vec_index
bool operator==(const const_iterator &other) const
std::map< std::string, std::vector< RBParameter > >::const_iterator MapIter
const_iterator(const const_iterator &i)=default
std::forward_iterator_tag iterator_category
std::ptrdiff_t difference_type
std::pair< std::string, Real > value_type
const value_type & operator*() const
bool operator!=(const const_iterator &other) const
const_iterator(const MapIter &it, const std::size_t sample_vec_index, const std::size_t value_vec_index)
const_iterator & operator++()
This class is part of the rbOOmit framework.
std::map< std::string, std::vector< RBParameter > >::const_iterator extra_end() const
RBParameters & operator=(const RBParameters &)=default
void erase_extra_parameter(const std::string ¶m_name)
Erase param_name from _extra_parameters.
std::map< std::string, std::vector< RBParameter > >::const_iterator extra_begin() const
unsigned int n_parameters() const
Get the number of parameters that have been added.
const RBParameter & get_vector_value(const std::string ¶m_name) const
Real get_extra_sample_value(const std::string ¶m_name, std::size_t sample_idx) const
Get the value of the specified "extra" parameter at the specified sample index, throwing an error if ...
bool operator!=(const RBParameters &rhs) const
RBParameters & operator+=(const RBParameters &rhs)
Append "rhs" to "*this".
RBParameters()
Constructor.
std::set< std::string > get_extra_parameter_names() const
bool has_value(const std::string ¶m_name) const
const_iterator end_serialized_extra() const
const RBParameter & get_sample_vector_value(const std::string ¶m_name, std::size_t sample_idx) const
Real get_value(const std::string ¶m_name) const
Get the value of the specified parameter, throw an error if it does not exist.
std::set< std::string > get_parameter_names() const
RBParameters(RBParameters &&)=default
The special functions can be defaulted for this class, as it does not manage any memory itself.
std::string get_string(unsigned precision=6, int max_values=5) const
Get a string that specifies the contents of this RBParameters object.
bool has_extra_value(const std::string ¶m_name) const
void clear()
Clear this object.
Real get_sample_value(const std::string ¶m_name, std::size_t sample_idx) const
Get the value of the specified parameter at the specified sample, throwing an error if it does not ex...
const RBParameter & get_extra_sample_vector_value(const std::string ¶m_name, std::size_t sample_idx) const
void push_back_extra_value(const std::string ¶m_name, Real value)
Same as push_back_value(), but for "extra" parameters.
const RBParameter & get_extra_vector_value(const std::string ¶m_name, const RBParameter &default_val) const
void set_value_helper(std::map< std::string, std::vector< RBParameter > > &map, const std::string ¶m_name, const std::size_t index, RBParameter value)
Helper function for the 3-parameter versions of set_value() and set_extra_value().
std::map< std::string, std::vector< RBParameter > >::const_iterator begin() const
Return const_iterators to the internal parameter map, as a convenient way to access the parameter nam...
unsigned int _n_samples
The number of samples represented by this RBParameters object, in the case where there are no paramet...
void push_back_value(const std::string ¶m_name, Real value)
Similar to set_value(name, index, value) but instead of specifying a particular index,...
unsigned int n_samples() const
Returns the number of samples stored for all parameters.
const RBParameter & get_extra_vector_value(const std::string ¶m_name) const
const_iterator begin_serialized_extra() const
Get const_iterator access to the extra parameters stored in this RBParameters object.
bool operator==(const RBParameters &rhs) const
Two RBParameters are equal if they have the same _parameters map.
std::map< std::string, std::vector< RBParameter > > _extra_parameters
Extra parameter vectors not used for RB training.
RBParameters(const RBParameters &)=default
const_iterator end_serialized() const
void print(unsigned precision=6, int max_values=5) const
Print the parameters.
void set_extra_value(const std::string ¶m_name, Real value)
Set the value of the specified extra parameter.
Real get_extra_value(const std::string ¶m_name) const
Get the value of the specified extra parameter, throwing an error if it does not exist.
std::map< std::string, std::vector< RBParameter > >::const_iterator end() const
void erase_parameter(const std::string ¶m_name)
Erase param_name from _parameters.
const_iterator begin_serialized() const
Get const_iterator access to the parameters stored in this RBParameters object.
void set_n_samples(unsigned int n_samples)
Set the number of samples this RBParameters object is intended to represent, in the case that there a...
std::map< std::string, std::vector< RBParameter > > _parameters
Actual parameter values (in std::vector<RBParameter> form) across a vector of samples.
void set_value(const std::string ¶m_name, Real value)
Set the value of the specified parameter.
The libMesh namespace provides an interface to certain functionality in the library.
std::vector< Real > RBParameter
Typedef for an individual RB parameter.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real