Skip to content

Commit 2e28835

Browse files
committed
Add RBParameters::push_back_extra_value()
Again, we already had this support for "normal" parameters, so makes sense to add it for "extra" parameters as well.
1 parent 1db4bc8 commit 2e28835

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

include/reduced_basis/rb_parameters.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ class RBParameters
232232
*/
233233
void push_back_value(const std::string & param_name, Real value);
234234

235+
/**
236+
* Same as push_back_value(), but for "extra" parameters.
237+
*/
238+
void push_back_extra_value(const std::string & param_name, Real value);
239+
235240
/**
236241
* Get the value of the specified extra parameter, throwing an error
237242
* if it does not exist.

src/reduced_basis/rb_parameters.C

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,13 @@ void RBParameters::push_back_value(const std::string & param_name, Real value)
139139
_parameters[param_name].push_back(value);
140140
}
141141

142+
void RBParameters::push_back_extra_value(const std::string & param_name, Real value)
143+
{
144+
// Get reference to vector of values for this extra parameter, creating it
145+
// if it does not already exist, and push back the specified value.
146+
_extra_parameters[param_name].push_back(value);
147+
}
148+
142149
Real RBParameters::get_extra_value(const std::string & param_name) const
143150
{
144151
// Same as get_value(param_name) but for the map of extra parameters

0 commit comments

Comments
 (0)