Skip to content

Commit 26555d1

Browse files
committed
bug fixes
1 parent 684a039 commit 26555d1

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

rom/laghos.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ int main(int argc, char *argv[])
395395

396396
romOptions.hyperreductionSamplingType = getHyperreductionSamplingType(hyperreductionSamplingType);
397397
romOptions.use_sample_mesh = romOptions.hyperreduce && (romOptions.hyperreductionSamplingType != eqp
398-
|| romOptions.hyperreductionSamplingType != eqp_energy);
398+
&& romOptions.hyperreductionSamplingType != eqp_energy);
399399

400400
MFEM_VERIFY(!(romOptions.SNS) || (romOptions.hyperreductionSamplingType != eqp &&
401401
romOptions.hyperreductionSamplingType != eqp_energy),
@@ -1004,14 +1004,14 @@ int main(int argc, char *argv[])
10041004
LagrangianHydroOperator* oper = NULL;
10051005
if (fom_data)
10061006
{
1007-
const bool noMassSolve = rom_online && (romOptions.hyperreductionSamplingType == eqp);
1007+
const bool noMassSolve = rom_online && (romOptions.hyperreductionSamplingType == eqp || romOptions.hyperreductionSamplingType == eqp_energy);
10081008
oper = new LagrangianHydroOperator(S->Size(), *H1FESpace, *L2FESpace,
10091009
ess_tdofs, *rho, source, cfl,
10101010
mat_gf_coeff, visc, vort, p_assembly,
10111011
cg_tol, cg_max_iter, ftz_tol,
10121012
H1FEC.GetBasisType(), noMassSolve,
10131013
noMassSolve,
1014-
rom_online && (romOptions.hyperreductionSamplingType == eqp));
1014+
rom_online && (romOptions.hyperreductionSamplingType == eqp || romOptions.hyperreductionSamplingType == eqp_energy));
10151015
}
10161016

10171017
socketstream* vis_rho = NULL;
@@ -1581,11 +1581,11 @@ int main(int argc, char *argv[])
15811581
romOper[0]->ApplyHyperreduction(romS);
15821582
}
15831583

1584-
// TODO: do we want that for the energy-conserving EQP?
1585-
if (rom_online && romOptions.hyperreduce && romOptions.hyperreductionSamplingType == eqp_energy)
1586-
{
1587-
romOper[0]->ApplyHyperreduction(romS);
1588-
}
1584+
// // TODO: do we want that for the energy-conserving EQP?
1585+
// if (rom_online && romOptions.hyperreduce && romOptions.hyperreductionSamplingType == eqp_energy)
1586+
// {
1587+
// romOper[0]->ApplyHyperreduction(romS);
1588+
// }
15891589

15901590
double windowEndpoint = 0.0;
15911591
double windowOverlapMidpoint = 0.0;
@@ -2058,10 +2058,10 @@ int main(int argc, char *argv[])
20582058
romOper[romOptions.window]->ApplyHyperreduction(romS);
20592059
}
20602060

2061-
if (romOptions.hyperreduce && romOptions.hyperreductionSamplingType == eqp_energy)
2062-
{
2063-
romOper[romOptions.window]->ApplyHyperreduction(romS);
2064-
}
2061+
//if (romOptions.hyperreduce && romOptions.hyperreductionSamplingType == eqp_energy)
2062+
//{
2063+
// romOper[romOptions.window]->ApplyHyperreduction(romS);
2064+
//}
20652065

20662066
if (problem == 7 && romOptions.indicatorType == penetrationDistance)
20672067
{
@@ -2109,7 +2109,7 @@ int main(int argc, char *argv[])
21092109
<< sqrt(tot_norm) << endl;
21102110
}
21112111

2112-
if (romOptions.hyperreduce && romOptions.hyperreductionSamplingType == eqp_energy)
2112+
if (romOptions.hyperreductionSamplingType == eqp_energy)
21132113
{
21142114
double energy_total, energy_diff;
21152115
energy_total = oper->InternalEnergy(*e_gf) +

rom/laghos_rom.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2808,7 +2808,12 @@ ROM_Operator::ROM_Operator(ROM_Options const& input, ROM_Basis *b,
28082808
ComputeReducedMv();
28092809
ComputeReducedMe();
28102810

2811+
// Read the same data twice, because different variables are used
2812+
// when solving the velocity and energy problems (due to the way this
2813+
// is done for basic EQP). In this way, minimal changes to the code
2814+
// are needed.
28112815
ReadSolutionNNLS(input, "run/nnlsEC", eqpI, eqpW);
2816+
ReadSolutionNNLS(input, "run/nnlsEC", eqpI_E, eqpW_E);
28122817
}
28132818
}
28142819

@@ -4907,7 +4912,7 @@ void ROM_Operator::ForceIntegratorEQP_E_FOM(Vector const& v, Vector & rhs,
49074912
{
49084913
Vector res(basis->GetDimE());
49094914

4910-
ForceIntegratorEQP_E(v, res);
4915+
ForceIntegratorEQP_E(v, res, energy_conserve);
49114916
basis->LiftROMtoFOM_dEdt(res, rhs);
49124917
}
49134918

0 commit comments

Comments
 (0)