Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid custom ubb #5003

Open
wants to merge 11 commits into
base: python
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,15 @@ else()
endfunction()
endif()

# mpiexec argument to disable pinning of processes to cores. Used in test suite
# as several tests are run at the same time.
if(NOT APPLE)
set(ESPRESSO_MPIEXEC_DONT_PIN --bind-to none)
else()
# not supported on Apple
set(ESPRESSO_MPIEXEC_DONT_PIN "")
endif()

#
# Boost
#
Expand Down
4 changes: 2 additions & 2 deletions maintainer/walberla_kernels/generate_lb_kernels.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def paramlist(parameters, keys):
f.write(content)

# boundary conditions
ubb_dynamic = lbmpy_espresso.UBB(
ubb_dynamic = lbmpy.boundaries.UBB(
lambda *args: None, dim=3, data_type=config.data_type.default_factory())
ubb_data_handler = lbmpy_espresso.BounceBackSlipVelocityUBB(
method.stencil, ubb_dynamic)
Expand All @@ -227,7 +227,7 @@ def paramlist(parameters, keys):
lbmpy_walberla.generate_boundary(
ctx, f"Dynamic_UBB_{precision_suffix}{target_suffix}", ubb_dynamic,
method, additional_data_handler=ubb_data_handler,
streaming_pattern=streaming_pattern, target=target)
streaming_pattern="pull", target=target)

with open(f"Dynamic_UBB_{precision_suffix}{target_suffix}.h", "r+") as f:
content = f.read()
Expand Down
35 changes: 0 additions & 35 deletions maintainer/walberla_kernels/lbmpy_espresso.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import pystencils as ps

import lbmpy.boundaries
import lbmpy.custom_code_nodes

import lbmpy_walberla.additional_data_handler

Expand Down Expand Up @@ -53,34 +49,3 @@ def data_initialisation(self, direction):
"element.vel_2 = InitialisationAdditionalData[2];",
]
return "\n".join(code)


class UBB(lbmpy.boundaries.UBB):
'''
Velocity bounce back boundary condition, enforcing specified velocity at
obstacle. This is a patched version of ``lbmpy.boundaries.UBB``, which
currently doesn't support the bounce back scheme we need.
'''

def __call__(self, f_out, f_in, dir_symbol,
inv_dir, lb_method, index_field):
'''
Modify the assignments such that the source and target pdfs are swapped.
'''
assignments = super().__call__(
f_out, f_in, dir_symbol, inv_dir, lb_method, index_field)

assert len(assignments) > 0

out = []
if len(assignments) > 1:
out.extend(assignments[:-1])

neighbor_offset = lbmpy.custom_code_nodes.NeighbourOffsetArrays.neighbour_offset(
dir_symbol, lb_method.stencil)

assignment = assignments[-1]
assert assignment.lhs.field == f_in
out.append(ps.Assignment(assignment.lhs.get_shifted(*neighbor_offset),
assignment.rhs - f_out(dir_symbol) + f_in(dir_symbol)))
return out

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// kernel generated with pystencils v1.3.3, lbmpy v1.3.3,
// lbmpy_walberla/pystencils_walberla from waLBerla commit
// b0842e1a493ce19ef1bbb8d2cf382fc343970a7f
// 04f4adbdfc0af983e2d9b72e244d775f37d77034

#pragma once
#include "core/DataTypes.h"
Expand Down
Loading