Skip to content
Snippets Groups Projects
Commit 2d71e942 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Merge branch 'FixMaster' into 'master'

[Fix] Warning filter in fluctuating LB test

See merge request !157
parents d193fd9d eb087390
Branches
Tags
1 merge request!157[Fix] Warning filter in fluctuating LB test
Pipeline #57041 passed with stages
in 26 minutes and 49 seconds
"""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)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment