Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pystencils
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
pystencils
Commits
d3a1c41a
Commit
d3a1c41a
authored
Apr 11, 2018
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Added pystencils boundary condition test + bug fix in boundary code
parent
eb52e10d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
boundaries/__init__.py
+2
-0
2 additions, 0 deletions
boundaries/__init__.py
boundaries/boundaryconditions.py
+1
-1
1 addition, 1 deletion
boundaries/boundaryconditions.py
boundaries/createindexlistcython.pyx
+10
-10
10 additions, 10 deletions
boundaries/createindexlistcython.pyx
with
13 additions
and
11 deletions
boundaries/__init__.py
+
2
−
0
View file @
d3a1c41a
from
pystencils.boundaries.boundaryhandling
import
BoundaryHandling
from
pystencils.boundaries.boundaryhandling
import
BoundaryHandling
from
pystencils.boundaries.boundaryconditions
import
Neumann
from
pystencils.boundaries.inkernel
import
add_neumann_boundary
This diff is collapsed.
Click to expand it.
boundaries/boundaryconditions.py
+
1
−
1
View file @
d3a1c41a
...
@@ -29,7 +29,7 @@ class Boundary(object):
...
@@ -29,7 +29,7 @@ class Boundary(object):
"""
Return a list of (name, type) tuples for additional data items required in this boundary
"""
Return a list of (name, type) tuples for additional data items required in this boundary
These data items can either be initialized in separate kernel see additional_data_kernel_init or by
These data items can either be initialized in separate kernel see additional_data_kernel_init or by
Python callbacks - see additional_data_callback
"""
Python callbacks - see additional_data_callback
"""
return
[]
return
()
@property
@property
def
additional_data_init_callback
(
self
):
def
additional_data_init_callback
(
self
):
...
...
This diff is collapsed.
Click to expand it.
boundaries/createindexlistcython.pyx
+
10
−
10
View file @
d3a1c41a
...
@@ -28,7 +28,7 @@ def create_boundary_index_list_2d(object[IntegerType, ndim=2] flag_field,
...
@@ -28,7 +28,7 @@ def create_boundary_index_list_2d(object[IntegerType, ndim=2] flag_field,
for
y
in
range
(
nr_of_ghost_layers
,
ys
-
nr_of_ghost_layers
):
for
y
in
range
(
nr_of_ghost_layers
,
ys
-
nr_of_ghost_layers
):
for
x
in
range
(
nr_of_ghost_layers
,
xs
-
nr_of_ghost_layers
):
for
x
in
range
(
nr_of_ghost_layers
,
xs
-
nr_of_ghost_layers
):
if
flag_field
[
x
,
y
]
&
fluid_mask
:
if
flag_field
[
x
,
y
]
&
fluid_mask
:
for
dirIdx
in
range
(
1
,
num_directions
):
for
dirIdx
in
range
(
num_directions
):
dx
=
stencil
[
dirIdx
,
0
]
dx
=
stencil
[
dirIdx
,
0
]
dy
=
stencil
[
dirIdx
,
1
]
dy
=
stencil
[
dirIdx
,
1
]
if
flag_field
[
x
+
dx
,
y
+
dy
]
&
boundary_mask
:
if
flag_field
[
x
+
dx
,
y
+
dy
]
&
boundary_mask
:
...
@@ -38,25 +38,25 @@ def create_boundary_index_list_2d(object[IntegerType, ndim=2] flag_field,
...
@@ -38,25 +38,25 @@ def create_boundary_index_list_2d(object[IntegerType, ndim=2] flag_field,
@cython.boundscheck
(
False
)
# turn off bounds-checking for entire function
@cython.boundscheck
(
False
)
# turn off bounds-checking for entire function
@cython.wraparound
(
False
)
# turn off negative index wrapping for entire function
@cython.wraparound
(
False
)
# turn off negative index wrapping for entire function
def
create_boundary_index_list_3d
(
object
[
IntegerType
,
ndim
=
3
]
flag
F
ield
,
def
create_boundary_index_list_3d
(
object
[
IntegerType
,
ndim
=
3
]
flag
_f
ield
,
int
nr
OfG
host
L
ayers
,
IntegerType
boundary
M
ask
,
IntegerType
fluid
M
ask
,
int
nr
_of_g
host
_l
ayers
,
IntegerType
boundary
_m
ask
,
IntegerType
fluid
_m
ask
,
object
[
int
,
ndim
=
2
]
stencil
):
object
[
int
,
ndim
=
2
]
stencil
):
cdef
int
xs
,
ys
,
zs
,
x
,
y
,
z
cdef
int
xs
,
ys
,
zs
,
x
,
y
,
z
cdef
int
dirIdx
,
num_directions
,
dx
,
dy
,
dz
cdef
int
dirIdx
,
num_directions
,
dx
,
dy
,
dz
xs
,
ys
,
zs
=
flag
F
ield
.
shape
xs
,
ys
,
zs
=
flag
_f
ield
.
shape
boundary_index_list
=
[]
boundary_index_list
=
[]
num_directions
=
stencil
.
shape
[
0
]
num_directions
=
stencil
.
shape
[
0
]
for
z
in
range
(
nr
OfG
host
L
ayers
,
zs
-
nrOfG
host
L
ayers
):
for
z
in
range
(
nr
_of_g
host
_l
ayers
,
zs
-
nr_of_g
host
_l
ayers
):
for
y
in
range
(
nr
OfG
host
L
ayers
,
ys
-
nrOfG
host
L
ayers
):
for
y
in
range
(
nr
_of_g
host
_l
ayers
,
ys
-
nr_of_g
host
_l
ayers
):
for
x
in
range
(
nr
OfG
host
L
ayers
,
xs
-
nrOfG
host
L
ayers
):
for
x
in
range
(
nr
_of_g
host
_l
ayers
,
xs
-
nr_of_g
host
_l
ayers
):
if
flag
F
ield
[
x
,
y
,
z
]
&
fluid
M
ask
:
if
flag
_f
ield
[
x
,
y
,
z
]
&
fluid
_m
ask
:
for
dirIdx
in
range
(
1
,
num_directions
):
for
dirIdx
in
range
(
num_directions
):
dx
=
stencil
[
dirIdx
,
0
]
dx
=
stencil
[
dirIdx
,
0
]
dy
=
stencil
[
dirIdx
,
1
]
dy
=
stencil
[
dirIdx
,
1
]
dz
=
stencil
[
dirIdx
,
2
]
dz
=
stencil
[
dirIdx
,
2
]
if
flag
F
ield
[
x
+
dx
,
y
+
dy
,
z
+
dz
]
&
boundary
M
ask
:
if
flag
_f
ield
[
x
+
dx
,
y
+
dy
,
z
+
dz
]
&
boundary
_m
ask
:
boundary_index_list
.
append
((
x
,
y
,
z
,
dirIdx
))
boundary_index_list
.
append
((
x
,
y
,
z
,
dirIdx
))
return
boundary_index_list
return
boundary_index_list
...
...
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
sign in
to comment