Skip to content
Snippets Groups Projects
Commit 690183aa authored by Markus Holzer's avatar Markus Holzer
Browse files

Updated tutorial 02

parent 3e457f65
No related merge requests found
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "geometry/all.h" #include "geometry/all.h"
#include "lbm/boundary/factories/DefaultBoundaryHandling.h" #include "lbm/boundary/factories/DefaultBoundaryHandling.h"
#include "lbm/communication/PdfFieldPackInfo.h"
#include "lbm/field/AddToStorage.h" #include "lbm/field/AddToStorage.h"
#include "lbm/field/PdfField.h" #include "lbm/field/PdfField.h"
#include "lbm/field/initializer/all.h" #include "lbm/field/initializer/all.h"
......
This diff is collapsed.
Parameters Parameters
{ {
omega 1.8; omega 1.8;
timesteps 10000; timesteps 10000;
remainingTimeLoggerFrequency 3; // in seconds remainingTimeLoggerFrequency 3; // in seconds
...@@ -35,7 +35,7 @@ StabilityChecker ...@@ -35,7 +35,7 @@ StabilityChecker
Boundaries Boundaries
{ {
Border { direction S,N; walldistance -1; NoSlip {} } Border { direction S, N; walldistance -1; NoSlip {} }
} }
......
...@@ -9,28 +9,30 @@ from lbmpy_walberla import generate_lattice_model ...@@ -9,28 +9,30 @@ from lbmpy_walberla import generate_lattice_model
# General Parameters # General Parameters
# ======================== # ========================
STENCIL = 'D2Q9' stencil = 'D2Q9'
OMEGA = sp.Symbol('omega') omega = sp.Symbol('omega')
LAYOUT = 'fzyx' layout = 'fzyx'
# Optimization # Optimizations to be used by the code generator
OPT = {'target': 'cpu', 'cse_global': True, 'field_layout': LAYOUT} optimizations = {'target': 'cpu', 'cse_global': True, 'field_layout': layout}
# =========================== # ===========================
# SRT Method Definition # SRT Method Definition
# =========================== # ===========================
srt_params = {'stencil': STENCIL, srt_params = {'stencil': stencil,
'method': 'srt', 'method': 'srt',
'relaxation_rate': OMEGA} 'relaxation_rate': omega}
srt_collision_rule = create_lb_collision_rule(optimization=OPT, **srt_params) srt_collision_rule = create_lb_collision_rule(optimization=optimizations, **srt_params)
srt_update_rule = create_lb_update_rule(collision_rule=srt_collision_rule, optimization=OPT) srt_update_rule = create_lb_update_rule(collision_rule=srt_collision_rule, optimization=optimizations)
# ===================== # =====================
# Code Generation # Code Generation
# ===================== # =====================
with CodeGeneration() as ctx: with CodeGeneration() as ctx:
generate_lattice_model(ctx, "SRTLatticeModel", srt_collision_rule, field_layout=LAYOUT) # generation of the lattice model ...
generate_lattice_model(ctx, "SRTLatticeModel", srt_collision_rule, field_layout=layout)
# ... and generation of the pack information to be used for the MPI communication
generate_pack_info_from_kernel(ctx, "SRTPackInfo", srt_update_rule) generate_pack_info_from_kernel(ctx, "SRTPackInfo", srt_update_rule)
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