forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5718 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
a21e59fa7e
commit
2bd4074d8c
|
@ -15,6 +15,7 @@
|
||||||
Contributing author: Andres Jaramillo-Botero
|
Contributing author: Andres Jaramillo-Botero
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "math.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "compute_ke_atom_eff.h"
|
#include "compute_ke_atom_eff.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
@ -96,7 +97,7 @@ void ComputeKEAtomEff::compute_peratom()
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
ke[i] = 0.5 * mvv2e * mass[type[i]] *
|
ke[i] = 0.5 * mvv2e * mass[type[i]] *
|
||||||
(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
|
(v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]);
|
||||||
if (abs(spin[i])==1)
|
if (fabs(spin[i])==1)
|
||||||
ke[i] += 0.5 * mvv2e * mass[type[i]] * ervel[i]*ervel[i] * 0.75;
|
ke[i] += 0.5 * mvv2e * mass[type[i]] * ervel[i]*ervel[i] * 0.75;
|
||||||
} else ke[i] = 0.0;
|
} else ke[i] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
#include "math.h"
|
||||||
#include "compute_ke_eff.h"
|
#include "compute_ke_eff.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
|
@ -70,7 +71,7 @@ double ComputeKEEff::compute_scalar()
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
ke += mass[type[i]]*(v[i][0]*v[i][0] + v[i][1]*v[i][1] +
|
ke += mass[type[i]]*(v[i][0]*v[i][0] + v[i][1]*v[i][1] +
|
||||||
v[i][2]*v[i][2]);
|
v[i][2]*v[i][2]);
|
||||||
if (abs(spin[i])==1) ke += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
if (fabs(spin[i])==1) ke += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,8 +16,9 @@
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
#include "compute_temp_deform_eff.h"
|
#include "math.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
|
#include "compute_temp_deform_eff.h"
|
||||||
#include "domain.h"
|
#include "domain.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
|
@ -107,7 +108,7 @@ void ComputeTempDeformEff::dof_compute()
|
||||||
int one = 0;
|
int one = 0;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
if (abs(spin[i])==1) one++;
|
if (fabs(spin[i]) == 1) one++;
|
||||||
}
|
}
|
||||||
int nelectrons;
|
int nelectrons;
|
||||||
MPI_Allreduce(&one,&nelectrons,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&one,&nelectrons,1,MPI_INT,MPI_SUM,world);
|
||||||
|
@ -158,7 +159,7 @@ double ComputeTempDeformEff::compute_scalar()
|
||||||
if (mass) {
|
if (mass) {
|
||||||
t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
|
t += (vthermal[0]*vthermal[0] + vthermal[1]*vthermal[1] +
|
||||||
vthermal[2]*vthermal[2])* mass[type[i]];
|
vthermal[2]*vthermal[2])* mass[type[i]];
|
||||||
if (abs(spin[i])==1) t += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
if (fabs(spin[i])==1) t += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +210,7 @@ void ComputeTempDeformEff::compute_vector()
|
||||||
t[3] += massone * vthermal[0]*vthermal[1];
|
t[3] += massone * vthermal[0]*vthermal[1];
|
||||||
t[4] += massone * vthermal[0]*vthermal[2];
|
t[4] += massone * vthermal[0]*vthermal[2];
|
||||||
t[5] += massone * vthermal[1]*vthermal[2];
|
t[5] += massone * vthermal[1]*vthermal[2];
|
||||||
if (abs(spin[i])==1) {
|
if (fabs(spin[i])==1) {
|
||||||
t[0] += 0.75 * massone * ervel[i]*ervel[i];
|
t[0] += 0.75 * massone * ervel[i]*ervel[i];
|
||||||
t[1] += 0.75 * massone * ervel[i]*ervel[i];
|
t[1] += 0.75 * massone * ervel[i]*ervel[i];
|
||||||
t[2] += 0.75 * massone * ervel[i]*ervel[i];
|
t[2] += 0.75 * massone * ervel[i]*ervel[i];
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
#include "math.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "compute_temp_eff.h"
|
#include "compute_temp_eff.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
@ -80,7 +81,7 @@ void ComputeTempEff::dof_compute()
|
||||||
int one = 0;
|
int one = 0;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
if (abs(spin[i])==1) one++;
|
if (fabs(spin[i])==1) one++;
|
||||||
}
|
}
|
||||||
int nelectrons;
|
int nelectrons;
|
||||||
MPI_Allreduce(&one,&nelectrons,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&one,&nelectrons,1,MPI_INT,MPI_SUM,world);
|
||||||
|
@ -114,7 +115,7 @@ double ComputeTempEff::compute_scalar()
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
|
t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
|
||||||
mass[type[i]];
|
mass[type[i]];
|
||||||
if (abs(spin[i])==1) t += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
if (fabs(spin[i])==1) t += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -153,7 +154,7 @@ void ComputeTempEff::compute_vector()
|
||||||
t[3] += massone * v[i][0]*v[i][1];
|
t[3] += massone * v[i][0]*v[i][1];
|
||||||
t[4] += massone * v[i][0]*v[i][2];
|
t[4] += massone * v[i][0]*v[i][2];
|
||||||
t[5] += massone * v[i][1]*v[i][2];
|
t[5] += massone * v[i][1]*v[i][2];
|
||||||
if (abs(spin[i])==1) {
|
if (fabs(spin[i])==1) {
|
||||||
t[0] += 0.75*massone*ervel[i]*ervel[i];
|
t[0] += 0.75*massone*ervel[i]*ervel[i];
|
||||||
t[1] += 0.75*massone*ervel[i]*ervel[i];
|
t[1] += 0.75*massone*ervel[i]*ervel[i];
|
||||||
t[2] += 0.75*massone*ervel[i]*ervel[i];
|
t[2] += 0.75*massone*ervel[i]*ervel[i];
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#include "mpi.h"
|
#include "mpi.h"
|
||||||
|
#include "math.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "compute_temp_region_eff.h"
|
#include "compute_temp_region_eff.h"
|
||||||
#include "atom.h"
|
#include "atom.h"
|
||||||
|
@ -114,7 +115,7 @@ double ComputeTempRegionEff::compute_scalar()
|
||||||
count++;
|
count++;
|
||||||
t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
|
t += (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]) *
|
||||||
mass[type[i]];
|
mass[type[i]];
|
||||||
if (abs(spin[i])==1) t += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
if (fabs(spin[i])==1) t += 0.75*mass[type[i]]*ervel[i]*ervel[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,7 +128,7 @@ double ComputeTempRegionEff::compute_scalar()
|
||||||
int one = 0;
|
int one = 0;
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
|
if (mask[i] & groupbit && region->match(x[i][0],x[i][1],x[i][2])) {
|
||||||
if (abs(spin[i])==1) one++;
|
if (fabs(spin[i])==1) one++;
|
||||||
}
|
}
|
||||||
int nelectrons_region;
|
int nelectrons_region;
|
||||||
MPI_Allreduce(&one,&nelectrons_region,1,MPI_INT,MPI_SUM,world);
|
MPI_Allreduce(&one,&nelectrons_region,1,MPI_INT,MPI_SUM,world);
|
||||||
|
@ -173,7 +174,7 @@ void ComputeTempRegionEff::compute_vector()
|
||||||
t[4] += massone * v[i][0]*v[i][2];
|
t[4] += massone * v[i][0]*v[i][2];
|
||||||
t[5] += massone * v[i][1]*v[i][2];
|
t[5] += massone * v[i][1]*v[i][2];
|
||||||
|
|
||||||
if (abs(spin[i])==1) {
|
if (fabs(spin[i])==1) {
|
||||||
t[0] += 0.75 * massone * ervel[i]*ervel[i];
|
t[0] += 0.75 * massone * ervel[i]*ervel[i];
|
||||||
t[1] += 0.75 * massone * ervel[i]*ervel[i];
|
t[1] += 0.75 * massone * ervel[i]*ervel[i];
|
||||||
t[2] += 0.75 * massone * ervel[i]*ervel[i];
|
t[2] += 0.75 * massone * ervel[i]*ervel[i];
|
||||||
|
|
|
@ -60,7 +60,7 @@ void FixNHEff::nve_v()
|
||||||
|
|
||||||
for (int i = 0; i < nlocal; i++) {
|
for (int i = 0; i < nlocal; i++) {
|
||||||
if (mask[i] & groupbit) {
|
if (mask[i] & groupbit) {
|
||||||
if (abs(spin[i])==1) {
|
if (fabs(spin[i])==1) {
|
||||||
dtfm = dtf / mass[type[i]];
|
dtfm = dtf / mass[type[i]];
|
||||||
ervel[i] = dtfm * erforce[i] / 0.75;
|
ervel[i] = dtfm * erforce[i] / 0.75;
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ void FixNHEff::nve_x()
|
||||||
|
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
if (mask[i] & groupbit)
|
if (mask[i] & groupbit)
|
||||||
if (abs(spin[i])==1) eradius[i] += dtv * ervel[i];
|
if (fabs(spin[i])==1) eradius[i] += dtv * ervel[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
@ -108,5 +108,5 @@ void FixNHEff::nh_v_temp()
|
||||||
|
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
if (mask[i] & groupbit)
|
if (mask[i] & groupbit)
|
||||||
if (abs(spin[i])==1) ervel[i] *= factor_eta;
|
if (fabs(spin[i])==1) ervel[i] *= factor_eta;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
Contributing author: Andres Jaramillo-Botero (Caltech)
|
Contributing author: Andres Jaramillo-Botero (Caltech)
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
#include "math.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include "fix_nve_eff.h"
|
#include "fix_nve_eff.h"
|
||||||
|
@ -98,7 +99,7 @@ void FixNVEEff::initial_integrate(int vflag)
|
||||||
x[i][0] += dtv * v[i][0];
|
x[i][0] += dtv * v[i][0];
|
||||||
x[i][1] += dtv * v[i][1];
|
x[i][1] += dtv * v[i][1];
|
||||||
x[i][2] += dtv * v[i][2];
|
x[i][2] += dtv * v[i][2];
|
||||||
if (abs(spin[i])==1) {
|
if (fabs(spin[i])==1) {
|
||||||
ervel[i] += dtfm * erforce[i] / 0.75;
|
ervel[i] += dtfm * erforce[i] / 0.75;
|
||||||
eradius[i] += dtv * ervel[i];
|
eradius[i] += dtv * ervel[i];
|
||||||
}
|
}
|
||||||
|
@ -133,7 +134,7 @@ void FixNVEEff::final_integrate()
|
||||||
v[i][0] += dtfm * f[i][0];
|
v[i][0] += dtfm * f[i][0];
|
||||||
v[i][1] += dtfm * f[i][1];
|
v[i][1] += dtfm * f[i][1];
|
||||||
v[i][2] += dtfm * f[i][2];
|
v[i][2] += dtfm * f[i][2];
|
||||||
if (abs(spin[i])==1)
|
if (fabs(spin[i])==1)
|
||||||
ervel[i] += dtfm * erforce[i] / 0.75;
|
ervel[i] += dtfm * erforce[i] / 0.75;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ void FixNVTSllodEff::nh_v_temp()
|
||||||
v[i][1] = v[i][1]*factor_eta - dthalf*vdelu[1];
|
v[i][1] = v[i][1]*factor_eta - dthalf*vdelu[1];
|
||||||
v[i][2] = v[i][2]*factor_eta - dthalf*vdelu[2];
|
v[i][2] = v[i][2]*factor_eta - dthalf*vdelu[2];
|
||||||
temperature->restore_bias(i,v[i]);
|
temperature->restore_bias(i,v[i]);
|
||||||
if (abs(spin[i])==1)
|
if (fabs(spin[i])==1)
|
||||||
ervel[i] = ervel[i]*factor_eta -
|
ervel[i] = ervel[i]*factor_eta -
|
||||||
dthalf*sqrt(pow(vdelu[0],2)+pow(vdelu[1],2)+pow(vdelu[2],2));
|
dthalf*sqrt(pow(vdelu[0],2)+pow(vdelu[1],2)+pow(vdelu[2],2));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue