From df2f3c1d2e73af9f866a27dc566a897b7133d0b9 Mon Sep 17 00:00:00 2001 From: Dylan Copeland Date: Wed, 20 Mar 2024 10:45:43 -0700 Subject: [PATCH 1/2] Fixing MFEM deprecated warnings. --- examples/dmd/nonlinear_elasticity.cpp | 12 ++++++------ examples/dmd/wave_equation.cpp | 6 +++--- examples/prom/nonlinear_elasticity_global_rom.cpp | 12 ++++++------ lib/mfem/SampleMesh.cpp | 1 - 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/examples/dmd/nonlinear_elasticity.cpp b/examples/dmd/nonlinear_elasticity.cpp index fce0eecb1..e409c5b9e 100644 --- a/examples/dmd/nonlinear_elasticity.cpp +++ b/examples/dmd/nonlinear_elasticity.cpp @@ -488,8 +488,8 @@ int main(int argc, char *argv[]) dmd_x.push_back(new CAROM::DMD(x_gf.GetTrueVector().Size(), dt)); dmd_v.push_back(new CAROM::DMD(v_gf.GetTrueVector().Size(), dt)); - dmd_x[curr_window]->takeSample(x_gf.GetTrueVector(), t); - dmd_v[curr_window]->takeSample(v_gf.GetTrueVector(), t); + dmd_x[curr_window]->takeSample(x_gf.GetTrueVector().GetData(), t); + dmd_v[curr_window]->takeSample(v_gf.GetTrueVector().GetData(), t); ts.push_back(t); dmd_training_timer.Stop(); @@ -510,8 +510,8 @@ int main(int argc, char *argv[]) dmd_training_timer.Start(); - dmd_x[curr_window]->takeSample(x_gf.GetTrueVector(), t); - dmd_v[curr_window]->takeSample(v_gf.GetTrueVector(), t); + dmd_x[curr_window]->takeSample(x_gf.GetTrueVector().GetData(), t); + dmd_v[curr_window]->takeSample(v_gf.GetTrueVector().GetData(), t); if (last_step || (ti % windowNumSamples) == 0) { @@ -546,8 +546,8 @@ int main(int argc, char *argv[]) dmd_x.push_back(new CAROM::DMD(x_gf.GetTrueVector().Size(), dt)); dmd_v.push_back(new CAROM::DMD(v_gf.GetTrueVector().Size(), dt)); - dmd_x[curr_window]->takeSample(x_gf.GetTrueVector(), t); - dmd_v[curr_window]->takeSample(v_gf.GetTrueVector(), t); + dmd_x[curr_window]->takeSample(x_gf.GetTrueVector().GetData(), t); + dmd_v[curr_window]->takeSample(v_gf.GetTrueVector().GetData(), t); } } diff --git a/examples/dmd/wave_equation.cpp b/examples/dmd/wave_equation.cpp index aa0f800cb..84c98eb03 100644 --- a/examples/dmd/wave_equation.cpp +++ b/examples/dmd/wave_equation.cpp @@ -450,7 +450,7 @@ int main(int argc, char *argv[]) int curr_window = 0; vector dmd_u; dmd_u.push_back(new CAROM::DMD(u.Size(), dt)); - dmd_u[curr_window]->takeSample(u, t); + dmd_u[curr_window]->takeSample(u.GetData(), t); ts.push_back(t); dmd_training_timer.Stop(); @@ -467,7 +467,7 @@ int main(int argc, char *argv[]) fom_timer.Stop(); dmd_training_timer.Start(); - dmd_u[curr_window]->takeSample(u, t); + dmd_u[curr_window]->takeSample(u.GetData(), t); if (last_step || (ti % windowNumSamples) == 0) { @@ -488,7 +488,7 @@ int main(int argc, char *argv[]) if (!last_step) { curr_window++; dmd_u.push_back(new CAROM::DMD(u.Size(), dt)); - dmd_u[curr_window]->takeSample(u, t); + dmd_u[curr_window]->takeSample(u.GetData(), t); } } diff --git a/examples/prom/nonlinear_elasticity_global_rom.cpp b/examples/prom/nonlinear_elasticity_global_rom.cpp index 37003869d..a14e682c0 100644 --- a/examples/prom/nonlinear_elasticity_global_rom.cpp +++ b/examples/prom/nonlinear_elasticity_global_rom.cpp @@ -1203,16 +1203,16 @@ int main(int argc, char *argv[]) // IncrementalSVD is never turned on in this example and isNextSample is always true. if (x_base_only == false && basis_generator_v->isNextSample(t)) { - basis_generator_v->takeSample(vx_diff.GetBlock(0)); - basis_generator_v->computeNextSampleTime(vx_diff.GetBlock(0), + basis_generator_v->takeSample(vx_diff.GetBlock(0).GetData()); + basis_generator_v->computeNextSampleTime(vx_diff.GetBlock(0).GetData(), dvdt.GetData(), t); basis_generator_H->takeSample(oper.H_sp.GetData()); } if (basis_generator_x->isNextSample(t)) { - basis_generator_x->takeSample(vx_diff.GetBlock(1)); - basis_generator_x->computeNextSampleTime(vx_diff.GetBlock(1), + basis_generator_x->takeSample(vx_diff.GetBlock(1).GetData()); + basis_generator_x->computeNextSampleTime(vx_diff.GetBlock(1).GetData(), dxdt.GetData(), t); if (x_base_only == true) @@ -1302,7 +1302,7 @@ int main(int argc, char *argv[]) // Take samples if (x_base_only == false) { - basis_generator_v->takeSample(vx_diff.GetBlock(0)); + basis_generator_v->takeSample(vx_diff.GetBlock(0).GetData()); basis_generator_v->writeSnapshot(); delete basis_generator_v; } @@ -1311,7 +1311,7 @@ int main(int argc, char *argv[]) basis_generator_H->writeSnapshot(); delete basis_generator_H; - basis_generator_x->takeSample(vx_diff.GetBlock(1)); + basis_generator_x->takeSample(vx_diff.GetBlock(1).GetData()); basis_generator_x->writeSnapshot(); delete basis_generator_x; diff --git a/lib/mfem/SampleMesh.cpp b/lib/mfem/SampleMesh.cpp index 374649df1..944097b9a 100644 --- a/lib/mfem/SampleMesh.cpp +++ b/lib/mfem/SampleMesh.cpp @@ -1231,7 +1231,6 @@ void SampleMeshManager::ConstructSampleMesh() spaceOSSP[i+1] = spaceOSSP[i] + spfespace[i]->GetVSize(); } - sample_pmesh->ReorientTetMesh(); // re-orient the mesh, required for tets, no-op for hex sample_pmesh->EnsureNodes(); } From d1d01a3c06e9e1b7a30247ceb041b6cbe0f48684 Mon Sep 17 00:00:00 2001 From: Dylan Copeland Date: Wed, 20 Mar 2024 10:51:04 -0700 Subject: [PATCH 2/2] Style --- examples/prom/nonlinear_elasticity_global_rom.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/prom/nonlinear_elasticity_global_rom.cpp b/examples/prom/nonlinear_elasticity_global_rom.cpp index a14e682c0..f645c3558 100644 --- a/examples/prom/nonlinear_elasticity_global_rom.cpp +++ b/examples/prom/nonlinear_elasticity_global_rom.cpp @@ -1203,7 +1203,7 @@ int main(int argc, char *argv[]) // IncrementalSVD is never turned on in this example and isNextSample is always true. if (x_base_only == false && basis_generator_v->isNextSample(t)) { - basis_generator_v->takeSample(vx_diff.GetBlock(0).GetData()); + basis_generator_v->takeSample(vx_diff.GetBlock(0).GetData()); basis_generator_v->computeNextSampleTime(vx_diff.GetBlock(0).GetData(), dvdt.GetData(), t); basis_generator_H->takeSample(oper.H_sp.GetData());