From 9dcd0dd90f50f7b64b0a38bb06327854463fdafd Mon Sep 17 00:00:00 2001 From: Helen Schottenhamml <helen.schottenhamml@fau.de> Date: Tue, 31 May 2022 10:04:56 +0200 Subject: [PATCH] Pdf centering information in codegen --- python/lbmpy_walberla/templates/LatticeModel.tmpl.h | 2 ++ python/lbmpy_walberla/walberla_lbm_generation.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h index d1e299578..677be5002 100644 --- a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h +++ b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h @@ -103,6 +103,8 @@ public: static const {{dtype}} wInv[{{Q}}]; static const bool compressible = {% if compressible %}true{% else %}false{% endif %}; + static const bool zeroCentered = {% if zero_centered %}true{% else %}false{% endif %}; + static const bool equilibriumDeviationOnly = {% if equilibrium_deviation_only %}true{% else %}false{% endif %}; class Sweep { diff --git a/python/lbmpy_walberla/walberla_lbm_generation.py b/python/lbmpy_walberla/walberla_lbm_generation.py index 8eda3e76f..8566d3915 100644 --- a/python/lbmpy_walberla/walberla_lbm_generation.py +++ b/python/lbmpy_walberla/walberla_lbm_generation.py @@ -114,6 +114,8 @@ def __lattice_model(generation_context, class_name, config, lb_method, stream_co 'D': lb_method.stencil.D, 'Q': lb_method.stencil.Q, 'compressible': lb_method.conserved_quantity_computation.compressible, + 'zero_centered': lb_method.conserved_quantity_computation.zero_centered_pdfs, + 'equilibrium_deviation_only': lb_method.equilibrium_distribution.deviation_only, 'weights': ",".join(str(w.evalf()) + constant_suffix for w in lb_method.weights), 'inverse_weights': ",".join(str((1 / w).evalf()) + constant_suffix for w in lb_method.weights), 'dtype': "float" if is_float else "double", -- GitLab