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
Stephan Seitz
pystencils
Commits
5790e28d
Commit
5790e28d
authored
Dec 06, 2019
by
Michael Kuron
Browse files
Fix FiniteDifferenceStaggeredStencilDerivation on Sympy 1.1
parent
ed864c0e
Changes
1
Hide whitespace changes
Inline
Side-by-side
pystencils/fd/derivation.py
View file @
5790e28d
...
...
@@ -306,7 +306,7 @@ class FiniteDifferenceStaggeredStencilDerivation:
center
=
[
tuple
(
p
+
pos
)
for
p
in
points
].
index
((
0
,
0
,
0
)[:
dim
])
best
=
[
b
for
b
in
best
if
b
[
center
]
!=
0
]
if
len
(
best
)
>
1
:
# if there are still multiple, they are equivalent, so we average
weights
=
sp
.
Add
(
*
[
sp
.
Matrix
(
b
)
for
b
in
best
])
/
len
(
best
)
weights
=
[
sum
([
b
[
i
]
for
b
in
best
])
/
len
(
best
)
for
i
in
range
(
len
(
weights
))]
else
:
weights
=
best
[
0
]
assert
weights
...
...
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