Skip to content
Snippets Groups Projects
Commit cbe69c83 authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Only set block_offsets if it is actually needed

parent faac6e65
1 merge request!2Only set block_offsets if it is actually needed
Pipeline #17234 passed with stage
in 1 minute and 15 seconds
This commit is part of merge request !2. Comments created here will be created in the context of that merge request.
......@@ -135,9 +135,15 @@ private:
void configureBlock(IBlock * block, StructuredBlockStorage * storage)
{
{{stream_collide_kernel|generate_block_data_to_field_extraction(lmIgnores+lmOffsets, no_declarations=True)|indent(8)}}
{% if need_block_offsets[0] -%}
block_offset_0 = uint32_c(storage->getBlockCellBB(*block).xMin());
{% endif -%}
{%- if need_block_offsets[1] -%}
block_offset_1 = uint32_c(storage->getBlockCellBB(*block).yMin());
{% endif -%}
{%- if need_block_offsets[2] -%}
block_offset_2 = uint32_c(storage->getBlockCellBB(*block).zMin());
{% endif %}
blockId = &block->getId();
{% if refinement_scaling -%}
......@@ -171,7 +177,7 @@ private:
currentLevel = targetLevel;
}
{% endif -%}
{% endif %}
}
// Updated by configureBlock:
......
......@@ -95,6 +95,7 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as
'target': 'cpu',
'namespace': 'lbm',
'headers': required_headers,
'need_block_offsets': ['block_offset_{}'.format(i) in [param.symbol.name for param in stream_collide_ast.get_parameters()] for i in range(3)],
}
env = Environment(loader=PackageLoader('lbmpy_walberla'))
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment