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
Select Git revision

Target

Select target project
  • ravi.k.ayyala/lbmpy
  • brendan-waters/lbmpy
  • anirudh.jonnalagadda/lbmpy
  • jbadwaik/lbmpy
  • alexander.reinauer/lbmpy
  • itischler/lbmpy
  • he66coqe/lbmpy
  • ev81oxyl/lbmpy
  • Bindgen/lbmpy
  • da15siwa/lbmpy
  • holzer/lbmpy
  • RudolfWeeber/lbmpy
  • pycodegen/lbmpy
13 results
Select Git revision
Show changes
Showing
with 1242 additions and 237 deletions
File moved
......@@ -49,6 +49,9 @@ class LatticeBoltzmannStep:
default_target=target,
parallel=False)
if lbm_config:
method_parameters['stencil'] = lbm_config.stencil
if 'stencil' not in method_parameters:
method_parameters['stencil'] = LBStencil(Stencil.D2Q9) \
if data_handling.dim == 2 else LBStencil(Stencil.D3Q27)
......
from .cumulantbasedmethod import CumulantBasedLbMethod
from .galilean_correction import add_galilean_correction
from .fourth_order_correction import add_fourth_order_correction
__all__ = ['CumulantBasedLbMethod', 'add_galilean_correction', 'add_fourth_order_correction']
import sympy as sp
from pystencils.simp.subexpression_insertion import insert_subexpressions
from warnings import warn
def insert_logs(ac, **kwargs):
def callback(exp):
rhs = exp.rhs
logs = rhs.atoms(sp.log)
return len(logs) > 0
return insert_subexpressions(ac, callback, **kwargs)
def insert_log_products(ac, **kwargs):
def callback(asm):
rhs = asm.rhs
if rhs.find(sp.log):
return True
return False
return insert_subexpressions(ac, callback, **kwargs)
def expand_post_collision_central_moments(ac):
if 'post_collision_monomial_central_moments' in ac.simplification_hints:
subexpr_dict = ac.subexpressions_dict
cm_symbols = ac.simplification_hints['post_collision_monomial_central_moments']
for s in cm_symbols:
if s in subexpr_dict:
subexpr_dict[s] = subexpr_dict[s].expand()
ac = ac.copy()
ac.set_sub_expressions_from_dict(subexpr_dict)
return ac
def check_for_logarithms(ac):
logs = ac.atoms(sp.log)
if len(logs) > 0:
warn("""There are logarithms remaining in your cumulant-based collision operator!
This will let your kernel's performance and numerical accuracy deterioate severly.
Either you have disabled simplification, or it unexpectedly failed.
If the presence of logarithms is intended, please inspect the kernel to make sure
if this warning can be ignored.
Otherwise, if setting `simplification='auto'` in your optimization config does not resolve
the problem, try a different parametrization, or contact the developers.""")
This diff is collapsed.
......@@ -286,7 +286,7 @@ def _get_relaxation_rates(collision_rule):
omega_s = get_shear_relaxation_rate(method)
# if the shear relaxation rate is not specified as a symbol look for its symbolic counter part in the subs dict
for symbolic_rr, rr in method.subs_dict_relxation_rate.items():
for symbolic_rr, rr in method.subs_dict_relaxation_rate.items():
if omega_s == rr:
omega_s = symbolic_rr
......