git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@2330 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2009-01-05 22:26:08 +00:00
parent e1f72f6d3a
commit 0cc1d090f4
90 changed files with 1129 additions and 779 deletions

View File

@ -16,6 +16,7 @@
#include "stdlib.h"
#include "compute_pressure.h"
#include "atom.h"
#include "update.h"
#include "domain.h"
#include "modify.h"
#include "fix.h"
@ -30,9 +31,6 @@
using namespace LAMMPS_NS;
#define INVOKED_SCALAR 1
#define INVOKED_VECTOR 2
/* ---------------------------------------------------------------------- */
ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) :
@ -159,13 +157,16 @@ void ComputePressure::init()
double ComputePressure::compute_scalar()
{
invoked |= INVOKED_SCALAR;
invoked_scalar = update->ntimestep;
if (update->vflag_global != invoked_scalar)
error->all("Virial was not tallied on needed timestep");
// invoke temperature it it hasn't been already
double t;
if (keflag) {
if (temperature->invoked & INVOKED_SCALAR) t = temperature->scalar;
if (temperature->invoked_scalar == update->ntimestep)
t = temperature->scalar;
else t = temperature->compute_scalar();
}
@ -197,13 +198,15 @@ double ComputePressure::compute_scalar()
void ComputePressure::compute_vector()
{
invoked |= INVOKED_VECTOR;
invoked_vector = update->ntimestep;
if (update->vflag_global != invoked_vector)
error->all("Virial was not tallied on needed timestep");
// invoke temperature it it hasn't been already
double *ke_tensor;
if (keflag) {
if (!(temperature->invoked & INVOKED_VECTOR))
if (temperature->invoked_vector != update->ntimestep)
temperature->compute_vector();
ke_tensor = temperature->vector;
}