Commit 99e58d88 authored by julient31's avatar julient31
Browse files

Commit2 JT 070319

- fixing first and last images in oso_lbfgs.cpp
parent 5924c558
Loading
Loading
Loading
Loading
+18 −0
Changes for src/SPIN/min_spin_oso_lbfgs.cpp: 18 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -39,6 +39,8 @@
#include "math_special.h"
#include "math_const.h"

#include "universe.h"

using namespace LAMMPS_NS;
using namespace MathConst;

@@ -66,6 +68,13 @@ MinSpinOSO_LBFGS::MinSpinOSO_LBFGS(LAMMPS *lmp) :
{
  if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_oso_lbfgs);
  nlocal_max = 0;
  
  // nreplica = number of partitions
  // ireplica = which world I am in universe

  nreplica = universe->nworlds;
  ireplica = universe->iworld;

}

/* ---------------------------------------------------------------------- */
@@ -198,7 +207,16 @@ int MinSpinOSO_LBFGS::iterate(int maxiter)

    calc_gradient(dts);
    calc_search_direction(iter);

    // to be checked
    // if gneb calc., nreplica > 0
    // then advance spins only if intermediate replica
    // otherwise (simple minimization), advance spins

    if (nreplica > 0) {
      if(ireplica != 0 && ireplica != nreplica-1)
	advance_spins();
    } else advance_spins();
  
    eprevious = ecurrent;
    ecurrent = energy_force(0);
+5 −0
Changes for src/SPIN/min_spin_oso_lbfgs.h: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -41,6 +41,11 @@ public:
    void calc_search_direction(int);

private:


    // test
    int ireplica,nreplica;

    // global and spin timesteps

    int nlocal_max;		// max value of nlocal (for size of lists)