Skip to content
Snippets Groups Projects
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
Branches
Tags release/0.2.5
1 merge request!2Only set block_offsets if it is actually needed
Pipeline #17669 passed with stage
in 6 minutes and 40 seconds
...@@ -135,9 +135,15 @@ private: ...@@ -135,9 +135,15 @@ private:
void configureBlock(IBlock * block, StructuredBlockStorage * storage) void configureBlock(IBlock * block, StructuredBlockStorage * storage)
{ {
{{stream_collide_kernel|generate_block_data_to_field_extraction(lmIgnores+lmOffsets, no_declarations=True)|indent(8)}} {{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()); block_offset_0 = uint32_c(storage->getBlockCellBB(*block).xMin());
{% endif -%}
{%- if need_block_offsets[1] -%}
block_offset_1 = uint32_c(storage->getBlockCellBB(*block).yMin()); block_offset_1 = uint32_c(storage->getBlockCellBB(*block).yMin());
{% endif -%}
{%- if need_block_offsets[2] -%}
block_offset_2 = uint32_c(storage->getBlockCellBB(*block).zMin()); block_offset_2 = uint32_c(storage->getBlockCellBB(*block).zMin());
{% endif %}
blockId = &block->getId(); blockId = &block->getId();
{% if refinement_scaling -%} {% if refinement_scaling -%}
...@@ -171,7 +177,7 @@ private: ...@@ -171,7 +177,7 @@ private:
currentLevel = targetLevel; currentLevel = targetLevel;
} }
{% endif -%} {% endif %}
} }
// Updated by configureBlock: // Updated by configureBlock:
......
...@@ -95,6 +95,7 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as ...@@ -95,6 +95,7 @@ def __lattice_model(generation_context, class_name, lb_method, stream_collide_as
'target': 'cpu', 'target': 'cpu',
'namespace': 'lbm', 'namespace': 'lbm',
'headers': required_headers, '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')) 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