Skip to content

Commit 9621fad

Browse files
committed
Compute L2 error.
1 parent a879785 commit 9621fad

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

miniapps/tools/reconstruction_lor.cpp

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

211211
P1.Mult(rho_lo, rho_im); // rho_im = P1 * rho
212212

213-
real_t mass_im = compute_mass(&fespace_im, -1.0, dc_im, "P1(LO) ");
213+
real_t mass_im = compute_mass(&fespace_im, -1.0, dc_im, "IM=P1(LO) ");
214214
if (vis) { visualize(dc_im, "IM=P1(LO)", Wx, Wy, visport); Wx += offx; }
215215

216216
// STEP3: Prolongation 2 (IM->HO)
217217

218218
P2.Mult(rho_im, rho_hi); // rho_hi = P2 * rho_im
219-
real_t mass_hi = compute_mass(&fespace_hi, -1.0, dc_hi, "P2(IM) ");
219+
real_t mass_hi = compute_mass(&fespace_hi, -1.0, dc_hi, "HO=P2(IM) ");
220220
if (vis) { visualize(dc_hi, "HO=P2(IM)", Wx, Wy, visport); Wx += offx; }
221221

222222
// ======================================================
@@ -226,9 +226,9 @@ int main(int argc, char *argv[])
226226

227227
GridFunction rho_error = rho_hi;
228228
rho_error -= rho_ex;
229-
real_t error = rho_error.Normlinf();
230229
cout.precision(12);
231-
cout << "|HO - EX|_∞ = " << error << endl;
230+
cout << "|HO - EX|_∞ = " << rho_error.Normlinf() << endl;
231+
cout << "|HO - EX|_{L^2} = " << rho_error.Norml2() << endl;
232232

233233
delete gt1;
234234
delete gt2;

0 commit comments

Comments
 (0)