Skip to content
Snippets Groups Projects
Commit d6fa9aa0 authored by Philipp Arras's avatar Philipp Arras
Browse files

Make energy test multi compatible

parent f6d28ab7
No related branches found
No related tags found
1 merge request!261Make energy test multi compatible
Pipeline #
......@@ -18,6 +18,7 @@
import numpy as np
from ..field import Field
from .. import from_random
__all__ = ["check_value_gradient_consistency",
"check_value_gradient_curvature_consistency"]
......@@ -26,7 +27,7 @@ __all__ = ["check_value_gradient_consistency",
def _get_acceptable_energy(E):
if not np.isfinite(E.value):
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
for i in range(50):
try:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment