Skip to content
Snippets Groups Projects
Commit cb65ca47 authored by Jean-Baptiste Keck's avatar Jean-Baptiste Keck
Browse files

restored ./hysop/operator/tests/test_velocity_correction.py to 6f3f3a18

parent 34e4f2ea
1 merge request!16MPI operators
Pipeline #47573 passed
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment