Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jonas Plewinski
pystencils
Commits
a6e206d7
Commit
a6e206d7
authored
May 25, 2018
by
Martin Bauer
Browse files
started with list lbm implementation
- extended pystencils - Visualization for list LBM - not yet working
parent
7523a889
Changes
1
Show whitespace changes
Inline
Side-by-side
transformations.py
View file @
a6e206d7
...
@@ -2,6 +2,8 @@ import warnings
...
@@ -2,6 +2,8 @@ import warnings
from
collections
import
defaultdict
,
OrderedDict
,
namedtuple
from
collections
import
defaultdict
,
OrderedDict
,
namedtuple
from
copy
import
deepcopy
from
copy
import
deepcopy
from
types
import
MappingProxyType
from
types
import
MappingProxyType
import
itertools
import
sympy
as
sp
import
sympy
as
sp
from
sympy.logic.boolalg
import
Boolean
from
sympy.logic.boolalg
import
Boolean
from
sympy.tensor
import
IndexedBase
from
sympy.tensor
import
IndexedBase
...
@@ -390,6 +392,12 @@ def resolve_field_accesses(ast_node, read_only_field_names=set(),
...
@@ -390,6 +392,12 @@ def resolve_field_accesses(ast_node, read_only_field_names=set(),
def
visit_sympy_expr
(
expr
,
enclosing_block
,
sympy_assignment
):
def
visit_sympy_expr
(
expr
,
enclosing_block
,
sympy_assignment
):
if
isinstance
(
expr
,
Field
.
Access
):
if
isinstance
(
expr
,
Field
.
Access
):
field_access
=
expr
field_access
=
expr
if
any
(
isinstance
(
off
,
Field
.
Access
)
for
off
in
field_access
.
offsets
):
new_offsets
=
tuple
(
visit_sympy_expr
(
off
,
enclosing_block
,
sympy_assignment
)
for
off
in
field_access
.
offsets
)
field_access
=
Field
.
Access
(
field_access
.
field
,
new_offsets
,
field_access
.
index
)
field
=
field_access
.
field
field
=
field_access
.
field
if
field
.
name
in
field_to_base_pointer_info
:
if
field
.
name
in
field_to_base_pointer_info
:
...
@@ -711,6 +719,9 @@ class KernelConstraintsCheck:
...
@@ -711,6 +719,9 @@ class KernelConstraintsCheck:
self
.
_update_accesses_rhs
(
rhs
)
self
.
_update_accesses_rhs
(
rhs
)
if
isinstance
(
rhs
,
Field
.
Access
):
if
isinstance
(
rhs
,
Field
.
Access
):
self
.
fields_read
.
add
(
rhs
.
field
)
self
.
fields_read
.
add
(
rhs
.
field
)
for
e
in
itertools
.
chain
(
rhs
.
offsets
,
rhs
.
index
):
if
isinstance
(
e
,
sp
.
Basic
):
self
.
fields_read
.
update
(
access
.
field
for
access
in
e
.
atoms
(
Field
.
Access
))
return
rhs
return
rhs
elif
isinstance
(
rhs
,
TypedSymbol
):
elif
isinstance
(
rhs
,
TypedSymbol
):
return
rhs
return
rhs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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