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
pycodegen
pystencils
Merge requests
!104
Minor improvements to FiniteDifferenceStaggeredStencilDerivation
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Minor improvements to FiniteDifferenceStaggeredStencilDerivation
fvm
into
master
Overview
0
Commits
1
Pipelines
2
Changes
2
Merged
Michael Kuron
requested to merge
fvm
into
master
5 years ago
Overview
0
Commits
1
Pipelines
2
Changes
2
Expand
0
0
Merge request reports
Compare
master
version 1
431639c7
5 years ago
master (base)
and
latest version
latest version
efadec2e
1 commit,
5 years ago
version 1
431639c7
1 commit,
5 years ago
2 files
+
8
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
pystencils/fd/derivation.py
+
5
−
4
Options
@@ -303,11 +303,12 @@ class FiniteDifferenceStaggeredStencilDerivation:
zero_counts
[
zero_count
].
append
(
weights
)
best
=
zero_counts
[
max
(
zero_counts
.
keys
())]
if
len
(
best
)
>
1
:
# if there are multiple, pick the one that contains a nonzero center weight
center
=
[
tuple
(
p
+
pos
)
for
p
in
points
].
index
((
0
,
0
,
0
))
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
:
raise
NotImplementedError
(
"
more than one suitable set of weights found, don
'
t know how to proceed
"
)
weights
=
best
[
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
)
else
:
weights
=
best
[
0
]
assert
weights
points_tuple
=
tuple
([
tuple
(
p
+
pos
)
for
p
in
points
])
Loading