fix bug in ion model restart

This commit is contained in:
James McClure 2022-08-02 15:36:35 -04:00
parent 777e216b35
commit 58ae63fe87
2 changed files with 3 additions and 3 deletions

View File

@ -1142,7 +1142,7 @@ void ScaLBL_IonModel::Initialize() {
sum = 0.0;
for (int q = 0; q < 7; q++) {
File.read((char *)&value, sizeof(value));
cDist[ic * q * Np + n] = value;
cDist[ic * 7 * Np + q * Np + n] = value;
sum += value;
}
Ci_host[ic * Np + n] = sum;
@ -1656,7 +1656,7 @@ void ScaLBL_IonModel::Checkpoint(){
for (int n = 0; n < Np; n++) {
// Write the distributions
for (int q = 0; q < 7; q++) {
value = cDist[ic * q * Np + n];
value = cDist[ic * Np * 7 + q * Np + n];
File.write((char *)&value, sizeof(value));
}
}

View File

@ -584,7 +584,7 @@ void ScaLBL_Poisson::Potential_Init(double *psi_init){
// Read the distributions
for (int n = 0; n < Nx*Ny*Nz; n++) {
File.read((char *)&value, sizeof(value));
psi_init[ n] = value;
psi_init[n] = value;
}
File.close();
}