Commit 31c45d8a authored by Martin Bauer's avatar Martin Bauer
Browse files

Separated modules into subfolders with own setup.py

This restructuring allows for easier separation of modules into
separate repositories later. Also, now pip install with repo url can be
used.

The setup.py files have also been updated to correctly reference each
other. Module versions are not extracted from git state
parent f63a8b81
import sympy as sp
import pystencils as ps
from lbmpy.boundaries import NoSlip, UBB
from lbmpy.creationfunctions import create_lb_method, create_lb_update_rule
from lbmpy_walberla import generate_lattice_model, RefinementScaling, generate_boundary
from lbmpy_walberla.sparse import ListLbGenerator
from pystencils_walberla.cmake_integration import ManualCodeGenerationContext
from pystencils_walberla import generate_pack_info_for_field, generate_pack_info_from_kernel
def test_lattice_model():
with ManualCodeGenerationContext() as ctx:
force_field = ps.fields("force(3): [3D]", layout='fzyx')
omega = sp.Symbol("omega")
lb_method = create_lb_method(stencil='D3Q19', method='srt', relaxation_rates=[omega],
force_model='guo', force=force_field.center_vector)
scaling = RefinementScaling()
scaling.add_standard_relaxation_rate_scaling(omega)
scaling.add_force_scaling(force_field)
generate_lattice_model(ctx, 'SrtWithForceFieldModel', lb_method, refinement_scaling=scaling)
generate_boundary(ctx, 'MyUBB', UBB([0.05, 0, 0]), lb_method)
generate_boundary(ctx, 'MyNoSlip', NoSlip(), lb_method)
def test_sparse():
from lbmpy.creationfunctions import create_lb_collision_rule
from pystencils import show_code
g = ListLbGenerator(create_lb_collision_rule())
kernel_code = str(show_code(g.kernel()))
assert 'num_cells' in kernel_code
setter_code = str(show_code(g.setter_ast()))
assert 'num_cells' in setter_code
getter_code = str(show_code(g.getter_ast()))
assert 'num_cells' in getter_code
def test_pack_info():
with ManualCodeGenerationContext() as ctx:
f = ps.fields("f(9): [3D]")
generate_pack_info_for_field(ctx, 'MyPackInfo1', f)
lb_assignments = create_lb_update_rule(stencil='D3Q19', method='srt').main_assignments
generate_pack_info_from_kernel(ctx, 'MyPackInfo2', lb_assignments)
from setuptools import setup, find_packages
setup(name='lbmpy_walberla',
description='Code Generation for Lattice Boltzmann Methods in the walberla framework',
author='Martin Bauer',
license='AGPLv3',
author_email='martin.bauer@fau.de',
url='https://i10git.cs.fau.de/software/pystencils/',
packages=['lbmpy_walberla'] + ['lbmpy_walberla.' + s for s in find_packages('lbmpy_walberla')],
install_requires=['lbmpy', 'pystencils_walberla'],
package_dir={'lbmpy_walberla': 'lbmpy_walberla'},
package_data={'lbmpy_walberla': ['templates/*']},
version_format='{tag}.dev{commits}+{sha}',
)
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