git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4450 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -20,6 +20,7 @@
|
|||||||
#include "fix_ave_spatial.h"
|
#include "fix_ave_spatial.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
|
#include "force.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "lattice.h"
|
#include "lattice.h"
|
||||||
#include "modify.h"
|
#include "modify.h"
|
||||||
@ -746,9 +747,10 @@ void FixAveSpatial::end_of_step()
|
|||||||
// time average across samples
|
// time average across samples
|
||||||
// if normflag = ALL, final is total value / total count
|
// if normflag = ALL, final is total value / total count
|
||||||
// if normflag = SAMPLE, final is sum of ave / repeat
|
// if normflag = SAMPLE, final is sum of ave / repeat
|
||||||
// exception is ALL density: normalized by repeat, not total count
|
// exception is densities: normalized by repeat, not total count
|
||||||
|
|
||||||
double repeat = nrepeat;
|
double repeat = nrepeat;
|
||||||
|
double mv2d = force->mv2d;
|
||||||
|
|
||||||
if (normflag == ALL) {
|
if (normflag == ALL) {
|
||||||
MPI_Allreduce(count_many,count_sum,nlayers,MPI_DOUBLE,MPI_SUM,world);
|
MPI_Allreduce(count_many,count_sum,nlayers,MPI_DOUBLE,MPI_SUM,world);
|
||||||
@ -757,8 +759,8 @@ void FixAveSpatial::end_of_step()
|
|||||||
for (m = 0; m < nlayers; m++) {
|
for (m = 0; m < nlayers; m++) {
|
||||||
if (count_sum[m] > 0.0)
|
if (count_sum[m] > 0.0)
|
||||||
for (j = 0; j < nvalues; j++)
|
for (j = 0; j < nvalues; j++)
|
||||||
if (which[j] == DENSITY_NUMBER || which[j] == DENSITY_MASS)
|
if (which[j] == DENSITY_NUMBER) values_sum[m][j] /= repeat;
|
||||||
values_sum[m][j] /= repeat;
|
else if (which[j] == DENSITY_MASS) values_sum[m][j] *= mv2d/repeat;
|
||||||
else values_sum[m][j] /= count_sum[m];
|
else values_sum[m][j] /= count_sum[m];
|
||||||
count_sum[m] /= repeat;
|
count_sum[m] /= repeat;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,7 @@ class Force : protected Pointers {
|
|||||||
double boltz; // Boltzmann constant (eng/degree-K)
|
double boltz; // Boltzmann constant (eng/degree-K)
|
||||||
double mvv2e; // conversion of mv^2 to energy
|
double mvv2e; // conversion of mv^2 to energy
|
||||||
double ftm2v; // conversion of ft/m to velocity
|
double ftm2v; // conversion of ft/m to velocity
|
||||||
|
double mv2d; // conversion of mass/volume to density
|
||||||
double nktv2p; // conversion of NkT/V to pressure
|
double nktv2p; // conversion of NkT/V to pressure
|
||||||
double qqr2e; // conversion of q^2/r to energy
|
double qqr2e; // conversion of q^2/r to energy
|
||||||
double qe2f; // conversion of qE to force
|
double qe2f; // conversion of qE to force
|
||||||
|
|||||||
@ -104,6 +104,7 @@ void Update::set_units(const char *style)
|
|||||||
force->boltz = 1.0;
|
force->boltz = 1.0;
|
||||||
force->mvv2e = 1.0;
|
force->mvv2e = 1.0;
|
||||||
force->ftm2v = 1.0;
|
force->ftm2v = 1.0;
|
||||||
|
force->mv2d = 1.0;
|
||||||
force->nktv2p = 1.0;
|
force->nktv2p = 1.0;
|
||||||
force->qqr2e = 1.0;
|
force->qqr2e = 1.0;
|
||||||
force->qe2f = 1.0;
|
force->qe2f = 1.0;
|
||||||
@ -116,6 +117,7 @@ void Update::set_units(const char *style)
|
|||||||
force->boltz = 0.0019872067;
|
force->boltz = 0.0019872067;
|
||||||
force->mvv2e = 48.88821291 * 48.88821291;
|
force->mvv2e = 48.88821291 * 48.88821291;
|
||||||
force->ftm2v = 1.0 / 48.88821291 / 48.88821291;
|
force->ftm2v = 1.0 / 48.88821291 / 48.88821291;
|
||||||
|
force->mv2d = 1.0 / 0.602214179;
|
||||||
force->nktv2p = 68568.415;
|
force->nktv2p = 68568.415;
|
||||||
force->qqr2e = 332.06371;
|
force->qqr2e = 332.06371;
|
||||||
force->qe2f = 23.060549;
|
force->qe2f = 23.060549;
|
||||||
@ -127,7 +129,8 @@ void Update::set_units(const char *style)
|
|||||||
} else if (strcmp(style,"metal") == 0) {
|
} else if (strcmp(style,"metal") == 0) {
|
||||||
force->boltz = 8.617343e-5;
|
force->boltz = 8.617343e-5;
|
||||||
force->mvv2e = 1.0364269e-4;
|
force->mvv2e = 1.0364269e-4;
|
||||||
force->ftm2v = 1 / 1.0364269e-4;
|
force->ftm2v = 1.0 / 1.0364269e-4;
|
||||||
|
force->mv2d = 1.0 / 0.602214179;
|
||||||
force->nktv2p = 1.6021765e6;
|
force->nktv2p = 1.6021765e6;
|
||||||
force->qqr2e = 14.399645;
|
force->qqr2e = 14.399645;
|
||||||
force->qe2f = 1.0;
|
force->qe2f = 1.0;
|
||||||
@ -140,6 +143,7 @@ void Update::set_units(const char *style)
|
|||||||
force->boltz = 1.3806504e-23;
|
force->boltz = 1.3806504e-23;
|
||||||
force->mvv2e = 1.0;
|
force->mvv2e = 1.0;
|
||||||
force->ftm2v = 1.0;
|
force->ftm2v = 1.0;
|
||||||
|
force->mv2d = 1.0;
|
||||||
force->nktv2p = 1.0;
|
force->nktv2p = 1.0;
|
||||||
force->qqr2e = 8.9876e9;
|
force->qqr2e = 8.9876e9;
|
||||||
force->qe2f = 1.0;
|
force->qe2f = 1.0;
|
||||||
@ -152,6 +156,7 @@ void Update::set_units(const char *style)
|
|||||||
force->boltz = 1.3806504e-16;
|
force->boltz = 1.3806504e-16;
|
||||||
force->mvv2e = 1.0;
|
force->mvv2e = 1.0;
|
||||||
force->ftm2v = 1.0;
|
force->ftm2v = 1.0;
|
||||||
|
force->mv2d = 1.0;
|
||||||
force->nktv2p = 1.0;
|
force->nktv2p = 1.0;
|
||||||
force->qqr2e = 1.0;
|
force->qqr2e = 1.0;
|
||||||
force->qe2f = 1.0;
|
force->qe2f = 1.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user