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
ift
NIFTy
Commits
0b16af9f
Commit
0b16af9f
authored
Oct 07, 2017
by
Martin Reinecke
Browse files
re-introduce weighting for now
parent
6abc0315
Pipeline
#19376
passed with stage
in 4 minutes and 22 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty/operators/laplace_operator/laplace_operator.py
View file @
0b16af9f
...
...
@@ -111,7 +111,7 @@ class LaplaceOperator(EndomorphicOperator):
ret
/=
np
.
sqrt
(
dposc
)
ret
[
prefix
+
(
slice
(
None
,
2
),)]
=
0.
ret
[
prefix
+
(
-
1
,)]
=
0.
return
Field
(
self
.
domain
,
val
=
ret
)
return
Field
(
self
.
domain
,
val
=
ret
)
.
weight
(
-
0.5
,
spaces
=
self
.
_space
)
def
_adjoint_times
(
self
,
x
):
axes
=
x
.
domain
.
axes
[
self
.
_space
]
...
...
@@ -122,7 +122,7 @@ class LaplaceOperator(EndomorphicOperator):
sl_r
=
prefix
+
(
slice
(
1
,
None
),)
# "right" slice
dpos
=
self
.
_dpos
.
reshape
((
1
,)
*
axis
+
(
nval
-
1
,))
dposc
=
self
.
_dposc
.
reshape
((
1
,)
*
axis
+
(
nval
,))
y
=
x
.
val
.
copy
()
y
=
x
.
weight
(
0.5
,
spaces
=
self
.
_space
).
val
y
/=
np
.
sqrt
(
dposc
)
y
[
prefix
+
(
slice
(
None
,
2
),)]
=
0.
y
[
prefix
+
(
-
1
,)]
=
0.
...
...
@@ -131,4 +131,4 @@ class LaplaceOperator(EndomorphicOperator):
ret
[
sl_l
]
=
deriv
ret
[
prefix
+
(
-
1
,)]
=
0.
ret
[
sl_r
]
-=
deriv
return
Field
(
self
.
domain
,
val
=
ret
)
return
Field
(
self
.
domain
,
val
=
ret
)
.
weight
(
-
1
,
spaces
=
self
.
_space
)
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