Skip to content

Commit 6dd327c

Browse files
committed
Added a setter
1 parent 6fdd81b commit 6dd327c

4 files changed

Lines changed: 16 additions & 4 deletions

File tree

include/reduced_basis/rb_construction_base.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ class RBConstructionBase : public Base, public RBParametrized
106106
bool is_quiet() const
107107
{ return this->quiet_mode; }
108108

109+
/**
110+
* Set the boolean option that indicates if we normalization
111+
* solution snapshots or not.
112+
*/
113+
void set_normalize_solution_snapshots(bool value);
114+
109115
/**
110116
* Get the number of global training samples.
111117
*/
@@ -272,7 +278,7 @@ class RBConstructionBase : public Base, public RBParametrized
272278
* have differing magnitudes and we want to approximate them all with
273279
* equal accuracy.
274280
*/
275-
bool normalize_solution_snapshots;
281+
bool _normalize_solution_snapshots;
276282

277283
/**
278284
* We keep an extra temporary vector that is useful for

src/reduced_basis/rb_construction.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,7 +1453,7 @@ void RBConstruction::train_reduced_basis_with_POD()
14531453
}
14541454
libMesh::out << std::endl;
14551455

1456-
if (normalize_solution_snapshots)
1456+
if (_normalize_solution_snapshots)
14571457
{
14581458
libMesh::out << "Normalizing solution snapshots" << std::endl;
14591459
for (unsigned int i=0; i<n_snapshots; i++)

src/reduced_basis/rb_construction_base.C

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ RBConstructionBase<Base>::RBConstructionBase (EquationSystems & es,
9898
: Base(es, name_in, number_in),
9999
quiet_mode(true),
100100
serial_training_set(false),
101-
normalize_solution_snapshots(false),
101+
_normalize_solution_snapshots(false),
102102
_training_parameters_initialized(false),
103103
_first_local_index(0),
104104
_n_local_training_samples(0),
@@ -143,6 +143,12 @@ void RBConstructionBase<Base>::get_global_max_error_pair(const Parallel::Communi
143143
communicator.broadcast(error_pair.first, proc_ID_index);
144144
}
145145

146+
template <class Base>
147+
void RBConstructionBase<Base>::set_normalize_solution_snapshots(bool value)
148+
{
149+
_normalize_solution_snapshots = value;
150+
}
151+
146152
template <class Base>
147153
numeric_index_type RBConstructionBase<Base>::get_n_training_samples() const
148154
{

src/reduced_basis/rb_eim_construction.C

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ void RBEIMConstruction::set_rb_construction_parameters(unsigned int n_training_s
407407

408408
Real RBEIMConstruction::train_eim_approximation()
409409
{
410-
if (normalize_solution_snapshots)
410+
if (_normalize_solution_snapshots)
411411
apply_normalization_to_solution_snapshots();
412412

413413
if(best_fit_type_flag == POD_BEST_FIT)

0 commit comments

Comments
 (0)