Skip to content

Commit f48df01

Browse files
committed
Fixed compilation errors.
1 parent 168fcc0 commit f48df01

File tree

1 file changed

+10
-17
lines changed

1 file changed

+10
-17
lines changed

miniapps/tools/reconstruction.cpp

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ std::unordered_map<std::string, profile_t> GetFieldProfiles();
2222

2323
int main(int argc, char* argv[])
2424
{
25-
Mpi::Init(argc, argv);
26-
2725
// Default command-line options
2826
std::string lor_method = "element_average_reconstruction"; // "element_average_reconstruction" or "l2_projection"
2927
int refinement_levels = 0;
@@ -168,11 +166,11 @@ int main(int argc, char* argv[])
168166
gt1.UseEA(use_ea);
169167
gt2.UseEA(use_ea);
170168

171-
const Operator &P1 = gt1.BackwardOperator(); // Prolongation 1 (LO->IM)
172-
const Operator &P2 = gt2.ForwardOperator(); // Prolongation 2 (IM->HO)
169+
[[maybe_unused]] const Operator &P1 = gt1.BackwardOperator(); // Prolongation 1 (LO->IM)
170+
[[maybe_unused]] const Operator &P2 = gt2.ForwardOperator(); // Prolongation 2 (IM->HO)
173171

174-
const Operator &R1 = gt1.ForwardOperator(); // Restriction 1 (IM->LO)
175-
const Operator &R2 = gt2.BackwardOperator(); // Restriction 2 (HO->IM)
172+
[[maybe_unused]] const Operator &R1 = gt1.ForwardOperator(); // Restriction 1 (IM->LO)
173+
[[maybe_unused]] const Operator &R2 = gt2.BackwardOperator(); // Restriction 2 (HO->IM)
176174

177175
// STEP1: L2 projection of RHO onto u_lo
178176
SparseMatrix &M_mat_lo = M_lo.SpMat();
@@ -210,13 +208,8 @@ int main(int argc, char* argv[])
210208

211209
real_t error = u_hi.ComputeL2Error(u_function_exact);
212210

213-
if (Mpi::Root())
214-
{
215-
mfem::out.precision(16);
216-
mfem::out << "|| u_h - u ||_{L^2} = \n" << error << std::endl;
217-
}
218-
219-
Mpi::Finalize();
211+
mfem::out.precision(16);
212+
mfem::out << "|| u_h - u ||_{L^2} = \n" << error << std::endl;
220213

221214
return 0;
222215
}
@@ -272,9 +265,7 @@ std::unordered_map<std::string, profile_t> GetFieldProfiles()
272265

273266
void L2Reconstruction(const GridFunction& src, GridFunction& dst)
274267
{
275-
const real_t RTOL = 1.0e-5;
276-
277-
Mesh *mesh = dst.FESpace()->GetMesh();
268+
// Mesh *mesh = dst.FESpace()->GetMesh();
278269
FiniteElementSpace *fes = dst.FESpace();
279270
NCMesh *ncmesh = fes->GetMesh()->ncmesh;
280271

@@ -396,7 +387,7 @@ void L2Reconstruction(const GridFunction& src, GridFunction& dst)
396387
trans.Transform(int_point_average, tmp);
397388
mfem::out << "Current element: ";
398389
tmp.Print();
399-
for (int i=0; i < alphas.size(); i++)
390+
for (int i=0; i < (int)alphas.size(); i++)
400391
{
401392
mfem::out << "Neighbor element: ";
402393
centers[i].Print();
@@ -417,6 +408,7 @@ void L2Reconstruction(const GridFunction& src, GridFunction& dst)
417408

418409
// TODO: Delete the remaining code if not used
419410

411+
#ifdef MFEM_USE_MPI
420412
// Special integrator for the second derivative
421413
class MixedBidirectionalHessianIntegrator : public MixedScalarIntegrator
422414
{
@@ -577,4 +569,5 @@ void reconstructField(const ParGridFunction& src, ParGridFunction& dst)
577569
}
578570
dst.ExchangeFaceNbrData();
579571
}
572+
#endif
580573

0 commit comments

Comments
 (0)