diff --git a/python/pystencils_walberla/jinja_filters.py b/python/pystencils_walberla/jinja_filters.py index 656cd022e1132da53d248de4631bc989d2ac8110..b05eefd2297b2d3ab1f1c2e23100db3125e170e7 100644 --- a/python/pystencils_walberla/jinja_filters.py +++ b/python/pystencils_walberla/jinja_filters.py @@ -252,7 +252,7 @@ def generate_call(ctx, kernel_info, ghost_layers_to_include=0, cell_interval=Non coordinates = tuple(coordinates) kernel_call_lines.append("%s %s = %s->dataAt(%s, %s, %s, %s);" % ((param.symbol.dtype, param.symbol.name, param.field_name) + coordinates)) - if ast.assumed_inner_stride_one: + if ast.assumed_inner_stride_one and field.index_dimensions > 0: kernel_call_lines.append("WALBERLA_ASSERT_EQUAL(%s->layout(), field::fzyx);" % (param.field_name,)) elif param.is_field_stride: casted_stride = get_field_stride(param) @@ -267,7 +267,7 @@ def generate_call(ctx, kernel_info, ghost_layers_to_include=0, cell_interval=Non max_value = "%s->%sSizeWithGhostLayer()" % (field.name, ('x', 'y', 'z')[coord]) kernel_call_lines.append("WALBERLA_ASSERT_GREATER_EQUAL(%s, %s);" % (max_value, shape)) kernel_call_lines.append("const %s %s = %s;" % (type_str, param.symbol.name, shape)) - if ast.assumed_inner_stride_one: + if ast.assumed_inner_stride_one and field.index_dimensions > 0: kernel_call_lines.append("WALBERLA_ASSERT_EQUAL(%s->layout(), field::fzyx);" % (field.name,)) call_parameters = ", ".join([p.symbol.name for p in ast_params]) diff --git a/tests/field/codegen/CodegenJacobiCPU.cpp b/tests/field/codegen/CodegenJacobiCPU.cpp index dd57635d21ea75bd3b768183de8af415e8c68a90..20bc8b06116b9437de17e5967bf44e83df4100fb 100644 --- a/tests/field/codegen/CodegenJacobiCPU.cpp +++ b/tests/field/codegen/CodegenJacobiCPU.cpp @@ -56,7 +56,7 @@ void testJacobi2D() true, true, true ); // full periodicity - BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0), field::fzyx); + BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0)); // Initialize a quarter of the field with ones, the rest remains 0 // Jacobi averages the domain -> every cell should be at 0.25 at sufficiently many timesteps @@ -104,7 +104,7 @@ void testJacobi3D() true, true, true ); // no periodicity - BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0), field::fzyx); + BlockDataID fieldID = field::addToStorage<ScalarField>(blocks, "Field", real_t(0.0)); // Initialize a quarter of the field with ones, the rest remains 0 // Jacobi averages the domain -> every cell should be at 0.25 at sufficiently many timesteps diff --git a/tests/field/codegen/CodegenPoisson.cpp b/tests/field/codegen/CodegenPoisson.cpp index 4a0f7797c8d4a2a1b0e5ca37a08f9f12a9244681..f5137375a14eecb4bf79e007bef72bc1bbf089f3 100644 --- a/tests/field/codegen/CodegenPoisson.cpp +++ b/tests/field/codegen/CodegenPoisson.cpp @@ -95,10 +95,10 @@ void testPoisson() false, false, false ); // no periodicity - BlockDataID fieldID = field::addToStorage<ScalarField_T>(blocks, "Field", real_t(0.0), field::fzyx); + BlockDataID fieldID = field::addToStorage<ScalarField_T>(blocks, "Field", real_t(0.0)); initU( blocks, fieldID ); - BlockDataID fId = field::addToStorage< ScalarField_T >( blocks, "f", real_t(0.0), field::fzyx); + BlockDataID fId = field::addToStorage< ScalarField_T >( blocks, "f", real_t(0.0)); initF( blocks, fId ); typedef blockforest::communication::UniformBufferedScheme<stencil::D2Q9> CommScheme;