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
21053a6b
Commit
21053a6b
authored
Sep 08, 2019
by
Philipp Arras
Browse files
Remove output of new AbsDeltaIC to files for now
parent
53eb3379
Pipeline
#60262
passed with stages
in 8 minutes and 37 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nifty5/minimization/iteration_controllers.py
View file @
21053a6b
...
@@ -15,10 +15,10 @@
...
@@ -15,10 +15,10 @@
#
#
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
# NIFTy is being developed at the Max-Planck-Institut fuer Astrophysik.
import
numpy
as
np
from
..logger
import
logger
from
..logger
import
logger
from
..utilities
import
NiftyMeta
from
..utilities
import
NiftyMeta
import
numpy
as
np
from
time
import
time
class
IterationController
(
metaclass
=
NiftyMeta
):
class
IterationController
(
metaclass
=
NiftyMeta
):
...
@@ -289,12 +289,11 @@ class AbsDeltaEnergyController(IterationController):
...
@@ -289,12 +289,11 @@ class AbsDeltaEnergyController(IterationController):
"""
"""
def
__init__
(
self
,
deltaE
,
convergence_level
=
1
,
iteration_limit
=
None
,
def
__init__
(
self
,
deltaE
,
convergence_level
=
1
,
iteration_limit
=
None
,
name
=
None
,
file_
name
=
None
):
name
=
None
):
self
.
_deltaE
=
deltaE
self
.
_deltaE
=
deltaE
self
.
_convergence_level
=
convergence_level
self
.
_convergence_level
=
convergence_level
self
.
_iteration_limit
=
iteration_limit
self
.
_iteration_limit
=
iteration_limit
self
.
_name
=
name
self
.
_name
=
name
self
.
_file_name
=
file_name
def
start
(
self
,
energy
):
def
start
(
self
,
energy
):
self
.
_itcount
=
-
1
self
.
_itcount
=
-
1
...
@@ -334,9 +333,4 @@ class AbsDeltaEnergyController(IterationController):
...
@@ -334,9 +333,4 @@ class AbsDeltaEnergyController(IterationController):
if
self
.
_ccount
>=
self
.
_convergence_level
:
if
self
.
_ccount
>=
self
.
_convergence_level
:
return
self
.
CONVERGED
return
self
.
CONVERGED
# Write energy to file
if
self
.
_file_name
is
not
None
:
with
open
(
self
.
_file_name
,
'a+'
)
as
f
:
f
.
write
(
'{} {} {}
\n
'
.
format
(
time
(),
energy
.
value
,
diff
))
return
self
.
CONTINUE
return
self
.
CONTINUE
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