Skip to content

Commit e8f0b6c

Browse files
authored
Merge pull request #3575 from jwpeterson/drop_n_steps_max
A few more minor improvements for multi-step RBParameters objects
2 parents 691f178 + 0118689 commit e8f0b6c

3 files changed

Lines changed: 10 additions & 18 deletions

File tree

include/reduced_basis/rb_parameters.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -284,22 +284,20 @@ class RBParameters
284284
/**
285285
* Fill \p param_names with the names of the parameters.
286286
*
287-
* \deprecated to avoid making it too easy to create copies that in
288-
* most circumstances aren't needed. If you really need a list of
289-
* the parameter names, the best approach is to iterate over this
290-
* object using the begin()/end() APIs and build a std::set that
291-
* way.
287+
* Note: this function was previously deprecated, but now that
288+
* multi-step RBParameters objects are possible, this is actually
289+
* the most efficient way to get a list of the parameter names
290+
* stored on this object.
292291
*/
293292
void get_parameter_names(std::set<std::string> & param_names) const;
294293

295294
/**
296295
* Fill \p param_names with the names of the extra parameters.
297296
*
298-
* \deprecated to avoid making it too easy to create copies that in
299-
* most circumstances aren't needed. If you really need a list of
300-
* the parameter names, the best approach is to iterate over this
301-
* object using the extra_begin()/extra_end() APIs and build a std::set that
302-
* way.
297+
* Note: this function was previously deprecated, but now that
298+
* multi-step RBParameters objects are possible, this is actually
299+
* the most efficient way to get a list of the parameter names
300+
* stored on this object.
303301
*/
304302
void get_extra_parameter_names(std::set<std::string> & param_names) const;
305303

src/reduced_basis/rb_eim_evaluation.C

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,7 @@ void RBEIMEvaluation::rb_eim_solves(const std::vector<RBParameters> & mus,
239239
{
240240
unsigned int counter = 0;
241241
for (auto mu_index : index_range(mus))
242-
// Do at least one solve even if there are no parameters (hence no steps) defined on this mu
243-
for (auto step_index : make_range(std::max(1u, mus[mu_index].n_steps())))
242+
for (auto step_index : make_range(mus[mu_index].n_steps()))
244243
{
245244
// Ignore compiler warnings about unused loop index
246245
libmesh_ignore(step_index);
@@ -278,8 +277,7 @@ void RBEIMEvaluation::rb_eim_solves(const std::vector<RBParameters> & mus,
278277
{
279278
unsigned int counter = 0;
280279
for (auto mu_index : index_range(mus))
281-
// Do at least one solve even if there are no parameters (hence no steps) defined on this mu
282-
for (auto step_index : make_range(std::max(1u, mus[mu_index].n_steps())))
280+
for (auto step_index : make_range(mus[mu_index].n_steps()))
283281
{
284282
// Ignore compiler warnings about unused loop index
285283
libmesh_ignore(step_index);

src/reduced_basis/rb_parameters.C

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,17 +192,13 @@ unsigned int RBParameters::n_steps() const
192192

193193
void RBParameters::get_parameter_names(std::set<std::string> & param_names) const
194194
{
195-
libmesh_deprecated();
196-
197195
param_names.clear();
198196
for (const auto & pr : _parameters)
199197
param_names.insert(pr.first);
200198
}
201199

202200
void RBParameters::get_extra_parameter_names(std::set<std::string> & param_names) const
203201
{
204-
libmesh_deprecated();
205-
206202
param_names.clear();
207203
for (const auto & pr : _extra_parameters)
208204
param_names.insert(pr.first);

0 commit comments

Comments
 (0)