more changes
This commit is contained in:
@ -149,7 +149,7 @@ void ComputeCentroidStressAtom::init()
|
|||||||
|
|
||||||
if (fixflag) {
|
if (fixflag) {
|
||||||
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
||||||
if (modify->fix[ifix]->virial_flag &&
|
if (modify->fix[ifix]->virial_peratom_flag &&
|
||||||
modify->fix[ifix]->centroidstressflag == CENTROID_NOTAVAIL)
|
modify->fix[ifix]->centroidstressflag == CENTROID_NOTAVAIL)
|
||||||
error->all(FLERR, "Fix style does not support compute centroid/stress/atom");
|
error->all(FLERR, "Fix style does not support compute centroid/stress/atom");
|
||||||
}
|
}
|
||||||
@ -273,9 +273,11 @@ void ComputeCentroidStressAtom::compute_peratom()
|
|||||||
// fix styles are CENTROID_SAME or CENTROID_NOTAVAIL
|
// fix styles are CENTROID_SAME or CENTROID_NOTAVAIL
|
||||||
|
|
||||||
if (fixflag) {
|
if (fixflag) {
|
||||||
for (int ifix = 0; ifix < modify->nfix; ifix++)
|
Fix **fix = modify->fix;
|
||||||
if (modify->fix[ifix]->virial_flag) {
|
int nfix = modify->nfix;
|
||||||
double **vatom = modify->fix[ifix]->vatom;
|
for (int ifix = 0; ifix < nfix; ifix++)
|
||||||
|
if (fix[ifix]->virial_peratom_flag && fix[ifix]->thermo_virial) {
|
||||||
|
double **vatom = fix[ifix]->vatom;
|
||||||
if (vatom)
|
if (vatom)
|
||||||
for (i = 0; i < nlocal; i++) {
|
for (i = 0; i < nlocal; i++) {
|
||||||
for (j = 0; j < 6; j++)
|
for (j = 0; j < 6; j++)
|
||||||
|
|||||||
@ -222,7 +222,7 @@ void ComputeStressAtom::compute_peratom()
|
|||||||
Fix **fix = modify->fix;
|
Fix **fix = modify->fix;
|
||||||
int nfix = modify->nfix;
|
int nfix = modify->nfix;
|
||||||
for (int ifix = 0; ifix < nfix; ifix++)
|
for (int ifix = 0; ifix < nfix; ifix++)
|
||||||
if (fix[i]->virial_peratom_flag && fix[ifix]->virial_flag) {
|
if (fix[i]->virial_peratom_flag && fix[ifix]->thermo_virial) {
|
||||||
double **vatom = modify->fix[ifix]->vatom;
|
double **vatom = modify->fix[ifix]->vatom;
|
||||||
if (vatom)
|
if (vatom)
|
||||||
for (i = 0; i < nlocal; i++)
|
for (i = 0; i < nlocal; i++)
|
||||||
|
|||||||
@ -67,7 +67,6 @@ Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) :
|
|||||||
virial_global_flag = virial_peratom_flag = 0;
|
virial_global_flag = virial_peratom_flag = 0;
|
||||||
ecouple_flag = 0;
|
ecouple_flag = 0;
|
||||||
rigid_flag = 0;
|
rigid_flag = 0;
|
||||||
peatom_flag = 0;
|
|
||||||
no_change_box = 0;
|
no_change_box = 0;
|
||||||
time_integrate = 0;
|
time_integrate = 0;
|
||||||
time_depend = 0;
|
time_depend = 0;
|
||||||
@ -152,7 +151,8 @@ void Fix::modify_params(int narg, char **arg)
|
|||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0;
|
if (strcmp(arg[iarg+1],"no") == 0) thermo_energy = 0;
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) {
|
else if (strcmp(arg[iarg+1],"yes") == 0) {
|
||||||
if (energy_flag == 0) error->all(FLERR,"Illegal fix_modify command");
|
if (energy_global_flag == 0 && energy_peratom_flag == 0)
|
||||||
|
error->all(FLERR,"Illegal fix_modify command");
|
||||||
thermo_energy = 1;
|
thermo_energy = 1;
|
||||||
} else error->all(FLERR,"Illegal fix_modify command");
|
} else error->all(FLERR,"Illegal fix_modify command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
@ -160,7 +160,8 @@ void Fix::modify_params(int narg, char **arg)
|
|||||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command");
|
if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command");
|
||||||
if (strcmp(arg[iarg+1],"no") == 0) thermo_virial = 0;
|
if (strcmp(arg[iarg+1],"no") == 0) thermo_virial = 0;
|
||||||
else if (strcmp(arg[iarg+1],"yes") == 0) {
|
else if (strcmp(arg[iarg+1],"yes") == 0) {
|
||||||
if (virial_flag == 0) error->all(FLERR,"Illegal fix_modify command");
|
if (virial_global_flag == 0 && virial_peratom_flag == 0)
|
||||||
|
error->all(FLERR,"Illegal fix_modify command");
|
||||||
thermo_virial = 1;
|
thermo_virial = 1;
|
||||||
} else error->all(FLERR,"Illegal fix_modify command");
|
} else error->all(FLERR,"Illegal fix_modify command");
|
||||||
iarg += 2;
|
iarg += 2;
|
||||||
|
|||||||
@ -510,7 +510,7 @@ double Modify::energy_couple()
|
|||||||
double Modify::energy_global()
|
double Modify::energy_global()
|
||||||
{
|
{
|
||||||
double energy = 0.0;
|
double energy = 0.0;
|
||||||
for (i = 0; i < n_energy_global; i++)
|
for (int i = 0; i < n_energy_global; i++)
|
||||||
energy += fix[list_energy_global[i]]->compute_scalar();
|
energy += fix[list_energy_global[i]]->compute_scalar();
|
||||||
return energy;
|
return energy;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1366,7 +1366,8 @@ int Thermo::evaluate_keyword(const char *word, double *answer)
|
|||||||
compute_enthalpy();
|
compute_enthalpy();
|
||||||
|
|
||||||
} else if (strcmp(word,"ecouple") == 0) compute_ecouple();
|
} else if (strcmp(word,"ecouple") == 0) compute_ecouple();
|
||||||
} else if (strcmp(word,"econserve") == 0) {
|
|
||||||
|
else if (strcmp(word,"econserve") == 0) {
|
||||||
if (!pe)
|
if (!pe)
|
||||||
error->all(FLERR,
|
error->all(FLERR,
|
||||||
"Thermo keyword in variable requires thermo to use/init pe");
|
"Thermo keyword in variable requires thermo to use/init pe");
|
||||||
@ -1765,7 +1766,7 @@ void Thermo::compute_etotal()
|
|||||||
|
|
||||||
void Thermo::compute_ecouple()
|
void Thermo::compute_ecouple()
|
||||||
{
|
{
|
||||||
dvalue = modify->ecouple();
|
dvalue = modify->energy_couple();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|||||||
Reference in New Issue
Block a user