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
bbfb9c1b
Commit
bbfb9c1b
authored
Jan 13, 2018
by
Martin Reinecke
Browse files
ugly hack to make nonlinear_critical_filter.py work with MPI. Needs improvement!
parent
c6aa285b
Pipeline
#23684
passed with stage
in 4 minutes and 44 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
demos/nonlinear_critical_filter.py
View file @
bbfb9c1b
...
...
@@ -5,12 +5,14 @@ np.random.seed(42)
def
adjust_zero_mode
(
m0
,
t0
):
mtmp
=
ift
.
dobj
.
to_global_data
(
m0
.
val
)
zero_position
=
len
(
m0
.
shape
)
*
(
0
,)
zero_mode
=
m0
.
val
[
zero_position
]
m0
.
val
[
zero_position
]
=
zero_mode
/
abs
(
zero_mode
)
t0
.
val
[
0
]
+=
2
*
np
.
log
(
abs
(
zero_mode
))
return
m0
,
t0
zero_mode
=
mtmp
[
zero_position
]
mtmp
[
zero_position
]
=
zero_mode
/
abs
(
zero_mode
)
ttmp
=
ift
.
dobj
.
to_global_data
(
t0
.
val
)
ttmp
[
0
]
+=
2
*
np
.
log
(
abs
(
zero_mode
))
return
(
ift
.
Field
(
m0
.
domain
,
ift
.
dobj
.
from_global_data
(
mtmp
)),
ift
.
Field
(
t0
.
domain
,
ift
.
dobj
.
from_global_data
(
ttmp
)))
if
__name__
==
"__main__"
:
...
...
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