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
pycodegen
lbmpy
Commits
42697a8c
Commit
42697a8c
authored
Jun 07, 2021
by
Michael Kuron
Browse files
Merge branch 'type_boundary' into 'master'
Use int64 for indexing Closes
#18
See merge request
!84
parents
55d0ca6c
5068abc0
Pipeline
#32525
passed with stages
in 30 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/advanced_streaming/indexing.py
View file @
42697a8c
...
...
@@ -40,7 +40,7 @@ class BetweenTimestepsIndexing:
# =============================
def
__init__
(
self
,
pdf_field
,
stencil
,
prev_timestep
=
Timestep
.
BOTH
,
streaming_pattern
=
'pull'
,
index_dtype
=
np
.
int
32
,
offsets_dtype
=
np
.
int
32
):
index_dtype
=
np
.
int
64
,
offsets_dtype
=
np
.
int
64
):
if
prev_timestep
==
Timestep
.
BOTH
and
is_inplace
(
streaming_pattern
):
raise
ValueError
(
'Cannot create index arrays for both kinds of timesteps for inplace streaming pattern '
+
streaming_pattern
)
...
...
@@ -219,7 +219,7 @@ class NeighbourOffsetArrays(CustomCodeNode):
def
_offset_symbols
(
dim
):
return
[
TypedSymbol
(
f
"neighbour_offset_
{
d
}
"
,
create_type
(
np
.
int64
))
for
d
in
[
'x'
,
'y'
,
'z'
][:
dim
]]
def
__init__
(
self
,
stencil
,
offsets_dtype
=
np
.
int
32
):
def
__init__
(
self
,
stencil
,
offsets_dtype
=
np
.
int
64
):
offsets_dtype
=
create_type
(
offsets_dtype
)
dim
=
len
(
stencil
[
0
])
...
...
lbmpy/boundaries/boundaryhandling.py
View file @
42697a8c
...
...
@@ -177,10 +177,8 @@ def create_lattice_boltzmann_boundary_kernel(pdf_field, index_field, lb_method,
prev_timestep
=
Timestep
.
BOTH
,
streaming_pattern
=
'pull'
,
target
=
'cpu'
,
**
kernel_creation_args
):
index_dtype
=
index_field
.
dtype
.
numpy_dtype
.
fields
[
'dir'
][
0
]
offsets_dtype
=
index_field
.
dtype
.
numpy_dtype
.
fields
[
'x'
][
0
]
indexing
=
BetweenTimestepsIndexing
(
pdf_field
,
lb_method
.
stencil
,
prev_timestep
,
streaming_pattern
,
index_dtype
,
offsets_dtype
)
pdf_field
,
lb_method
.
stencil
,
prev_timestep
,
streaming_pattern
,
np
.
int64
,
np
.
int64
)
f_out
,
f_in
=
indexing
.
proxy_fields
dir_symbol
=
indexing
.
dir_symbol
...
...
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