Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
Commits on Source (2)
"""Tests velocity and stress fluctuations for thermalized LB"""
import warnings
import pytest
import pystencils as ps
from pystencils import get_code_str
from pystencils.backends.simd_instruction_sets import get_supported_instruction_sets, get_vector_instruction_set
from pystencils.cpu.cpujit import get_compiler_config
from pystencils.enums import Target
from pystencils.rng import PhiloxTwoDoubles
from lbmpy.creationfunctions import *
from lbmpy.forcemodels import Guo
from lbmpy.macroscopic_value_kernels import macroscopic_values_setter
......@@ -8,13 +17,6 @@ import numpy as np
from lbmpy.enums import Stencil
from lbmpy.moments import is_bulk_moment, is_shear_moment, get_order
from lbmpy.stencils import LBStencil
from pystencils.rng import PhiloxTwoDoubles
import pytest
from pystencils import get_code_str
from pystencils.backends.simd_instruction_sets import get_supported_instruction_sets, get_vector_instruction_set
from pystencils.cpu.cpujit import get_compiler_config
from pystencils.enums import Target
def _skip_instruction_sets_windows(instruction_sets):
......@@ -294,13 +296,11 @@ def test_vectorization(data_type, assume_aligned, assume_inner_stride_one, assum
)
if not assume_inner_stride_one and 'storeS' not in get_vector_instruction_set(data_type, instruction_set):
with pytest.warns(UserWarning) as warn:
with pytest.warns(UserWarning) as pytest_warnings:
ast = ps.create_kernel(collision, config=config)
assert 'Could not vectorize loop' in warn[0].message.args[0]
assert 'Could not vectorize loop' in pytest_warnings[0].message.args[0]
else:
with pytest.warns(None) as warn:
ast = ps.create_kernel(collision, config=config)
assert len(warn) == 0
ast = ps.create_kernel(collision, config=config)
ast.compile()
code = get_code_str(ast)
print(code)
......
......@@ -24,7 +24,7 @@ force_models = [f for f in ForceModel if f is not ForceModel.CENTRALMOMENT]
def test_total_momentum(method_enum, zero_centered, force_model, omega):
if method_enum == Method.CUMULANT and \
force_model not in (ForceModel.SIMPLE, ForceModel.LUO, ForceModel.GUO, ForceModel.HE):
return True
return
L = (16, 16)
stencil = LBStencil(Stencil.D2Q9)
......@@ -308,7 +308,7 @@ def test_symmetric_forcing_equivalence(force_model, compressible):
nested_moments=moment_polys, compressible=True, force_model=force_model, force=tuple(F))
method = create_lb_method(lbm_config=lbm_config)
if not method.force_model.has_symmetric_central_moment_forcing:
return True
return
subs_dict = method.subs_dict_relaxation_rate
force_moments = method.force_model.central_moment_space_forcing(method)
......