forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1104 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
9472ecf4a4
commit
189ad3f05e
|
@ -42,22 +42,30 @@ ComputeSumAtom::ComputeSumAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
compute = new Compute*[npre];
|
||||
|
||||
// check consistency of set of pre-computes for scalar & vector output
|
||||
// all sub-computes must be peratom
|
||||
// check consistency of sub-computes for scalar & vector output
|
||||
|
||||
peratom_flag = 1;
|
||||
int icompute = modify->find_compute(id_pre[0]);
|
||||
size_peratom = modify->compute[icompute]->size_peratom;
|
||||
|
||||
for (int i = 1; i < npre; i++) {
|
||||
int icompute;
|
||||
for (int i = 0; i < npre; i++) {
|
||||
icompute = modify->find_compute(id_pre[i]);
|
||||
if (icompute < 0)
|
||||
error->all("Could not find compute sum/atom pre-compute ID");
|
||||
if (modify->compute[icompute]->peratom_flag == 0)
|
||||
error->all("Compute sum/atom compute does not compute vector per atom");
|
||||
if (modify->compute[icompute]->size_peratom != size_peratom)
|
||||
error->all("Inconsistent sizes of compute sum/atom compute vectors");
|
||||
error->all("Compute sum/atom compute is not a per-atom compute");
|
||||
}
|
||||
|
||||
peratom_flag = 1;
|
||||
icompute = modify->find_compute(id_pre[0]);
|
||||
size_peratom = modify->compute[icompute]->size_peratom;
|
||||
|
||||
for (int i = 1; i < npre; i++) {
|
||||
icompute = modify->find_compute(id_pre[i]);
|
||||
if (modify->compute[icompute]->size_peratom != size_peratom)
|
||||
error->all("Inconsistent sizes of compute sum/atom compute quantities");
|
||||
}
|
||||
|
||||
// values generated by this compute
|
||||
|
||||
nmax = 0;
|
||||
s_value = NULL;
|
||||
v_value = NULL;
|
||||
|
|
|
@ -115,7 +115,8 @@ int FixAveAtom::setmask()
|
|||
|
||||
void FixAveAtom::init()
|
||||
{
|
||||
// set ptrs to one or more computes called each end-of-step
|
||||
// set ptrs to compute and its pre-computes called each end-of-step
|
||||
// put pre-computes in list before compute
|
||||
|
||||
int icompute = modify->find_compute(id_compute);
|
||||
if (icompute < 0) error->all("Compute ID for fix ave/atom does not exist");
|
||||
|
|
|
@ -285,7 +285,8 @@ void FixAveSpatial::init()
|
|||
error->all("Fix ave/spatial settings invalid with changing box");
|
||||
}
|
||||
|
||||
// set ptrs to one or more computes called each end-of-step
|
||||
// set ptrs to compute and its pre-computes called each end-of-step
|
||||
// put pre-computes in list before compute
|
||||
|
||||
if (which == COMPUTE) {
|
||||
int icompute = modify->find_compute(id_compute);
|
||||
|
|
|
@ -230,7 +230,8 @@ int FixAveTime::setmask()
|
|||
|
||||
void FixAveTime::init()
|
||||
{
|
||||
// set ptrs to one or more computes called each end-of-step
|
||||
// set ptrs to compute and its pre-computes called each end-of-step
|
||||
// put pre-computes in list before compute
|
||||
|
||||
if (which == COMPUTE) {
|
||||
int icompute = modify->find_compute(id);
|
||||
|
|
|
@ -86,6 +86,7 @@ CommandStyle(write_restart,WriteRestart)
|
|||
#include "compute_rotate_dipole.h"
|
||||
#include "compute_rotate_gran.h"
|
||||
#include "compute_stress_atom.h"
|
||||
#include "compute_sum.h"
|
||||
#include "compute_sum_atom.h"
|
||||
#include "compute_temp.h"
|
||||
#include "compute_temp_deform.h"
|
||||
|
@ -107,6 +108,7 @@ ComputeStyle(pressure,ComputePressure)
|
|||
ComputeStyle(rotate/dipole,ComputeRotateDipole)
|
||||
ComputeStyle(rotate/gran,ComputeRotateGran)
|
||||
ComputeStyle(stress/atom,ComputeStressAtom)
|
||||
ComputeStyle(sum,ComputeSum)
|
||||
ComputeStyle(sum/atom,ComputeSumAtom)
|
||||
ComputeStyle(temp,ComputeTemp)
|
||||
ComputeStyle(temp/deform,ComputeTempDeform)
|
||||
|
|
|
@ -28,6 +28,7 @@ KSpaceStyle(pppm/tip4p,PPPMTIP4P)
|
|||
#include "pair_coul_long.h"
|
||||
#include "pair_lj_cut_coul_long.h"
|
||||
#include "pair_lj_cut_coul_long_tip4p.h"
|
||||
#include "pair_new.h"
|
||||
#include "pair_lj_charmm_coul_long.h"
|
||||
#endif
|
||||
|
||||
|
@ -36,5 +37,6 @@ PairStyle(buck/coul/long,PairBuckCoulLong)
|
|||
PairStyle(coul/long,PairCoulLong)
|
||||
PairStyle(lj/cut/coul/long,PairLJCutCoulLong)
|
||||
PairStyle(lj/cut/coul/long/tip4p,PairLJCutCoulLongTIP4P)
|
||||
PairStyle(lj/cut/coul/long/tip4p2,PairLJCutCoulLongTIP4P2)
|
||||
PairStyle(lj/charmm/coul/long,PairLJCharmmCoulLong)
|
||||
#endif
|
||||
|
|
|
@ -793,7 +793,7 @@ void Thermo::addfield(const char *key, FnPtr func, int typeflag)
|
|||
|
||||
/* ----------------------------------------------------------------------
|
||||
add compute ID to list of Compute objects to call
|
||||
return index of where this Compute is in list
|
||||
return location of where this Compute is in list
|
||||
if already in list, do not add, just return index, else add to list
|
||||
convert index into which param
|
||||
index = 0 -> scalar, index >= 1 -> vector
|
||||
|
|
|
@ -701,7 +701,7 @@ double Variable::evaluate(char *str, Tree *tree)
|
|||
modify->compute[icompute]->init();
|
||||
|
||||
// call compute_scalar() if index = 0, else compute_vector()
|
||||
// make pre-call to Compute object's pre-compute(s) if defined
|
||||
// if defined, first call Compute object's pre-compute(s)
|
||||
|
||||
int index = atoi(arg);
|
||||
if (index == 0) {
|
||||
|
|
Loading…
Reference in New Issue