Skip to content

Commit 114b6d1

Browse files
committed
review #1 changes
1 parent 90327af commit 114b6d1

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

rom/laghos_rom.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,15 +1117,15 @@ void ROM_Sampler::Finalize(Array<int> &cutoff, ROM_Options& input)
11171117
CAROM::Matrix *tBasisE = basisE->getFirstNColumns(cutoff[2]);
11181118

11191119
// Form the energy identity and replace the last basis vector by it.
1120-
Vector unitE(input.tL2size);
1120+
Vector unitE(tL2size);
11211121

11221122
// TODO: my understanding is that the "=" opetaror is overloaded, so
11231123
// that, by setting unitE = 1.0, the vector unitE contains the coeffs
11241124
// that result in the summed function being 1.0 on the grid points.
11251125
// Is that correct?
11261126
unitE = 1.0;
11271127

1128-
for (int i = 0; i < input.tL2size; i++)
1128+
for (int i = 0; i < tL2size; i++)
11291129
{
11301130
// TODO: I believe I can access the last column in this way,
11311131
// without having to use pointer arithmetic, right?
@@ -4899,3 +4899,8 @@ void ROM_Operator::StepRK2Avg(Vector &S, double &t, double &dt) const
48994899

49004900
t += dt;
49014901
}
4902+
4903+
HyperreductionSamplingType ROM_Operator::getSamplingType() const
4904+
{
4905+
return hyperreductionSamplingType;
4906+
}

rom/laghos_rom.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,8 @@ class ROM_Operator : public TimeDependentOperator
12351235
void ForceIntegratorEQP_E(Vector const& v, Vector & res,
12361236
bool energy_conserve = false) const;
12371237

1238+
HyperreductionSamplingType getSamplingType() const;
1239+
12381240
~ROM_Operator()
12391241
{
12401242
delete mat_gf_coeff;

rom/laghos_solver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ void LagrangianHydroOperator::SolveVelocity(const Vector &S,
279279
{
280280
// TODO: this function doesn't have access to the hyperreduction
281281
// sampling type; how should I resolve this?
282-
rom_op->ForceIntegratorEQP_FOM(rhs, hyperreduction.SamplingType == eqp_energy);
282+
rom_op->ForceIntegratorEQP_FOM(rhs, rom_op->getSamplingType() == eqp_energy);
283283
}
284284
else
285285
{
@@ -412,7 +412,7 @@ void LagrangianHydroOperator::SolveEnergy(const Vector &S, const Vector &v,
412412
{
413413
// TODO: this function doesn't have access to the hyperreduction
414414
// sampling type; how should I resolve this?
415-
rom_op->ForceIntegratorEQP_E_FOM(v, e_rhs, hyperreduction.SamplingType == eqp_energy);
415+
rom_op->ForceIntegratorEQP_E_FOM(v, e_rhs, rom_op->getSamplingType() == eqp_energy);
416416
}
417417
else
418418
{

0 commit comments

Comments
 (0)