From 09eb2d23a29846df0a66bc30c7668ff3d8c214bf Mon Sep 17 00:00:00 2001 From: Helen Schottenhamml Date: Mon, 2 May 2022 16:56:01 +0200 Subject: [PATCH 1/2] Write information about pdf centering in generated LatticeModel. --- python/lbmpy_walberla/templates/LatticeModel.tmpl.h | 1 + python/lbmpy_walberla/walberla_lbm_generation.py | 1 + 2 files changed, 2 insertions(+) diff --git a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h index 39ae1afd9..25e0f0db9 100644 --- a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h +++ b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h @@ -102,6 +102,7 @@ public: static const real_t wInv[{{Q}}]; static const bool compressible = {% if compressible %}true{% else %}false{% endif %}; + static const bool zeroCentered = {% if zero_centered %}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 cb3d56f41..969477670 100644 --- a/python/lbmpy_walberla/walberla_lbm_generation.py +++ b/python/lbmpy_walberla/walberla_lbm_generation.py @@ -93,6 +93,7 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as '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, '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), -- GitLab From ca22c7daa6d6e9779ff4da9366e169355457b5d6 Mon Sep 17 00:00:00 2001 From: Helen Schottenhamml Date: Tue, 3 May 2022 10:17:07 +0200 Subject: [PATCH 2/2] Also add information about deviation of equilibrium. --- python/lbmpy_walberla/templates/LatticeModel.tmpl.h | 1 + python/lbmpy_walberla/walberla_lbm_generation.py | 1 + 2 files changed, 2 insertions(+) diff --git a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h index 25e0f0db9..a3c44c168 100644 --- a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h +++ b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h @@ -103,6 +103,7 @@ public: 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 969477670..3e43b8fe9 100644 --- a/python/lbmpy_walberla/walberla_lbm_generation.py +++ b/python/lbmpy_walberla/walberla_lbm_generation.py @@ -94,6 +94,7 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as '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), -- GitLab