Skip to content
Snippets Groups Projects
Commit 679e9741 authored by Stephan Seitz's avatar Stephan Seitz
Browse files

Add test for spatial information

parent b5500f21
No related merge requests found
Pipeline #21604 failed with stage
in 1 minute and 24 seconds
......@@ -93,6 +93,29 @@ def test_wald_wiesen_lbm():
file.write(v)
def test_global_idx():
sys.path.append(dirname(__file__))
with ManualCodeGenerationContext() as ctx:
from pystencils_walberla.special_symbols import current_global_idx, aabb_min_x
dh = GraphDataHandling((20, 30))
my_array = dh.add_array('my_array')
ast = pystencils.create_kernel([pystencils.Assignment(my_array.center, sum(current_global_idx))]).compile()
dh.run_kernel(ast, simulate_only=True)
ast = pystencils.create_kernel([pystencils.Assignment(my_array.center, aabb_min_x)]).compile()
dh.run_kernel(ast, simulate_only=True)
sim = Simulation(dh, ctx)
sim.write_files()
dir = '/localhome/seitz_local/projects/walberla/apps/foo/'
os.makedirs(dir, exist_ok=True)
for k, v in ctx.files.items():
with open(join(dir, k), 'w') as file:
file.write(v)
def test_resolve_parameters():
sym = TypedSymbol('s', create_type('double'))
sym2 = TypedSymbol('t', create_type('double'))
......
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