Commit dfa3ff38 authored by Markus Holzer's avatar Markus Holzer
Browse files

Update S2A

parent fca4b70d
Pipeline #35728 passed with stages
in 509 minutes and 25 seconds
......@@ -251,6 +251,12 @@ int main(int argc, char** argv)
WALBERLA_ABORT("Some processes have no data. This means the domain is not large enough of the chosen processes")
WALBERLA_LOG_INFO_ON_ROOT("Number of blocks in x direction: " << blocks->getXSize())
WALBERLA_LOG_INFO_ON_ROOT("Number of blocks in y direction: " << blocks->getYSize())
WALBERLA_LOG_INFO_ON_ROOT("Number of blocks in z direction: " << blocks->getZSize())
return 0;
BlockDataID pdfFieldIDGPU = cuda::addGPUFieldToStorage< PdfField_T >(blocks, pdfFieldID, "PDFs on GPU", true);
BlockDataID velFieldIDGPU =
import sympy as sp
import numpy as np
from pystencils import TypedSymbol
from pystencils import TypedSymbol, Target
from pystencils.field import fields
from lbmpy import get_stencil
from lbmpy import Stencil, LBStencil, LBMConfig, LBMOptimisation, Method
from lbmpy.boundaries.boundaryconditions import ExtrapolationOutflow, UBB, NoSlip
from lbmpy.creationfunctions import create_lb_collision_rule
from lbmpy.macroscopic_value_kernels import macroscopic_values_getter, macroscopic_values_setter
......@@ -21,9 +21,9 @@ with CodeGeneration() as ctx:
streaming_pattern = 'esotwist'
timesteps = get_timesteps(streaming_pattern)
stencil = get_stencil("D3Q27")
q = len(stencil)
dim = len(stencil[0])
stencil = LBStencil(Stencil.D3Q27)
q = stencil.Q
dim = stencil.D
omega = sp.symbols("omega")
......@@ -35,21 +35,23 @@ with CodeGeneration() as ctx:
'velocity': velocity_field
opt = {'symbolic_field': pdfs,
'cse_global': False,
'cse_pdfs': False,
'double_precision': True if ctx.double_accuracy else False}
lbm_config = LBMConfig(
galilean_correction=(q == 27),
method_params = {'method': 'cumulant',
'stencil': stencil,
'relaxation_rate': omega,
'galilean_correction': True,
'field_name': 'pdfs',
'streaming_pattern': streaming_pattern,
'output': output,
'optimization': opt}
lbm_opt = LBMOptimisation(
cse_global=False, cse_pdfs=False,
collision_rule = create_lb_collision_rule(**method_params)
collision_rule = create_lb_collision_rule(lbm_config=lbm_config, lbm_optimisation=lbm_opt,
optimization={'double_precision': True if ctx.double_accuracy else False})
scaling = RefinementScaling()
......@@ -68,7 +70,7 @@ with CodeGeneration() as ctx:
'ScalarField_T': density_field}
if ctx.cuda:
target = 'gpu'
target = Target.GPU
vp = [('int32_t', 'cudaBlockSize0'),
('int32_t', 'cudaBlockSize1'),
('int32_t', 'cudaBlockSize2')]
......@@ -78,19 +80,15 @@ with CodeGeneration() as ctx:
TypedSymbol("cudaBlockSize2", np.int32))
sweep_params = {'block_size': sweep_block_size}
opt['gpu_indexing_params'] = sweep_params
target = 'cpu'
target = Target.CPU
sweep_params = {}
vp = ()
opt['target'] = target
generate_alternating_lbm_sweep(ctx, 'S2A_LbSweep',
collision_rule, streaming_pattern, optimization=opt,
generate_sweep(ctx, 'S2A_MacroSetter', setter_assignments, target=target)
collision_rule, lbm_config, target=target, lbm_optimisation=lbm_opt,
varying_parameters=vp, gpu_indexing_params=sweep_params)
generate_sweep(ctx, 'S2A_MacroSetter', setter_assignments, target=Target.CPU)
outflow_normal = (1, 0, 0)
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