From 6fb3881bcedc554d8278468bdbd647e17d5d0f18 Mon Sep 17 00:00:00 2001 From: Martin Bauer <martin.bauer@fau.de> Date: Thu, 24 May 2018 17:20:00 +0200 Subject: [PATCH] Adapted codegen example file to changes in lbmpy --- .../lbm/codegen/SrtWithForceFieldModel.gen.py | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/lbm/codegen/SrtWithForceFieldModel.gen.py b/tests/lbm/codegen/SrtWithForceFieldModel.gen.py index 2ecb139fb..f004d3840 100644 --- a/tests/lbm/codegen/SrtWithForceFieldModel.gen.py +++ b/tests/lbm/codegen/SrtWithForceFieldModel.gen.py @@ -1,34 +1,34 @@ import sympy as sp from lbmpy.boundaries import NoSlip, UBB -from lbmpy_walberla import Field, generateLatticeModelFiles, RefinementScaling -from lbmpy.creationfunctions import createLatticeBoltzmannMethod -from lbmpy_walberla.boundary import createBoundaryClass +from lbmpy_walberla import Field, 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 +import pystencils as ps # ------------- Lattice Model ------------------------------ -forceField = Field.createGeneric('force', spatialDimensions=3, indexDimensions=1, layout='fzyx') -force = [forceField(0), forceField(1), forceField(2)] +force_field = ps.fields("force(3): [3D]", layout='fzyx') omega = sp.Symbol("omega") scaling = RefinementScaling() -scaling.addStandardRelaxationRateScaling(omega) -scaling.addForceScaling(forceField) +scaling.add_standard_relaxation_rate_scaling(omega) +scaling.add_force_scaling(force_field) -generateLatticeModelFiles(className='SrtWithForceFieldModel', - method='srt', stencil='D3Q19', forceModel='guo', force=force, - relaxationRates=[omega], refinementScaling=scaling) +generate_lattice_model_files(class_name='SrtWithForceFieldModel', + method='srt', stencil='D3Q19', force_model='guo', force=force_field.center_vector, + relaxation_rates=[omega], refinement_scaling=scaling) def genBoundary(): boundary = UBB([0.05, 0, 0], dim=3, name="MyUBB") - method = createLatticeBoltzmannMethod(stencil='D3Q19', method='srt') - return createBoundaryClass(boundary, method) + method = create_lb_method(stencil='D3Q19', method='srt') + return create_boundary_class(boundary, method) def genNoSlip(): boundary = NoSlip(name='MyNoSlip') - method = createLatticeBoltzmannMethod(stencil='D3Q19', method='srt') - return createBoundaryClass(boundary, method) + 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) -- GitLab