Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Florian Weik
waLBerla
Commits
e75398f3
Commit
e75398f3
authored
Nov 14, 2018
by
Martin Bauer
Browse files
Fixes in codegen files
parent
a0c86311
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/cuda/codegen/CudaJacobiKernel.py
View file @
e75398f3
...
...
@@ -3,17 +3,17 @@ from pystencils_walberla.sweep import Sweep
def
jacobi2D
(
sweep
):
src
=
sweep
.
field
(
"f1"
)
dst
=
sweep
.
temporary
F
ield
(
src
)
dst
=
sweep
.
temporary
_f
ield
(
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
.
temporary
F
ield
(
src
)
dst
=
sweep
.
temporary
_f
ield
(
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'
)
...
...
tests/lbm/codegen/SrtWithForceFieldModel.gen.py
View file @
e75398f3
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
)
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment