git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1783 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -93,9 +93,9 @@ class Fix : protected Pointers {
|
||||
virtual void final_integrate_respa(int) {}
|
||||
|
||||
virtual void min_post_force(int) {}
|
||||
virtual double min_energy(double *, double *) {return 0.0;}
|
||||
virtual double min_energy(double *) {return 0.0;}
|
||||
virtual void min_step(double, double *) {}
|
||||
virtual int min_dof() {return 0;}
|
||||
virtual void min_xinitial(double *) {}
|
||||
|
||||
virtual int pack_comm(int, int *, double *, int, int *) {return 0;}
|
||||
virtual void unpack_comm(int, int, double *) {}
|
||||
|
||||
@ -328,18 +328,35 @@ void Modify::min_post_force(int vflag)
|
||||
return energy and forces on extra degrees of freedom
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
double Modify::min_energy(double *xextra, double *fextra)
|
||||
double Modify::min_energy(double *fextra)
|
||||
{
|
||||
int ifix,index;
|
||||
|
||||
index = 0;
|
||||
double energy_extra = 0.0;
|
||||
double eng = 0.0;
|
||||
for (int i = 0; i < n_min_energy; i++) {
|
||||
ifix = list_min_energy[i];
|
||||
energy_extra += fix[ifix]->min_energy(&xextra[index],&fextra[index]);
|
||||
eng += fix[ifix]->min_energy(&fextra[index]);
|
||||
index += fix[ifix]->min_dof();
|
||||
}
|
||||
return eng;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
minimizer energy, force evaluation only for relevant fixes
|
||||
return energy and forces on extra degrees of freedom
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Modify::min_step(double delta, double *fextra)
|
||||
{
|
||||
int ifix,index;
|
||||
|
||||
index = 0;
|
||||
for (int i = 0; i < n_min_energy; i++) {
|
||||
ifix = list_min_energy[i];
|
||||
fix[ifix]->min_step(delta,&fextra[index]);
|
||||
index += fix[ifix]->min_dof();
|
||||
}
|
||||
return energy_extra;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
@ -354,19 +371,6 @@ int Modify::min_dof()
|
||||
return ndof;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
minimizer initial xextra values only from relevant fixes
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void Modify::min_xinitial(double *xextra)
|
||||
{
|
||||
int index = 0;
|
||||
for (int i = 0; i < n_min_energy; i++) {
|
||||
fix[list_min_energy[i]]->min_xinitial(&xextra[index]);
|
||||
index += fix[list_min_energy[i]]->min_dof();
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
add a new fix or replace one with same ID
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
@ -52,9 +52,9 @@ class Modify : protected Pointers {
|
||||
void final_integrate_respa(int);
|
||||
|
||||
void min_post_force(int);
|
||||
double min_energy(double *, double *);
|
||||
double min_energy(double *);
|
||||
void min_step(double, double *);
|
||||
int min_dof();
|
||||
void min_xinitial(double *);
|
||||
|
||||
void add_fix(int, char **);
|
||||
void modify_fix(int, char **);
|
||||
|
||||
@ -140,6 +140,7 @@ DumpStyle(xyz,DumpXYZ)
|
||||
#endif
|
||||
|
||||
#ifdef FixInclude
|
||||
#include "fix_box_relax.h"
|
||||
#include "fix_add_force.h"
|
||||
#include "fix_ave_atom.h"
|
||||
#include "fix_ave_force.h"
|
||||
@ -198,6 +199,7 @@ DumpStyle(xyz,DumpXYZ)
|
||||
#endif
|
||||
|
||||
#ifdef FixClass
|
||||
FixStyle(box/relax,FixBoxRelax)
|
||||
FixStyle(addforce,FixAddForce)
|
||||
FixStyle(ave/atom,FixAveAtom)
|
||||
FixStyle(aveforce,FixAveForce)
|
||||
@ -280,11 +282,15 @@ IntegrateStyle(verlet,Verlet)
|
||||
#ifdef MinimizeInclude
|
||||
#include "min_cg.h"
|
||||
#include "min_sd.h"
|
||||
#include "min_cg2.h"
|
||||
#include "min_sd2.h"
|
||||
#endif
|
||||
|
||||
#ifdef MinimizeClass
|
||||
MinimizeStyle(cg,MinCG)
|
||||
MinimizeStyle(sd,MinSD)
|
||||
MinimizeStyle(cg2,MinCG2)
|
||||
MinimizeStyle(sd2,MinSD2)
|
||||
# endif
|
||||
|
||||
#ifdef PairInclude
|
||||
|
||||
Reference in New Issue
Block a user