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
Jonas Plewinski
pystencils
Commits
b68e174e
Commit
b68e174e
authored
Aug 02, 2019
by
Stephan Seitz
Browse files
Make Field.Access a TypedSymbol
parent
c06f8b77
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/field.py
View file @
b68e174e
...
...
@@ -10,7 +10,7 @@ import sympy as sp
from
sympy.core.cache
import
cacheit
from
pystencils.alignedarray
import
aligned_empty
from
pystencils.data_types
import
StructType
,
create_type
from
pystencils.data_types
import
StructType
,
TypedSymbol
,
create_type
from
pystencils.kernelparameters
import
FieldShapeSymbol
,
FieldStrideSymbol
from
pystencils.stencil
import
direction_string_to_offset
,
offset_to_direction_string
from
pystencils.sympyextensions
import
is_integer_sequence
...
...
@@ -410,7 +410,7 @@ class Field(AbstractField):
return
self
.
hashable_contents
()
==
other
.
hashable_contents
()
# noinspection PyAttributeOutsideInit,PyUnresolvedReferences
class
Access
(
sp
.
Symbol
,
AbstractField
.
AbstractAccess
):
class
Access
(
Typed
Symbol
,
AbstractField
.
AbstractAccess
):
"""Class representing a relative access into a `Field`.
This class behaves like a normal sympy Symbol, it is actually derived from it. One can built up
...
...
@@ -462,7 +462,7 @@ class Field(AbstractField):
if
superscript
is
not
None
:
symbol_name
+=
"^"
+
superscript
obj
=
super
(
Field
.
Access
,
self
).
__xnew__
(
self
,
symbol_name
)
obj
=
super
(
Field
.
Access
,
self
).
__xnew__
(
self
,
symbol_name
,
field
.
dtype
)
obj
.
_field
=
field
obj
.
_offsets
=
[]
for
o
in
offsets
:
...
...
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