Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pystencils_autodiff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
pycodegen
pystencils_autodiff
Commits
679e9741
Commit
679e9741
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add test for spatial information
parent
b5500f21
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#21604
failed
5 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_walberla.py
+23
-0
23 additions, 0 deletions
tests/test_walberla.py
with
23 additions
and
0 deletions
tests/test_walberla.py
+
23
−
0
View file @
679e9741
...
@@ -93,6 +93,29 @@ def test_wald_wiesen_lbm():
...
@@ -93,6 +93,29 @@ def test_wald_wiesen_lbm():
file
.
write
(
v
)
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
():
def
test_resolve_parameters
():
sym
=
TypedSymbol
(
'
s
'
,
create_type
(
'
double
'
))
sym
=
TypedSymbol
(
'
s
'
,
create_type
(
'
double
'
))
sym2
=
TypedSymbol
(
'
t
'
,
create_type
(
'
double
'
))
sym2
=
TypedSymbol
(
'
t
'
,
create_type
(
'
double
'
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment