Commit fd5bc857 authored by alxvov's avatar alxvov
Browse files

calculate energy in the beginning only once

parent ee8d3ced
Loading
Loading
Loading
Loading
+1 −1
Changes for src/SPIN/min_spin.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -133,7 +133,7 @@ int MinSpin::iterate(int maxiter)
    // optimize timestep accross processes / replicas
    // need a force calculation for timestep optimization

    energy_force(0);
    if (iter == 0) energy_force(0);
    dts = evaluate_dt();

    // apply damped precessional dynamics to the spins
+1 −1
Changes for src/SPIN/min_spin_oso_cg.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -181,7 +181,7 @@ int MinSpinOSO_CG::iterate(int maxiter)
    // optimize timestep accross processes / replicas
    // need a force calculation for timestep optimization

    energy_force(0);
    if (iter == 0) energy_force(0);
    dts = evaluate_dt();
  
    calc_gradient(dts);
+1 −1
Changes for src/SPIN/min_spin_oso_lbfgs.cpp: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -190,7 +190,7 @@ int MinSpinOSO_LBFGS::iterate(int maxiter)
    // optimize timestep accross processes / replicas
    // need a force calculation for timestep optimization
  
    energy_force(0);
    if (iter == 0) energy_force(0);
    //  dts = evaluate_dt();
    //  dts = 1.0;
    calc_gradient(1.0);