From cb65ca4741bc528212dc5a9188020a2f1f9473f4 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr> Date: Tue, 28 Jul 2020 16:19:33 +0200 Subject: [PATCH] restored ./hysop/operator/tests/test_velocity_correction.py to 6f3f3a18 --- hysop/operator/tests/test_velocity_correction.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hysop/operator/tests/test_velocity_correction.py b/hysop/operator/tests/test_velocity_correction.py index 8d461caa8..b1aec222c 100644 --- a/hysop/operator/tests/test_velocity_correction.py +++ b/hysop/operator/tests/test_velocity_correction.py @@ -15,7 +15,6 @@ from hysop.parameters.scalar_parameter import ScalarParameter, TensorParameter from hysop.operator.flowrate_correction import FlowRateCorrection from hysop.constants import Implementation import numpy as np -pi = np.pi from hysop import Field, Box @@ -89,7 +88,7 @@ class TestFlowRateCorrection(object): high=size_max+1, size=dim).tolist()) - domain = Box(length=(2*pi,)*dim) + domain = Box(length=(1,)*dim) velo = Field(domain=domain, name='velo', dtype=dtype, nb_components=3, register_object=False) vorti = Field(domain=domain, name='vorti', dtype=dtype, @@ -162,7 +161,7 @@ class TestFlowRateCorrection(object): spaceStep = mesh.space_step sl = [_ for _ in mesh.local_compute_slices] sl[-1] = mesh.point_local_indices((0., 0., 0.))[-1] - flowrate = np.asarray([np.sum(_[tuple(sl)]) for _ in Fout]) + flowrate = np.asarray([np.sum(_[tuple(sl)]) for _ in Fout[::-1]]) flowrate *= np.prod(spaceStep[0:2]) dist = npw.abs(flowrate-self.flowrate()) dinf = npw.max(dist) @@ -174,7 +173,7 @@ class TestFlowRateCorrection(object): print print 'Test output comparisson failed for flowrate:' print ' *dinf={} ({} eps)'.format(dinf, deps) - print ' *flowrate={} ({})'.format(flowrate, self.flowrate()) + print ' *flowrate={} ({})'.format(flowrate, ref_flowrate) print msg = 'Test failed on flowrate for implementation {}.'.format(impl) raise RuntimeError(msg) -- GitLab