forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@278 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
a583fc1088
commit
906520c086
|
@ -15,6 +15,7 @@ if ($1 == 1) then
|
|||
cp angle_hybrid.cpp ..
|
||||
cp atom_vec_angle.cpp ..
|
||||
cp atom_vec_bond.cpp ..
|
||||
cp atom_vec_full.cpp ..
|
||||
cp atom_vec_molecular.cpp ..
|
||||
cp bond.cpp ..
|
||||
cp bond_fene.cpp ..
|
||||
|
@ -47,6 +48,7 @@ if ($1 == 1) then
|
|||
cp angle_hybrid.h ..
|
||||
cp atom_vec_angle.h ..
|
||||
cp atom_vec_bond.h ..
|
||||
cp atom_vec_full.h ..
|
||||
cp atom_vec_molecular.h ..
|
||||
# cp bond.h ..
|
||||
cp bond_fene.h ..
|
||||
|
@ -84,6 +86,7 @@ else if ($1 == 0) then
|
|||
rm ../angle_hybrid.cpp
|
||||
rm ../atom_vec_angle.cpp
|
||||
rm ../atom_vec_bond.cpp
|
||||
rm ../atom_vec_full.cpp
|
||||
rm ../atom_vec_molecular.cpp
|
||||
rm ../bond.cpp
|
||||
rm ../bond_fene.cpp
|
||||
|
@ -116,6 +119,7 @@ else if ($1 == 0) then
|
|||
rm ../angle_hybrid.h
|
||||
rm ../atom_vec_angle.h
|
||||
rm ../atom_vec_bond.h
|
||||
rm ../atom_vec_full.h
|
||||
rm ../atom_vec_molecular.h
|
||||
# rm ../bond.h
|
||||
rm ../bond_fene.h
|
||||
|
|
|
@ -40,10 +40,10 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp, int narg, char **arg) :
|
|||
mass_type = 1;
|
||||
size_comm = 3;
|
||||
size_reverse = 3;
|
||||
size_border = 8;
|
||||
size_data_atom = 7;
|
||||
size_border = 7;
|
||||
size_data_atom = 6;
|
||||
size_data_vel = 4;
|
||||
xcol_data = 5;
|
||||
xcol_data = 4;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -70,8 +70,6 @@ void AtomVecMolecular::grow(int n)
|
|||
v = atom->v = memory->grow_2d_double_array(atom->v,nmax,3,"atom:v");
|
||||
f = atom->f = memory->grow_2d_double_array(atom->f,nmax,3,"atom:f");
|
||||
|
||||
q = atom->q = (double *)
|
||||
memory->srealloc(atom->q,nmax*sizeof(double),"atom:q");
|
||||
molecule = atom->molecule = (int *)
|
||||
memory->srealloc(atom->molecule,nmax*sizeof(int),"atom:molecule");
|
||||
|
||||
|
@ -158,7 +156,6 @@ void AtomVecMolecular::reset_ptrs()
|
|||
v = atom->v;
|
||||
f = atom->f;
|
||||
|
||||
q = atom->q;
|
||||
molecule = atom->molecule;
|
||||
nspecial = atom->nspecial;
|
||||
special = atom->special;
|
||||
|
@ -195,7 +192,6 @@ void AtomVecMolecular::reset_ptrs()
|
|||
|
||||
void AtomVecMolecular::zero_owned(int i)
|
||||
{
|
||||
q[i] = 0.0;
|
||||
molecule[i] = 0;
|
||||
num_bond[i] = 0;
|
||||
num_angle[i] = 0;
|
||||
|
@ -217,7 +213,6 @@ void AtomVecMolecular::zero_ghost(int n, int first)
|
|||
int last = first + n;
|
||||
for (int i = first; i < last; i++) {
|
||||
if (i == nmax) atom->avec->grow(0);
|
||||
q[i] = 0.0;
|
||||
molecule[i] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -239,7 +234,6 @@ void AtomVecMolecular::copy(int i, int j)
|
|||
v[j][1] = v[i][1];
|
||||
v[j][2] = v[i][2];
|
||||
|
||||
q[j] = q[i];
|
||||
molecule[j] = molecule[i];
|
||||
|
||||
num_bond[j] = num_bond[i];
|
||||
|
@ -375,7 +369,6 @@ int AtomVecMolecular::pack_border(int n, int *list, double *buf,
|
|||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = q[j];
|
||||
buf[m++] = molecule[j];
|
||||
}
|
||||
} else {
|
||||
|
@ -390,7 +383,6 @@ int AtomVecMolecular::pack_border(int n, int *list, double *buf,
|
|||
buf[m++] = tag[j];
|
||||
buf[m++] = type[j];
|
||||
buf[m++] = mask[j];
|
||||
buf[m++] = q[j];
|
||||
buf[m++] = molecule[j];
|
||||
}
|
||||
}
|
||||
|
@ -401,7 +393,6 @@ int AtomVecMolecular::pack_border(int n, int *list, double *buf,
|
|||
|
||||
int AtomVecMolecular::pack_border_one(int i, double *buf)
|
||||
{
|
||||
buf[0] = q[i];
|
||||
buf[1] = molecule[i];
|
||||
return 2;
|
||||
}
|
||||
|
@ -422,7 +413,6 @@ void AtomVecMolecular::unpack_border(int n, int first, double *buf)
|
|||
tag[i] = static_cast<int> (buf[m++]);
|
||||
type[i] = static_cast<int> (buf[m++]);
|
||||
mask[i] = static_cast<int> (buf[m++]);
|
||||
q[i] = buf[m++];
|
||||
molecule[i] = static_cast<int> (buf[m++]);
|
||||
}
|
||||
}
|
||||
|
@ -431,7 +421,6 @@ void AtomVecMolecular::unpack_border(int n, int first, double *buf)
|
|||
|
||||
int AtomVecMolecular::unpack_border_one(int i, double *buf)
|
||||
{
|
||||
q[i] = buf[0];
|
||||
molecule[i] = static_cast<int> (buf[1]);
|
||||
return 2;
|
||||
}
|
||||
|
@ -457,7 +446,6 @@ int AtomVecMolecular::pack_exchange(int i, double *buf)
|
|||
buf[m++] = mask[i];
|
||||
buf[m++] = image[i];
|
||||
|
||||
buf[m++] = q[i];
|
||||
buf[m++] = molecule[i];
|
||||
|
||||
buf[m++] = num_bond[i];
|
||||
|
@ -526,7 +514,6 @@ int AtomVecMolecular::unpack_exchange(double *buf)
|
|||
mask[nlocal] = static_cast<int> (buf[m++]);
|
||||
image[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
||||
q[nlocal] = buf[m++];
|
||||
molecule[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
||||
num_bond[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
@ -633,7 +620,6 @@ int AtomVecMolecular::pack_restart(int i, double *buf)
|
|||
buf[m++] = v[i][1];
|
||||
buf[m++] = v[i][2];
|
||||
|
||||
buf[m++] = q[i];
|
||||
buf[m++] = molecule[i];
|
||||
|
||||
buf[m++] = num_bond[i];
|
||||
|
@ -705,7 +691,6 @@ int AtomVecMolecular::unpack_restart(double *buf)
|
|||
v[nlocal][1] = buf[m++];
|
||||
v[nlocal][2] = buf[m++];
|
||||
|
||||
q[nlocal] = buf[m++];
|
||||
molecule[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
||||
num_bond[nlocal] = static_cast<int> (buf[m++]);
|
||||
|
@ -772,7 +757,6 @@ void AtomVecMolecular::create_atom(int itype, double x0, double y0, double z0,
|
|||
v[nlocal][1] = 0.0;
|
||||
v[nlocal][2] = 0.0;
|
||||
|
||||
q[nlocal] = 0.0;
|
||||
molecule[nlocal] = 0;
|
||||
num_bond[nlocal] = 0;
|
||||
num_angle[nlocal] = 0;
|
||||
|
@ -803,8 +787,6 @@ void AtomVecMolecular::data_atom(double xtmp, double ytmp, double ztmp,
|
|||
if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
|
||||
error->one("Invalid atom type in Atoms section of data file");
|
||||
|
||||
q[nlocal] = atof(values[3]);
|
||||
|
||||
x[nlocal][0] = xtmp;
|
||||
x[nlocal][1] = ytmp;
|
||||
x[nlocal][2] = ztmp;
|
||||
|
|
|
@ -47,7 +47,6 @@ class AtomVecMolecular : public AtomVec {
|
|||
private:
|
||||
int *tag,*type,*mask,*image;
|
||||
double **x,**v,**f;
|
||||
double *q;
|
||||
int *molecule;
|
||||
int **nspecial,**special;
|
||||
int *num_bond;
|
||||
|
|
|
@ -30,12 +30,14 @@ AngleStyle(hybrid,AngleHybrid)
|
|||
#ifdef AtomInclude
|
||||
#include "atom_vec_angle.h"
|
||||
#include "atom_vec_bond.h"
|
||||
#include "atom_vec_full.h"
|
||||
#include "atom_vec_molecular.h"
|
||||
#endif
|
||||
|
||||
#ifdef AtomClass
|
||||
AtomStyle(angle,AtomVecAngle)
|
||||
AtomStyle(bond,AtomVecBond)
|
||||
AtomStyle(full,AtomVecFull)
|
||||
AtomStyle(molecular,AtomVecMolecular)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -561,6 +561,7 @@ void DumpCustom::parse_fields(int narg, char **arg)
|
|||
} else if (strcmp(arg[iarg],"type") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_type;
|
||||
vtype[i] = INT;
|
||||
|
||||
} else if (strcmp(arg[iarg],"x") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_x;
|
||||
vtype[i] = DOUBLE;
|
||||
|
@ -597,6 +598,7 @@ void DumpCustom::parse_fields(int narg, char **arg)
|
|||
} else if (strcmp(arg[iarg],"iz") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_iz;
|
||||
vtype[i] = INT;
|
||||
|
||||
} else if (strcmp(arg[iarg],"vx") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_vx;
|
||||
vtype[i] = DOUBLE;
|
||||
|
@ -615,6 +617,7 @@ void DumpCustom::parse_fields(int narg, char **arg)
|
|||
} else if (strcmp(arg[iarg],"fz") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_fz;
|
||||
vtype[i] = DOUBLE;
|
||||
|
||||
} else if (strcmp(arg[iarg],"q") == 0) {
|
||||
if (atom->q == NULL)
|
||||
error->all("Dumping an atom quantity that isn't allocated");
|
||||
|
@ -650,6 +653,7 @@ void DumpCustom::parse_fields(int narg, char **arg)
|
|||
error->all("Dumping an atom quantity that isn't allocated");
|
||||
pack_choice[i] = &DumpCustom::pack_tqz;
|
||||
vtype[i] = DOUBLE;
|
||||
|
||||
} else if (strcmp(arg[iarg],"epair") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_epair;
|
||||
vtype[i] = DOUBLE;
|
||||
|
@ -667,6 +671,7 @@ void DumpCustom::parse_fields(int narg, char **arg)
|
|||
pack_choice[i] = &DumpCustom::pack_centro;
|
||||
vtype[i] = DOUBLE;
|
||||
index_centro = add_compute(style_centro,1);
|
||||
|
||||
} else if (strcmp(arg[iarg],"sxx") == 0) {
|
||||
pack_choice[i] = &DumpCustom::pack_sxx;
|
||||
vtype[i] = DOUBLE;
|
||||
|
|
|
@ -30,12 +30,14 @@ AngleStyle(hybrid,AngleHybrid)
|
|||
#ifdef AtomInclude
|
||||
#include "atom_vec_angle.h"
|
||||
#include "atom_vec_bond.h"
|
||||
#include "atom_vec_full.h"
|
||||
#include "atom_vec_molecular.h"
|
||||
#endif
|
||||
|
||||
#ifdef AtomClass
|
||||
AtomStyle(angle,AtomVecAngle)
|
||||
AtomStyle(bond,AtomVecBond)
|
||||
AtomStyle(full,AtomVecFull)
|
||||
AtomStyle(molecular,AtomVecMolecular)
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,7 +41,8 @@ using namespace LAMMPS_NS;
|
|||
|
||||
// step, atoms, cpu, temp, press, pe, ke, etotal, enthalpy
|
||||
// evdwl, ecoul, epair, ebond, eangle, edihed, eimp, emol, elong, etail
|
||||
// vol, lx, ly, lz, pxx, pyy, pzz, pxy, pxz, pyz
|
||||
// vol, lx, ly, lz, xlo, xhi, ylo, yhi, zlo, zhi
|
||||
// pxx, pyy, pzz, pxy, pxz, pyz
|
||||
// drot, grot (rotational KE for dipole and granular particles)
|
||||
// tave, pave, eave, peave (time-averaged quantities)
|
||||
|
||||
|
@ -660,6 +661,7 @@ void Thermo::parse_fields(char *str)
|
|||
addfield("Atoms",&Thermo::compute_atoms,INT);
|
||||
} else if (strcmp(word,"cpu") == 0) {
|
||||
addfield("CPU",&Thermo::compute_cpu,FLOAT);
|
||||
|
||||
} else if (strcmp(word,"temp") == 0) {
|
||||
addfield("Temp",&Thermo::compute_temp,FLOAT);
|
||||
index_temp = add_compute(id_temp,0);
|
||||
|
@ -681,6 +683,7 @@ void Thermo::parse_fields(char *str)
|
|||
addfield("Enthalpy",&Thermo::compute_enthalpy,FLOAT);
|
||||
index_temp = add_compute(id_temp,0);
|
||||
index_press = add_compute(id_press,0);
|
||||
|
||||
} else if (strcmp(word,"evdwl") == 0) {
|
||||
addfield("E_vdwl",&Thermo::compute_evdwl,FLOAT);
|
||||
} else if (strcmp(word,"ecoul") == 0) {
|
||||
|
@ -701,6 +704,7 @@ void Thermo::parse_fields(char *str)
|
|||
addfield("E_long",&Thermo::compute_elong,FLOAT);
|
||||
} else if (strcmp(word,"etail") == 0) {
|
||||
addfield("E_tail",&Thermo::compute_etail,FLOAT);
|
||||
|
||||
} else if (strcmp(word,"vol") == 0) {
|
||||
addfield("Volume",&Thermo::compute_vol,FLOAT);
|
||||
} else if (strcmp(word,"lx") == 0) {
|
||||
|
@ -709,6 +713,20 @@ void Thermo::parse_fields(char *str)
|
|||
addfield("Ly",&Thermo::compute_ly,FLOAT);
|
||||
} else if (strcmp(word,"lz") == 0) {
|
||||
addfield("Lz",&Thermo::compute_lz,FLOAT);
|
||||
|
||||
} else if (strcmp(word,"xlo") == 0) {
|
||||
addfield("Xlo",&Thermo::compute_xlo,FLOAT);
|
||||
} else if (strcmp(word,"xhi") == 0) {
|
||||
addfield("Xhi",&Thermo::compute_xhi,FLOAT);
|
||||
} else if (strcmp(word,"ylo") == 0) {
|
||||
addfield("Ylo",&Thermo::compute_ylo,FLOAT);
|
||||
} else if (strcmp(word,"yhi") == 0) {
|
||||
addfield("Yhi",&Thermo::compute_yhi,FLOAT);
|
||||
} else if (strcmp(word,"zlo") == 0) {
|
||||
addfield("Zlo",&Thermo::compute_zlo,FLOAT);
|
||||
} else if (strcmp(word,"zhi") == 0) {
|
||||
addfield("Zhi",&Thermo::compute_zhi,FLOAT);
|
||||
|
||||
} else if (strcmp(word,"pxx") == 0) {
|
||||
addfield("Pxx",&Thermo::compute_pxx,FLOAT);
|
||||
index_temp = add_compute(id_temp,1);
|
||||
|
@ -733,12 +751,14 @@ void Thermo::parse_fields(char *str)
|
|||
addfield("Pyz",&Thermo::compute_pyz,FLOAT);
|
||||
index_temp = add_compute(id_temp,1);
|
||||
index_press = add_compute(id_press,1);
|
||||
|
||||
} else if (strcmp(word,"drot") == 0) {
|
||||
addfield("RotKEdip",&Thermo::compute_drot,FLOAT);
|
||||
index_drot = add_compute(id_drot,0);
|
||||
} else if (strcmp(word,"grot") == 0) {
|
||||
addfield("RotKEgrn",&Thermo::compute_grot,FLOAT);
|
||||
index_grot = add_compute(id_grot,0);
|
||||
|
||||
} else if (strcmp(word,"tave") == 0) {
|
||||
addfield("T_ave",&Thermo::compute_tave,FLOAT);
|
||||
index_temp = add_compute(id_temp,0);
|
||||
|
@ -934,12 +954,14 @@ int Thermo::evaluate_keyword(char *word, double *answer)
|
|||
dvalue = ivalue;
|
||||
}
|
||||
else if (strcmp(word,"cpu") == 0) compute_cpu();
|
||||
|
||||
else if (strcmp(word,"temp") == 0) compute_temp();
|
||||
else if (strcmp(word,"press") == 0) compute_press();
|
||||
else if (strcmp(word,"pe") == 0) compute_pe();
|
||||
else if (strcmp(word,"ke") == 0) compute_ke();
|
||||
else if (strcmp(word,"etotal") == 0) compute_etotal();
|
||||
else if (strcmp(word,"enthalpy") == 0) compute_enthalpy();
|
||||
|
||||
else if (strcmp(word,"evdwl") == 0) compute_evdwl();
|
||||
else if (strcmp(word,"ecoul") == 0) compute_ecoul();
|
||||
else if (strcmp(word,"epair") == 0) compute_epair();
|
||||
|
@ -950,18 +972,29 @@ int Thermo::evaluate_keyword(char *word, double *answer)
|
|||
else if (strcmp(word,"emol") == 0) compute_emol();
|
||||
else if (strcmp(word,"elong") == 0) compute_elong();
|
||||
else if (strcmp(word,"etail") == 0) compute_etail();
|
||||
|
||||
else if (strcmp(word,"vol") == 0) compute_vol();
|
||||
else if (strcmp(word,"lx") == 0) compute_lx();
|
||||
else if (strcmp(word,"ly") == 0) compute_ly();
|
||||
else if (strcmp(word,"lz") == 0) compute_lz();
|
||||
|
||||
else if (strcmp(word,"xlo") == 0) compute_xlo();
|
||||
else if (strcmp(word,"xhi") == 0) compute_xhi();
|
||||
else if (strcmp(word,"ylo") == 0) compute_ylo();
|
||||
else if (strcmp(word,"yhi") == 0) compute_yhi();
|
||||
else if (strcmp(word,"zlo") == 0) compute_zlo();
|
||||
else if (strcmp(word,"zhi") == 0) compute_zhi();
|
||||
|
||||
else if (strcmp(word,"pxx") == 0) compute_pxx();
|
||||
else if (strcmp(word,"pyy") == 0) compute_pyy();
|
||||
else if (strcmp(word,"pzz") == 0) compute_pzz();
|
||||
else if (strcmp(word,"pxy") == 0) compute_pxy();
|
||||
else if (strcmp(word,"pxz") == 0) compute_pxz();
|
||||
else if (strcmp(word,"pyz") == 0) compute_pyz();
|
||||
|
||||
else if (strcmp(word,"drot") == 0) compute_drot();
|
||||
else if (strcmp(word,"grot") == 0) compute_grot();
|
||||
|
||||
else if (strcmp(word,"tave") == 0) compute_tave();
|
||||
else if (strcmp(word,"pave") == 0) compute_pave();
|
||||
else if (strcmp(word,"eave") == 0) compute_eave();
|
||||
|
@ -1291,6 +1324,48 @@ void Thermo::compute_lz()
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_xlo()
|
||||
{
|
||||
dvalue = domain->boxxlo;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_xhi()
|
||||
{
|
||||
dvalue = domain->boxxhi;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_ylo()
|
||||
{
|
||||
dvalue = domain->boxylo;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_yhi()
|
||||
{
|
||||
dvalue = domain->boxyhi;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_zlo()
|
||||
{
|
||||
dvalue = domain->boxzlo;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_zhi()
|
||||
{
|
||||
dvalue = domain->boxzhi;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void Thermo::compute_pxx()
|
||||
{
|
||||
if (!thermoflag) {
|
||||
|
|
13
src/thermo.h
13
src/thermo.h
|
@ -119,12 +119,14 @@ class Thermo : protected Pointers {
|
|||
void compute_step();
|
||||
void compute_atoms();
|
||||
void compute_cpu();
|
||||
|
||||
void compute_temp();
|
||||
void compute_press();
|
||||
void compute_pe();
|
||||
void compute_ke();
|
||||
void compute_etotal();
|
||||
void compute_enthalpy();
|
||||
|
||||
void compute_evdwl();
|
||||
void compute_ecoul();
|
||||
void compute_epair();
|
||||
|
@ -135,18 +137,29 @@ class Thermo : protected Pointers {
|
|||
void compute_emol();
|
||||
void compute_elong();
|
||||
void compute_etail();
|
||||
|
||||
void compute_vol();
|
||||
void compute_lx();
|
||||
void compute_ly();
|
||||
void compute_lz();
|
||||
|
||||
void compute_xlo();
|
||||
void compute_xhi();
|
||||
void compute_ylo();
|
||||
void compute_yhi();
|
||||
void compute_zlo();
|
||||
void compute_zhi();
|
||||
|
||||
void compute_pxx();
|
||||
void compute_pyy();
|
||||
void compute_pzz();
|
||||
void compute_pxy();
|
||||
void compute_pyz();
|
||||
void compute_pxz();
|
||||
|
||||
void compute_drot();
|
||||
void compute_grot();
|
||||
|
||||
void compute_tave();
|
||||
void compute_pave();
|
||||
void compute_eave();
|
||||
|
|
Loading…
Reference in New Issue