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
Neel Shah
NIFTy
Commits
057ecb10
Commit
057ecb10
authored
May 26, 2018
by
Martin Reinecke
Browse files
Merge branch 'consistency_checks_multi_compatible' into 'NIFTy_4'
Make energy test multi compatible See merge request ift/NIFTy!261
parents
f6d28ab7
ade31670
Changes
1
Hide whitespace changes
Inline
Side-by-side
nifty4/extra/energy_tests.py
View file @
057ecb10
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
import
numpy
as
np
import
numpy
as
np
from
..field
import
Field
from
..field
import
Field
from
..sugar
import
from_random
__all__
=
[
"check_value_gradient_consistency"
,
__all__
=
[
"check_value_gradient_consistency"
,
"check_value_gradient_curvature_consistency"
]
"check_value_gradient_curvature_consistency"
]
...
@@ -26,7 +27,7 @@ __all__ = ["check_value_gradient_consistency",
...
@@ -26,7 +27,7 @@ __all__ = ["check_value_gradient_consistency",
def
_get_acceptable_energy
(
E
):
def
_get_acceptable_energy
(
E
):
if
not
np
.
isfinite
(
E
.
value
):
if
not
np
.
isfinite
(
E
.
value
):
raise
ValueError
raise
ValueError
dir
=
Field
.
from_random
(
"normal"
,
E
.
position
.
domain
)
dir
=
from_random
(
"normal"
,
E
.
position
.
domain
)
# find a step length that leads to a "reasonable" energy
# find a step length that leads to a "reasonable" energy
for
i
in
range
(
50
):
for
i
in
range
(
50
):
try
:
try
:
...
...
Write
Preview
Supports
Markdown
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