From f0bd64c882ea561242c07108b12b66fb94dd33f9 Mon Sep 17 00:00:00 2001 From: Markus Holzer <markus.holzer@fau.de> Date: Wed, 16 Jun 2021 16:14:00 +0000 Subject: [PATCH] Add include guards --- python/lbmpy_walberla/templates/LatticeModel.tmpl.h | 4 ++-- python/lbmpy_walberla/walberla_lbm_generation.py | 4 ++++ python/pystencils_walberla/codegen.py | 4 +++- python/pystencils_walberla/templates/Boundary.tmpl.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h index df188fa32..a80049bea 100644 --- a/python/lbmpy_walberla/templates/LatticeModel.tmpl.h +++ b/python/lbmpy_walberla/templates/LatticeModel.tmpl.h @@ -17,7 +17,7 @@ // //====================================================================================================================== - +#pragma once #include "core/DataTypes.h" #include "core/logging/Logging.h" @@ -97,7 +97,7 @@ class {{class_name}} public: typedef stencil::{{stencil_name}} Stencil; - typedef stencil::{{stencil_name}} CommunicationStencil; + typedef stencil::{{communication_stencil_name}} CommunicationStencil; static const real_t w[{{Q}}]; static const real_t wInv[{{Q}}]; diff --git a/python/lbmpy_walberla/walberla_lbm_generation.py b/python/lbmpy_walberla/walberla_lbm_generation.py index 698843f3b..936fcae85 100644 --- a/python/lbmpy_walberla/walberla_lbm_generation.py +++ b/python/lbmpy_walberla/walberla_lbm_generation.py @@ -30,6 +30,9 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as stencil_name = get_stencil_name(lb_method.stencil) if not stencil_name: raise ValueError("lb_method uses a stencil that is not supported in waLBerla") + + + communication_stencil_name = stencil_name if stencil_name != "D3Q15" else "D3Q27" is_float = not generation_context.double_accuracy dtype_string = "float32" if is_float else "float64" @@ -86,6 +89,7 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as jinja_context = { 'class_name': class_name, 'stencil_name': stencil_name, + 'communication_stencil_name': communication_stencil_name, 'D': lb_method.dim, 'Q': len(lb_method.stencil), 'compressible': lb_method.conserved_quantity_computation.compressible, diff --git a/python/pystencils_walberla/codegen.py b/python/pystencils_walberla/codegen.py index 27773a7e4..5c2667342 100644 --- a/python/pystencils_walberla/codegen.py +++ b/python/pystencils_walberla/codegen.py @@ -424,7 +424,9 @@ def get_vectorize_instruction_set(generation_context): if supported_instruction_sets: return supported_instruction_sets[-1] else: # if cpuinfo package is not installed - warnings.warn("Could not obtain supported vectorization instruction sets - defaulting to sse") + warnings.warn("Could not obtain supported vectorization instruction sets - defaulting to sse. "\ + "This problem can probably be fixed by installing py-cpuinfo. This package can "\ + "gather the needed hardware information.") return 'sse' else: return None diff --git a/python/pystencils_walberla/templates/Boundary.tmpl.h b/python/pystencils_walberla/templates/Boundary.tmpl.h index e22d96a79..57630039f 100644 --- a/python/pystencils_walberla/templates/Boundary.tmpl.h +++ b/python/pystencils_walberla/templates/Boundary.tmpl.h @@ -17,6 +17,7 @@ //! \\author pystencils //====================================================================================================================== +#pragma once #include "core/DataTypes.h" {% if target is equalto 'cpu' -%} -- GitLab