Commit 2216ae20 authored by Martin Reinecke's avatar Martin Reinecke
Browse files

consider descent minmization as converged if the energy doesn't decrease any more

parent 75a979cf
Pipeline #22923 passed with stage
in 4 minutes and 38 seconds
...@@ -91,6 +91,9 @@ class DescentMinimizer(Minimizer): ...@@ -91,6 +91,9 @@ class DescentMinimizer(Minimizer):
if new_energy.value > energy.value: if new_energy.value > energy.value:
return energy, controller.ERROR return energy, controller.ERROR
if new_energy.value == energy.value:
return new_energy, controller.CONVERGED
energy = new_energy energy = new_energy
status = self._controller.check(energy) status = self._controller.check(energy)
if status != controller.CONTINUE: if status != controller.CONTINUE:
from __future__ import division from __future__ import division
from builtins import range from builtins import range
import numpy as np import numpy as np
from .endomorphic_operator import EndomorphicOperator from .endomorphic_operator import EndomorphicOperator
from .. import dobj from .. import dobj, utilities, Field, DomainTuple
from ..spaces import PowerSpace from ..spaces import PowerSpace
from .. import utilities
from .. import Field, DomainTuple
class DirectSmoothingOperator(EndomorphicOperator): class DirectSmoothingOperator(EndomorphicOperator):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment