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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jonas Plewinski
pystencils
Commits
a6e206d7
Commit
a6e206d7
authored
7 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
started with list lbm implementation
- extended pystencils - Visualization for list LBM - not yet working
parent
7523a889
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
transformations.py
+11
-0
11 additions, 0 deletions
transformations.py
with
11 additions
and
0 deletions
transformations.py
+
11
−
0
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
...
...
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