Skip to content

Commit 9d4528f

Browse files
committed
use f2 and f3 in 3D projector tests
1 parent 73eab39 commit 9d4528f

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

psydac/feec/tests/test_global_projectors.py

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,38 +339,52 @@ def test_derham_projector_3d(ncells, degree, periodic, multiplicity, verbose=Fal
339339
xgrid = np.linspace(0, 2*np.pi, num=37)
340340
vals_u0 = np.array([[[u0(x, y, z) for x in xgrid] for y in xgrid] for z in xgrid])
341341
vals_u1_1 = np.array([[[u1(x, y, z)[0] for x in xgrid] for y in xgrid] for z in xgrid])
342+
vals_u1_2 = np.array([[[u1(x, y, z)[1] for x in xgrid] for y in xgrid] for z in xgrid])
342343
vals_u2_1 = np.array([[[u2(x, y, z)[0] for x in xgrid] for y in xgrid] for z in xgrid])
344+
vals_u2_3 = np.array([[[u2(x, y, z)[2] for x in xgrid] for y in xgrid] for z in xgrid])
343345
vals_ux_1 = np.array([[[ux(x, y, z)[0] for x in xgrid] for y in xgrid] for z in xgrid])
344346
vals_u3 = np.array([[[u3(x, y, z) for x in xgrid] for y in xgrid] for z in xgrid])
345-
vals_f = np.array([[[f1(x, y, z) for x in xgrid] for y in xgrid] for z in xgrid])
347+
vals_f1 = np.array([[[f1(x, y, z) for x in xgrid] for y in xgrid] for z in xgrid])
348+
vals_f2 = np.array([[[f2(x, y, z) for x in xgrid] for y in xgrid] for z in xgrid])
349+
vals_f3 = np.array([[[f3(x, y, z) for x in xgrid] for y in xgrid] for z in xgrid])
346350

347351
# Test max-norm of error is converging with right order
348352
nc_min = min(ncells)
349353
deg_min = min(degree)
350354
error_estim = nc_min**(-deg_min-1)
351355
error_estim_low = nc_min**(-deg_min) # deg-1 for certain components
352356

353-
maxnorm_error = abs(vals_u0 - vals_f).max()
357+
maxnorm_error = abs(vals_u0 - vals_f1).max()
354358
if verbose:
355359
print(ncells, maxnorm_error / error_estim)
356360
assert maxnorm_error <= 15 * error_estim
357361

358-
maxnorm_error = abs(vals_u1_1 - vals_f).max()
362+
maxnorm_error = abs(vals_u1_1 - vals_f1).max()
359363
if verbose:
360364
print(ncells, maxnorm_error / error_estim_low)
361365
assert maxnorm_error <= 10 * error_estim_low
362366

363-
maxnorm_error = abs(vals_u2_1 - vals_f).max()
367+
maxnorm_error = abs(vals_u1_2 - vals_f2).max()
364368
if verbose:
365369
print(ncells, maxnorm_error / error_estim_low)
366370
assert maxnorm_error <= 10 * error_estim_low
367371

368-
maxnorm_error = abs(vals_u3 - vals_f).max()
372+
maxnorm_error = abs(vals_u2_1 - vals_f1).max()
369373
if verbose:
370374
print(ncells, maxnorm_error / error_estim_low)
371375
assert maxnorm_error <= 10 * error_estim_low
372376

373-
maxnorm_error = abs(vals_ux_1 - vals_f).max()
377+
maxnorm_error = abs(vals_u2_3 - vals_f3).max()
378+
if verbose:
379+
print(ncells, maxnorm_error / error_estim_low)
380+
assert maxnorm_error <= 10 * error_estim_low
381+
382+
maxnorm_error = abs(vals_u3 - vals_f1).max()
383+
if verbose:
384+
print(ncells, maxnorm_error / error_estim_low)
385+
assert maxnorm_error <= 10 * error_estim_low
386+
387+
maxnorm_error = abs(vals_ux_1 - vals_f1).max()
374388
if verbose:
375389
print(ncells, maxnorm_error / error_estim)
376390
assert maxnorm_error <= 15 * error_estim

0 commit comments

Comments
 (0)