git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@13951 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -116,9 +116,10 @@ void ThrData::init_force(int nall, double **f, double **torque,
|
|||||||
|
|
||||||
void ThrData::init_eam(int nall, double *rho)
|
void ThrData::init_eam(int nall, double *rho)
|
||||||
{
|
{
|
||||||
_rho = rho + _tid*nall;
|
if (nall >= 0 && rho) {
|
||||||
if (nall > 0)
|
_rho = rho + _tid*nall;
|
||||||
memset(_rho, 0, nall*sizeof(double));
|
memset(_rho, 0, nall*sizeof(double));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
@ -127,9 +128,9 @@ void ThrData::init_adp(int nall, double *rho, double **mu, double **lambda)
|
|||||||
{
|
{
|
||||||
init_eam(nall, rho);
|
init_eam(nall, rho);
|
||||||
|
|
||||||
_mu = mu + _tid*nall;
|
if (nall >= 0 && mu && lambda) {
|
||||||
_lambda = lambda + _tid*nall;
|
_mu = mu + _tid*nall;
|
||||||
if (nall > 0) {
|
_lambda = lambda + _tid*nall;
|
||||||
memset(&(_mu[0][0]), 0, nall*3*sizeof(double));
|
memset(&(_mu[0][0]), 0, nall*3*sizeof(double));
|
||||||
memset(&(_lambda[0][0]), 0, nall*6*sizeof(double));
|
memset(&(_lambda[0][0]), 0, nall*6*sizeof(double));
|
||||||
}
|
}
|
||||||
@ -141,9 +142,9 @@ void ThrData::init_cdeam(int nall, double *rho, double *rhoB, double *D_values)
|
|||||||
{
|
{
|
||||||
init_eam(nall, rho);
|
init_eam(nall, rho);
|
||||||
|
|
||||||
_rhoB = rhoB + _tid*nall;
|
if (nall >= 0 && rhoB && D_values) {
|
||||||
_D_values = D_values + _tid*nall;
|
_rhoB = rhoB + _tid*nall;
|
||||||
if (nall > 0) {
|
_D_values = D_values + _tid*nall;
|
||||||
memset(_rhoB, 0, nall*sizeof(double));
|
memset(_rhoB, 0, nall*sizeof(double));
|
||||||
memset(_D_values, 0, nall*sizeof(double));
|
memset(_D_values, 0, nall*sizeof(double));
|
||||||
}
|
}
|
||||||
@ -155,8 +156,8 @@ void ThrData::init_eim(int nall, double *rho, double *fp)
|
|||||||
{
|
{
|
||||||
init_eam(nall, rho);
|
init_eam(nall, rho);
|
||||||
|
|
||||||
_fp = fp + _tid*nall;
|
if (nall >= 0 && fp)
|
||||||
if (nall > 0)
|
_fp = fp + _tid*nall;
|
||||||
memset(_fp,0,nall*sizeof(double));
|
memset(_fp,0,nall*sizeof(double));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -513,6 +513,18 @@ void ThrOMP::ev_tally_thr(Pair * const pair, const int i, const int j, const int
|
|||||||
|
|
||||||
v_tally_thr(pair, i, j, nlocal, newton_pair, v, thr);
|
v_tally_thr(pair, i, j, nlocal, newton_pair, v, thr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pair->num_tally_compute > 0) {
|
||||||
|
// ev_tally callbacks are not thread safe and thus have to be protected
|
||||||
|
#if defined(_OPENMP)
|
||||||
|
#pragma omp critical
|
||||||
|
#endif
|
||||||
|
for (int k=0; k < pair->num_tally_compute; ++k) {
|
||||||
|
Compute *c = pair->list_tally_compute[k];
|
||||||
|
c->pair_tally_callback(i, j, nlocal, newton_pair,
|
||||||
|
evdwl, ecoul, fpair, delx, dely, delz);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
|||||||
@ -138,6 +138,10 @@ void FixTempBerendsen::end_of_step()
|
|||||||
double t_current = temperature->compute_scalar();
|
double t_current = temperature->compute_scalar();
|
||||||
double tdof = temperature->dof;
|
double tdof = temperature->dof;
|
||||||
|
|
||||||
|
// there is nothing to do, if there are no degrees of freedom
|
||||||
|
|
||||||
|
if (tdof < 1) return;
|
||||||
|
|
||||||
if (t_current == 0.0)
|
if (t_current == 0.0)
|
||||||
error->all(FLERR,
|
error->all(FLERR,
|
||||||
"Computed temperature for fix temp/berendsen cannot be 0.0");
|
"Computed temperature for fix temp/berendsen cannot be 0.0");
|
||||||
|
|||||||
@ -183,6 +183,10 @@ void FixTempCSLD::end_of_step()
|
|||||||
double t_current = temperature->compute_scalar();
|
double t_current = temperature->compute_scalar();
|
||||||
double ekin_old = t_current * 0.5 * temperature->dof * force->boltz;
|
double ekin_old = t_current * 0.5 * temperature->dof * force->boltz;
|
||||||
|
|
||||||
|
// there is nothing to do, if there are no degrees of freedom
|
||||||
|
|
||||||
|
if (temperature->dof < 1) return;
|
||||||
|
|
||||||
double * const * const v = atom->v;
|
double * const * const v = atom->v;
|
||||||
const int * const mask = atom->mask;
|
const int * const mask = atom->mask;
|
||||||
const int * const type = atom->type;
|
const int * const type = atom->type;
|
||||||
|
|||||||
@ -244,7 +244,12 @@ void FixTempCSVR::end_of_step()
|
|||||||
const double ekin_old = t_current * efactor;
|
const double ekin_old = t_current * efactor;
|
||||||
const double ekin_new = t_target * efactor;
|
const double ekin_new = t_target * efactor;
|
||||||
|
|
||||||
|
// there is nothing to do, if there are no degrees of freedom
|
||||||
|
|
||||||
|
if (temperature->dof < 1) return;
|
||||||
|
|
||||||
// compute velocity scaling factor on root node and broadcast
|
// compute velocity scaling factor on root node and broadcast
|
||||||
|
|
||||||
double lamda;
|
double lamda;
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
lamda = resamplekin(ekin_old, ekin_new);
|
lamda = resamplekin(ekin_old, ekin_new);
|
||||||
|
|||||||
@ -133,6 +133,13 @@ void FixTempRescale::init()
|
|||||||
void FixTempRescale::end_of_step()
|
void FixTempRescale::end_of_step()
|
||||||
{
|
{
|
||||||
double t_current = temperature->compute_scalar();
|
double t_current = temperature->compute_scalar();
|
||||||
|
|
||||||
|
// there is nothing to do, if there are no degrees of freedom
|
||||||
|
|
||||||
|
if (temperature->dof < 1) return;
|
||||||
|
|
||||||
|
// protect against division by zero.
|
||||||
|
|
||||||
if (t_current == 0.0)
|
if (t_current == 0.0)
|
||||||
error->all(FLERR,"Computed temperature for fix temp/rescale cannot be 0.0");
|
error->all(FLERR,"Computed temperature for fix temp/rescale cannot be 0.0");
|
||||||
|
|
||||||
|
|||||||
@ -188,7 +188,7 @@ class Pair : protected Pointers {
|
|||||||
|
|
||||||
// management of callbacks to be run from ev_tally()
|
// management of callbacks to be run from ev_tally()
|
||||||
|
|
||||||
private:
|
protected:
|
||||||
int num_tally_compute;
|
int num_tally_compute;
|
||||||
class Compute **list_tally_compute;
|
class Compute **list_tally_compute;
|
||||||
public:
|
public:
|
||||||
|
|||||||
Reference in New Issue
Block a user