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

pystencils_walberla: boundary generation for inner_or_boundary=False

parent 2a61063d
No related merge requests found
......@@ -39,7 +39,7 @@ def generate_boundary(generation_context, class_name, boundary_object, lb_method
else:
stencil = lb_method.stencil
stencil_info = [(i, ", ".join([str(e) for e in d])) for i, d in enumerate(stencil)]
stencil_info = [(i, d, ", ".join([str(e) for e in d])) for i, d in enumerate(stencil)]
context = {
'class_name': boundary_object.name,
......@@ -50,6 +50,7 @@ def generate_boundary(generation_context, class_name, boundary_object, lb_method
'dim': lb_method.dim,
'target': target,
'namespace': 'lbm',
'inner_or_boundary': boundary_object.inner_or_boundary
}
env = Environment(loader=PackageLoader('pystencils_walberla'), undefined=StrictUndefined)
......
......@@ -39,7 +39,7 @@ def generate_staggered_boundary(generation_context, class_name, boundary_object,
else:
stencil = neighbor_stencil
stencil_info = [(i, ", ".join([str(e) for e in d])) for i, d in enumerate(stencil)]
stencil_info = [(i, d, ", ".join([str(e) for e in d])) for i, d in enumerate(stencil)]
context = {
'class_name': boundary_object.name,
......@@ -50,6 +50,7 @@ def generate_staggered_boundary(generation_context, class_name, boundary_object,
'dim': dim,
'target': target,
'namespace': 'pystencils',
'inner_or_boundary': boundary_object.inner_or_boundary
}
env = Environment(loader=PackageLoader('pystencils_walberla'), undefined=StrictUndefined)
......@@ -91,7 +92,7 @@ def generate_staggered_flux_boundary(generation_context, class_name, boundary_ob
else:
stencil = neighbor_stencil
stencil_info = [(i, ", ".join([str(e) for e in d])) for i, d in enumerate(stencil)]
stencil_info = [(i, d, ", ".join([str(e) for e in d])) for i, d in enumerate(stencil)]
context = {
'class_name': boundary_object.name,
......@@ -102,6 +103,7 @@ def generate_staggered_flux_boundary(generation_context, class_name, boundary_ob
'dim': dim,
'target': target,
'namespace': 'pystencils',
'inner_or_boundary': boundary_object.inner_or_boundary
}
env = Environment(loader=PackageLoader('pystencils_walberla'), undefined=StrictUndefined)
......
......@@ -158,10 +158,14 @@ public:
if( ! isFlagSet(it, domainFlag) )
continue;
{%- for dirIdx, offset in stencil_info %}
{%- for dirIdx, dirVec, offset in stencil_info %}
if ( isFlagSet( it.neighbor({{offset}} {%if dim == 3%}, 0 {%endif %}), boundaryFlag ) )
{
{% if inner_or_boundary -%}
auto element = {{StructName}}(it.x(), it.y(), {%if dim == 3%} it.z(), {%endif %} {{dirIdx}} );
{% else -%}
auto element = {{StructName}}(it.x() + cell_idx_c({{dirVec[0]}}), it.y() + cell_idx_c({{dirVec[1]}}), {%if dim == 3%} it.z() + cell_idx_c({{dirVec[2]}}), {%endif %} {{dirIdx}} );
{% endif -%}
indexVectorAll.push_back( element );
if( inner.contains( it.x(), it.y(), it.z() ) )
indexVectorInner.push_back( element );
......
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