USER-DPD: whitespace and indentation fixes
This commit is contained in:
@ -35,9 +35,9 @@ FixDPDenergy::FixDPDenergy(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
pairDPDE = NULL;
|
pairDPDE = NULL;
|
||||||
pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1);
|
pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1);
|
||||||
|
|
||||||
if(pairDPDE == NULL)
|
if (pairDPDE == NULL)
|
||||||
error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy");
|
error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy");
|
||||||
if(!(atom->dpd_flag))
|
if (!(atom->dpd_flag))
|
||||||
error->all(FLERR,"Must use atom_style dpd/fdt/energy with fix dpd/energy");
|
error->all(FLERR,"Must use atom_style dpd/fdt/energy with fix dpd/energy");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -93,7 +93,7 @@ void PairDPDfdt::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// loop over neighbors of my atoms
|
// loop over neighbors of my atoms
|
||||||
|
|
||||||
if(splitFDT_flag){
|
if (splitFDT_flag) {
|
||||||
for (ii = 0; ii < inum; ii++) {
|
for (ii = 0; ii < inum; ii++) {
|
||||||
i = ilist[ii];
|
i = ilist[ii];
|
||||||
xtmp = x[i][0];
|
xtmp = x[i][0];
|
||||||
@ -182,7 +182,8 @@ void PairDPDfdt::compute(int eflag, int vflag)
|
|||||||
wr = 1.0 - r/cut[itype][jtype];
|
wr = 1.0 - r/cut[itype][jtype];
|
||||||
wd = wr*wr;
|
wd = wr*wr;
|
||||||
randnum = random->gaussian();
|
randnum = random->gaussian();
|
||||||
gamma_ij = sigma[itype][jtype]*sigma[itype][jtype]/(2.0*force->boltz*temperature);
|
gamma_ij = sigma[itype][jtype]*sigma[itype][jtype]
|
||||||
|
/ (2.0*force->boltz*temperature);
|
||||||
|
|
||||||
// conservative force = a0 * wd
|
// conservative force = a0 * wd
|
||||||
// drag force = -gamma * wd^2 * (delx dot delv) / r
|
// drag force = -gamma * wd^2 * (delx dot delv) / r
|
||||||
|
|||||||
@ -59,7 +59,7 @@ PairDPDfdtEnergy::~PairDPDfdtEnergy()
|
|||||||
memory->destroy(a0);
|
memory->destroy(a0);
|
||||||
memory->destroy(sigma);
|
memory->destroy(sigma);
|
||||||
memory->destroy(kappa);
|
memory->destroy(kappa);
|
||||||
if(!splitFDT_flag){
|
if (!splitFDT_flag) {
|
||||||
memory->destroy(duCond);
|
memory->destroy(duCond);
|
||||||
memory->destroy(duMech);
|
memory->destroy(duMech);
|
||||||
}
|
}
|
||||||
@ -108,7 +108,7 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
|
|||||||
|
|
||||||
// loop over neighbors of my atoms
|
// loop over neighbors of my atoms
|
||||||
|
|
||||||
if(splitFDT_flag){
|
if (splitFDT_flag) {
|
||||||
for (ii = 0; ii < inum; ii++) {
|
for (ii = 0; ii < inum; ii++) {
|
||||||
i = ilist[ii];
|
i = ilist[ii];
|
||||||
xtmp = x[i][0];
|
xtmp = x[i][0];
|
||||||
@ -172,8 +172,8 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
|
|||||||
memory->create(duCond,nlocal+nghost,"pair:duCond");
|
memory->create(duCond,nlocal+nghost,"pair:duCond");
|
||||||
memory->create(duMech,nlocal+nghost,"pair:duMech");
|
memory->create(duMech,nlocal+nghost,"pair:duMech");
|
||||||
for (int ii = 0; ii < nlocal+nghost; ii++) {
|
for (int ii = 0; ii < nlocal+nghost; ii++) {
|
||||||
duCond[ii] = double(0.0);
|
duCond[ii] = 0.0;
|
||||||
duMech[ii] = double(0.0);
|
duMech[ii] = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// loop over neighbors of my atoms
|
// loop over neighbors of my atoms
|
||||||
@ -214,10 +214,11 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
|
|||||||
randnum = random->gaussian();
|
randnum = random->gaussian();
|
||||||
|
|
||||||
// Compute the current temperature
|
// Compute the current temperature
|
||||||
theta_ij = double(0.5)*(double(1.0)/dpdTheta[i] + double(1.0)/dpdTheta[j]);
|
theta_ij = 0.5*(1.0/dpdTheta[i] + 1.0/dpdTheta[j]);
|
||||||
theta_ij = double(1.0)/theta_ij;
|
theta_ij = 1.0/theta_ij;
|
||||||
|
|
||||||
gamma_ij = sigma[itype][jtype]*sigma[itype][jtype]/(2.0*force->boltz*theta_ij);
|
gamma_ij = sigma[itype][jtype]*sigma[itype][jtype]
|
||||||
|
/ (2.0*force->boltz*theta_ij);
|
||||||
|
|
||||||
// conservative force = a0 * wr
|
// conservative force = a0 * wr
|
||||||
// drag force = -gamma * wr^2 * (delx dot delv) / r
|
// drag force = -gamma * wr^2 * (delx dot delv) / r
|
||||||
@ -244,16 +245,17 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
|
|||||||
mass_i = mass[itype];
|
mass_i = mass[itype];
|
||||||
mass_j = mass[jtype];
|
mass_j = mass[jtype];
|
||||||
}
|
}
|
||||||
massinv_i = double(1.0) / mass_i;
|
massinv_i = 1.0 / mass_i;
|
||||||
massinv_j = double(1.0) / mass_j;
|
massinv_j = 1.0 / mass_j;
|
||||||
|
|
||||||
// Compute the mechanical and conductive energy, uMech and uCond
|
// Compute the mechanical and conductive energy, uMech and uCond
|
||||||
mu_ij = massinv_i + massinv_j;
|
mu_ij = massinv_i + massinv_j;
|
||||||
mu_ij *= force->ftm2v;
|
mu_ij *= force->ftm2v;
|
||||||
|
|
||||||
uTmp = gamma_ij*wd*rinv*rinv*dot*dot - double(0.5)*sigma[itype][jtype]*sigma[itype][jtype]*mu_ij*wd;
|
uTmp = gamma_ij*wd*rinv*rinv*dot*dot
|
||||||
|
- 0.5*sigma[itype][jtype]*sigma[itype][jtype]*mu_ij*wd;
|
||||||
uTmp -= sigma[itype][jtype]*wr*rinv*dot*randnum*dtinvsqrt;
|
uTmp -= sigma[itype][jtype]*wr*rinv*dot*randnum*dtinvsqrt;
|
||||||
uTmp *= double(0.5);
|
uTmp *= 0.5;
|
||||||
|
|
||||||
duMech[i] += uTmp;
|
duMech[i] += uTmp;
|
||||||
if (newton_pair || j < nlocal) {
|
if (newton_pair || j < nlocal) {
|
||||||
@ -266,7 +268,7 @@ void PairDPDfdtEnergy::compute(int eflag, int vflag)
|
|||||||
alpha_ij = sqrt(2.0*force->boltz*kappa_ij);
|
alpha_ij = sqrt(2.0*force->boltz*kappa_ij);
|
||||||
randPair = alpha_ij*wr*randnum*dtinvsqrt;
|
randPair = alpha_ij*wr*randnum*dtinvsqrt;
|
||||||
|
|
||||||
uTmp = kappa_ij*(double(1.0)/dpdTheta[i] - double(1.0)/dpdTheta[j])*wd;
|
uTmp = kappa_ij*(1.0/dpdTheta[i] - 1.0/dpdTheta[j])*wd;
|
||||||
uTmp += randPair;
|
uTmp += randPair;
|
||||||
|
|
||||||
duCond[i] += uTmp;
|
duCond[i] += uTmp;
|
||||||
@ -316,7 +318,7 @@ void PairDPDfdtEnergy::allocate()
|
|||||||
memory->create(a0,n+1,n+1,"pair:a0");
|
memory->create(a0,n+1,n+1,"pair:a0");
|
||||||
memory->create(sigma,n+1,n+1,"pair:sigma");
|
memory->create(sigma,n+1,n+1,"pair:sigma");
|
||||||
memory->create(kappa,n+1,n+1,"pair:kappa");
|
memory->create(kappa,n+1,n+1,"pair:kappa");
|
||||||
if(!splitFDT_flag){
|
if (!splitFDT_flag) {
|
||||||
memory->create(duCond,nlocal+nghost+1,"pair:duCond");
|
memory->create(duCond,nlocal+nghost+1,"pair:duCond");
|
||||||
memory->create(duMech,nlocal+nghost+1,"pair:duMech");
|
memory->create(duMech,nlocal+nghost+1,"pair:duMech");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user