USER-DPD: Initialize the dpdThetaLocal array consistently in fix_rx

This commit is contained in:
Tim Mattox 2016-10-12 15:56:45 -04:00
parent 4958e114ba
commit fcb5271026
1 changed files with 6 additions and 18 deletions

View File

@ -642,15 +642,9 @@ void FixRX::setup_pre_force(int vflag)
int ii;
if(localTempFlag){
if (newton_pair) {
dpdThetaLocal = new double[nlocal+nghost];
for (ii = 0; ii < nlocal+nghost; ii++)
dpdThetaLocal[ii] = 0.0;
} else {
dpdThetaLocal = new double[nlocal];
for (ii = 0; ii < nlocal; ii++)
dpdThetaLocal[ii] = 0.0;
}
int count = nlocal + (newton_pair ? nghost : 0);
dpdThetaLocal = new double[count];
memset(dpdThetaLocal, 0, sizeof(double)*count);
computeLocalTemperature();
}
@ -690,15 +684,9 @@ void FixRX::pre_force(int vflag)
double theta;
if(localTempFlag){
if (newton_pair) {
dpdThetaLocal = new double[nlocal+nghost];
for (ii = 0; ii < nlocal+nghost; ii++)
dpdThetaLocal[ii] = 0.0;
} else {
dpdThetaLocal = new double[nlocal];
for (ii = 0; ii < nlocal; ii++)
dpdThetaLocal[ii] = 0.0;
}
int count = nlocal + (newton_pair ? nghost : 0);
dpdThetaLocal = new double[count];
memset(dpdThetaLocal, 0, sizeof(double)*count);
computeLocalTemperature();
}