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

fixed multiresolution test

parent 60fe35ef
No related branches found
No related tags found
1 merge request!19Resolve "Fine to coarse grid filters"
Pipeline #19953 passed
...@@ -63,6 +63,7 @@ if [ "$DO_TESTS" = true ]; then ...@@ -63,6 +63,7 @@ if [ "$DO_TESTS" = true ]; then
python "$HYSOP_DIR/operator/tests/test_transpose.py" python "$HYSOP_DIR/operator/tests/test_transpose.py"
python "$HYSOP_DIR/operator/tests/test_fd_derivative.py" python "$HYSOP_DIR/operator/tests/test_fd_derivative.py"
python "$HYSOP_DIR/operator/tests/test_absorption.py" python "$HYSOP_DIR/operator/tests/test_absorption.py"
python "$HYSOP_DIR/operator/tests/test_lowpass_filter.py"
python "$HYSOP_DIR/operator/tests/test_directional_advection.py" python "$HYSOP_DIR/operator/tests/test_directional_advection.py"
python "$HYSOP_DIR/operator/tests/test_directional_diffusion.py" python "$HYSOP_DIR/operator/tests/test_directional_diffusion.py"
python "$HYSOP_DIR/operator/tests/test_directional_stretching.py" python "$HYSOP_DIR/operator/tests/test_directional_stretching.py"
......
...@@ -94,7 +94,7 @@ class LowpassFilterFrontend(MultiComputationalGraphNodeFrontend): ...@@ -94,7 +94,7 @@ class LowpassFilterFrontend(MultiComputationalGraphNodeFrontend):
check_instance(input_topo, CartesianTopologyDescriptors) check_instance(input_topo, CartesianTopologyDescriptors)
check_instance(output_topo, CartesianTopologyDescriptors) check_instance(output_topo, CartesianTopologyDescriptors)
check_instance(base_kwds, dict, keys=str, allow_none=True) check_instance(base_kwds, dict, keys=str, allow_none=True)
#assert (input_topo != output_topo), "Same topology for input and output." assert (input_topo != output_topo), "Same topology for input and output."
super(LowpassFilterFrontend, self).__init__(input_field=input_field, input_topo=input_topo, super(LowpassFilterFrontend, self).__init__(input_field=input_field, input_topo=input_topo,
output_field=output_field, output_topo=output_topo, output_field=output_field, output_topo=output_topo,
...@@ -179,8 +179,8 @@ class LowpassFilter(ComputationalGraphNodeGenerator): ...@@ -179,8 +179,8 @@ class LowpassFilter(ComputationalGraphNodeGenerator):
kwds = self._kwds.copy() kwds = self._kwds.copy()
# if source topology is destination topology there is nothing to be done # if source topology is destination topology there is nothing to be done
#if (ttopo == stopo): if (ttopo == stopo):
#continue continue
# else we build a lowpass filter operator # else we build a lowpass filter operator
node = LowpassFilterFrontend(input_variable=(ifield,stopo), node = LowpassFilterFrontend(input_variable=(ifield,stopo),
......
...@@ -5,7 +5,8 @@ from hysop.testsenv import __ENABLE_LONG_TESTS__ ...@@ -5,7 +5,8 @@ from hysop.testsenv import __ENABLE_LONG_TESTS__
from hysop.tools.io_utils import IO from hysop.tools.io_utils import IO
from hysop.tools.numpywrappers import npw from hysop.tools.numpywrappers import npw
from hysop.tools.types import first_not_None from hysop.tools.types import first_not_None
from hysop.operator.multiresolution_filter import MultiresolutionFilter from hysop.operator.spatial_filtering import LowpassFilter
from hysop.methods import FilteringMethod
from hysop.topology.cartesian_topology import CartesianTopology from hysop.topology.cartesian_topology import CartesianTopology
from hysop.constants import implementation_to_backend, Implementation, HYSOP_REAL from hysop.constants import implementation_to_backend, Implementation, HYSOP_REAL
from hysop.tools.parameters import CartesianDiscretization from hysop.tools.parameters import CartesianDiscretization
...@@ -86,14 +87,13 @@ class TestMultiresolutionFilter(object): ...@@ -86,14 +87,13 @@ class TestMultiresolutionFilter(object):
backend=implementation_to_backend(impl), backend=implementation_to_backend(impl),
discretization=CartesianDiscretization(shape_c, default_boundaries=True), discretization=CartesianDiscretization(shape_c, default_boundaries=True),
mpi_params=mpi_params) mpi_params=mpi_params)
base_kwds = dict(variable=f, implementation=impl, base_kwds = dict(implementation=impl,
name='multiresolution_filter_{}'.format(str(impl).lower())) name='multiresolution_filter_{}'.format(str(impl).lower()),
filtering_method=FilteringMethod.SUBGRID)
if impl is Implementation.PYTHON: if impl is Implementation.PYTHON:
msg=' *Python: ' msg=' *Python: '
print msg, print msg,
yield MultiresolutionFilter( yield LowpassFilter(input_variables={f: topo_f}, output_variables={f: topo_c}, **base_kwds)
source_topo=topo_f, target_topo=topo_c,
**base_kwds)
print print
else: else:
msg='Unknown implementation to test {}.'.format(impl) msg='Unknown implementation to test {}.'.format(impl)
...@@ -109,7 +109,7 @@ class TestMultiresolutionFilter(object): ...@@ -109,7 +109,7 @@ class TestMultiresolutionFilter(object):
dout.initialize(self.__f_init) dout.initialize(self.__f_init)
Fref = tuple(data.get().handle.copy() for data in dout.data) Fref = tuple(data.get().handle.copy() for data in dout.data)
dout.initialize(self.__random_init) dout.initialize(self.__random_init)
op.apply() op.apply(simulation=None)
Fout = tuple(data.get().handle.copy() for data in dout.data) Fout = tuple(data.get().handle.copy() for data in dout.data)
msg0 = 'Reference field {} is not finite.' msg0 = 'Reference field {} is not finite.'
......
...@@ -26,7 +26,6 @@ from hysop.operator.vorticity_absorption import VorticityAbsorption ...@@ -26,7 +26,6 @@ from hysop.operator.vorticity_absorption import VorticityAbsorption
from hysop.operator.dummy import Dummy from hysop.operator.dummy import Dummy
from hysop.operator.custom import CustomOperator from hysop.operator.custom import CustomOperator
from hysop.operator.convergence import Convergence from hysop.operator.convergence import Convergence
from hysop.operator.multiresolution_filter import MultiresolutionFilter
from hysop.operator.spatial_filtering import LowpassFilter from hysop.operator.spatial_filtering import LowpassFilter
from hysop.operator.derivative import SpaceDerivative, \ from hysop.operator.derivative import SpaceDerivative, \
......
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