Commit 9d786d66 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'walberla_fluctuating' into 'master'

Only set block_offsets if it is actually needed

See merge request !2
parents b447f5e5 cbe69c83
Pipeline #17669 passed with stage
in 6 minutes and 40 seconds
......@@ -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'))
......
Markdown is supported
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