Skip to content

Commit 1cbec2c

Browse files
authored
Merge pull request #3573 from jwpeterson/debug_multistep_rb_eim
Fix issue with indexing into output_all_comps array
2 parents 7436c41 + 72ca5cd commit 1cbec2c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/reduced_basis/rb_eim_evaluation.C

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -242,19 +242,19 @@ void RBEIMEvaluation::rb_eim_solves(const std::vector<RBParameters> & mus,
242242
// Do at least one solve even if there are no parameters (hence no steps) defined on this mu
243243
for (auto step_index : make_range(std::max(1u, mus[mu_index].n_steps())))
244244
{
245+
// Ignore compiler warnings about unused loop index
246+
libmesh_ignore(step_index);
247+
245248
evaluated_values_at_interp_points[counter].resize(N); // N is number of RB basis functions
246249

247250
for (unsigned int interp_pt_index=0; interp_pt_index<N; interp_pt_index++)
248251
{
249252
unsigned int comp = _interpolation_points_comp[interp_pt_index];
250253

251-
// For vector-valued functions, the output_all_comps vectors are indexed first by component, then by step.
252-
// For example, if there are 2 components and 3 steps, the output entries will be:
253-
// [(comp0, step0), (comp1, step0), (comp0, step1), (comp1, step1), (comp0, step2), (comp1, step2)]
254-
// To index into this vector, we need to know the current step_index and the total number of components:
255-
// index = get_parametrized_function().get_n_components() * step_index + comp
254+
// This line of code previously used "mu_index", now we use
255+
// "counter" handle the multi-step RBParameters case.
256256
evaluated_values_at_interp_points[counter][interp_pt_index] =
257-
output_all_comps[mu_index][interp_pt_index][get_parametrized_function().get_n_components() * step_index + comp];
257+
output_all_comps[counter][interp_pt_index][comp];
258258
}
259259

260260
counter++;

0 commit comments

Comments
 (0)