git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@8221 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -23,13 +23,17 @@
|
|||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
|
#include "input.h"
|
||||||
|
#include "modify.h"
|
||||||
#include "respa.h"
|
#include "respa.h"
|
||||||
|
#include "variable.h"
|
||||||
#include "error.h"
|
#include "error.h"
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
using namespace FixConst;
|
using namespace FixConst;
|
||||||
|
|
||||||
enum{CHUTE,SPHERICAL,GRADIENT,VECTOR};
|
enum{CHUTE,SPHERICAL,GRADIENT,VECTOR};
|
||||||
|
enum{CONSTANT,EQUAL};
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
@ -40,26 +44,20 @@ FixGravityOMP::FixGravityOMP(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
void FixGravityOMP::post_force(int vflag)
|
void FixGravityOMP::post_force(int vflag)
|
||||||
{
|
{
|
||||||
// update direction of gravity vector if gradient style
|
// update gravity due to variables
|
||||||
|
|
||||||
if (style == GRADIENT) {
|
if (varflag != CONSTANT) {
|
||||||
if (domain->dimension == 3) {
|
modify->clearstep_compute();
|
||||||
double phi_current = degree2rad *
|
if (mstyle == EQUAL) magnitude = input->variable->compute_equal(mvar);
|
||||||
(phi + (update->ntimestep - time_origin)*dt*phigrad*360.0);
|
if (vstyle == EQUAL) magnitude = input->variable->compute_equal(vvar);
|
||||||
double theta_current = degree2rad *
|
if (pstyle == EQUAL) magnitude = input->variable->compute_equal(pvar);
|
||||||
(theta + (update->ntimestep - time_origin)*dt*thetagrad*360.0);
|
if (tstyle == EQUAL) magnitude = input->variable->compute_equal(tvar);
|
||||||
xgrav = sin(theta_current) * cos(phi_current);
|
if (xstyle == EQUAL) magnitude = input->variable->compute_equal(xvar);
|
||||||
ygrav = sin(theta_current) * sin(phi_current);
|
if (ystyle == EQUAL) magnitude = input->variable->compute_equal(yvar);
|
||||||
zgrav = cos(theta_current);
|
if (zstyle == EQUAL) magnitude = input->variable->compute_equal(zvar);
|
||||||
} else {
|
modify->addstep_compute(update->ntimestep + 1);
|
||||||
double theta_current = degree2rad *
|
|
||||||
(theta + (update->ntimestep - time_origin)*dt*thetagrad*360.0);
|
set_acceleration();
|
||||||
xgrav = sin(theta_current);
|
|
||||||
ygrav = cos(theta_current);
|
|
||||||
}
|
|
||||||
xacc = magnitude*xgrav;
|
|
||||||
yacc = magnitude*ygrav;
|
|
||||||
zacc = magnitude*zgrav;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const double * const * const x = atom->x;
|
const double * const * const x = atom->x;
|
||||||
|
|||||||
Reference in New Issue
Block a user