Commit e75398f3 authored by Martin Bauer's avatar Martin Bauer
Browse files

Fixes in codegen files

parent a0c86311
......@@ -3,17 +3,17 @@ from pystencils_walberla.sweep import Sweep
def jacobi2D(sweep):
src = sweep.field("f1")
dst = sweep.temporaryField(src)
dst = sweep.temporary_field(src)
dst[0, 0] @= (src[1, 0] + src[-1, 0] + src[0, 1] + src[0, -1]) / (4 * sweep.constant.h ** 2)
dst[0, 0] @= (src[1, 0] + src[-1, 0] + src[0, 1] + src[0, -1]) / (4 * sweep.constant("h") ** 2)
def jacobi3D(sweep):
src = sweep.field("f1")
dst = sweep.temporaryField(src)
dst = sweep.temporary_field(src)
dst[0, 0, 0] @= (src[1, 0, 0] + src[-1, 0, 0] + src[0, 1, 0] + src[0, -1, 0] + src[0, 0, 1] + src[0, 0, -1]) / \
(6 * sweep.constant.h ** 2)
(6 * sweep.constant("h") ** 2)
Sweep.generate('CudaJacobiKernel2D', jacobi2D, dim=2, target='gpu')
......
import sympy as sp
from lbmpy.boundaries import NoSlip, UBB
from lbmpy_walberla import Field, generate_lattice_model_files, RefinementScaling
from lbmpy_walberla import generate_lattice_model_files, RefinementScaling
from lbmpy.creationfunctions import create_lb_method
from lbmpy_walberla.boundary import create_boundary_class
from pystencils_walberla.cmake_integration import codegen
......@@ -25,11 +25,12 @@ def genBoundary():
method = create_lb_method(stencil='D3Q19', method='srt')
return create_boundary_class(boundary, method)
def genNoSlip():
boundary = NoSlip(name='MyNoSlip')
method = create_lb_method(stencil='D3Q19', method='srt')
return create_boundary_class(boundary, method)
codegen.register(['MyUBB.h', 'MyUBB.cpp'], genBoundary)
codegen.register(['MyNoSlip.h', 'MyNoSlip.cpp',], genNoSlip)
codegen.register(['MyUBB.h', 'MyUBB.cpp'], genBoundary)
codegen.register(['MyNoSlip.h', 'MyNoSlip.cpp'], genNoSlip)
Supports Markdown
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