Replacing Array class with another Array class

This commit is contained in:
Mark Berrill committed 2015-04-22 14:23:55 -04:00
1 parent d33c1abd71
commit ef25839769
28 files changed
+1099 -1050

No files matched your search

+19 -19
View File
@@ -1193,21 +1193,21 @@ int main(int argc, char **argv)
//...........................................................................
InitD3Q19(ID, f_even, f_odd, Nx, Ny, Nz);
//......................................................................
// InitDenColorDistance(ID, Copy, Phi, SDs.data, das, dbs, beta, xIntPos, Nx, Ny, Nz, S);
InitDenColorDistance(ID, Den, Phi, SDs.data, das, dbs, beta, xIntPos, Nx, Ny, Nz);
// InitDenColorDistance(ID, Copy, Phi, SDs.get(), das, dbs, beta, xIntPos, Nx, Ny, Nz, S);
InitDenColorDistance(ID, Den, Phi, SDs.get(), das, dbs, beta, xIntPos, Nx, Ny, Nz);
InitD3Q7(ID, A_even, A_odd, &Den[0], Nx, Ny, Nz);
InitD3Q7(ID, B_even, B_odd, &Den[N], Nx, Ny, Nz);
//......................................................................
// Once phase has been initialized, map solid to account for 'smeared' interface
//......................................................................
for (i=0; i<N; i++) SDs.data[i] -= (1.0); //
for (i=0; i<N; i++) SDs(i) -= (1.0); //
//......................................................................
//.......................................................................
sprintf(LocalRankString,"%05d",rank);
sprintf(LocalRankFilename,"%s%s","ID.",LocalRankString);
WriteLocalSolidID(LocalRankFilename, id, N);
sprintf(LocalRankFilename,"%s%s","SDs.",LocalRankString);
WriteLocalSolidDistance(LocalRankFilename, SDs.data, N);
WriteLocalSolidDistance(LocalRankFilename, SDs.get(), N);
//.......................................................................
if (Restart == true){
if (rank==0) printf("Reading restart file! \n");
@@ -1340,7 +1340,7 @@ int main(int argc, char **argv)
//...........................................................................
// Copy the phase indicator field for the earlier timestep
DeviceBarrier();
CopyToHost(Phase_tplus.data,Phi,N*sizeof(double));
CopyToHost(Phase_tplus.get(),Phi,N*sizeof(double));
//...........................................................................
//...........................................................................
// Copy the data for for the analysis timestep
@@ -1349,8 +1349,8 @@ int main(int argc, char **argv)
//...........................................................................
DeviceBarrier();
ComputePressureD3Q19(ID,f_even,f_odd,Pressure,Nx,Ny,Nz);
CopyToHost(Phase.data,Phi,N*sizeof(double));
CopyToHost(Press.data,Pressure,N*sizeof(double));
CopyToHost(Phase.get(),Phi,N*sizeof(double));
CopyToHost(Press.get(),Pressure,N*sizeof(double));
MPI_Barrier(MPI_COMM_WORLD);
//...........................................................................
@@ -1769,15 +1769,15 @@ int main(int argc, char **argv)
// Copy the phase indicator field for the later timestep
DeviceBarrier();
ComputePressureD3Q19(ID,f_even,f_odd,Pressure,Nx,Ny,Nz);
CopyToHost(Phase_tminus.data,Phi,N*sizeof(double));
CopyToHost(Phase_tplus.data,Phi,N*sizeof(double));
CopyToHost(Phase.data,Phi,N*sizeof(double));
CopyToHost(Press.data,Pressure,N*sizeof(double));
CopyToHost(Phase_tminus.get(),Phi,N*sizeof(double));
CopyToHost(Phase_tplus.get(),Phi,N*sizeof(double));
CopyToHost(Phase.get(),Phi,N*sizeof(double));
CopyToHost(Press.get(),Pressure,N*sizeof(double));
double temp=0.5/beta;
for (n=0; n<N; n++){
double value = Phase.data[n];
SDn.data[n] = temp*log((1.0+value)/(1.0-value));
double value = Phase.get()[n];
SDn(n) = temp*log((1.0+value)/(1.0-value));
}
//...........................................................................
@@ -1972,7 +1972,7 @@ int main(int argc, char **argv)
// 1-D index for this cube corner
n = i+cube[p][0] + (j+cube[p][1])*Nx + (k+cube[p][2])*Nx*Ny;
// compute the norm of the gradient of the phase indicator field
delphi = sqrt(Phase_x.data[n]*Phase_x.data[n]+Phase_y.data[n]*Phase_y.data[n]+Phase_z.data[n]*Phase_z.data[n]);
delphi = sqrt(Phase_x(n)*Phase_x(n)+Phase_y(n)*Phase_y(n)+Phase_z(n)*Phase_z(n));
// Compute the non-wetting phase volume contribution
if ( Phase(i+cube[p][0],j+cube[p][1],k+cube[p][2]) > 0 ){
nwp_volume += 0.125;
@@ -1980,14 +1980,14 @@ int main(int argc, char **argv)
if (delphi < 1e-4){
vol_n += 0.125;
// pressure
pan += 0.125*Press.data[n];
pan += 0.125*Press(n);
}
}
else if (delphi < 1e-4){
// volume the excludes the interfacial region
vol_w += 0.125;
// pressure
paw += 0.125*Press.data[n];
paw += 0.125*Press(n);
}
}
}
@@ -2212,12 +2212,12 @@ int main(int argc, char **argv)
//************************************************************************/
sprintf(LocalRankFilename,"%s%s","Phase.",LocalRankString);
// printf("Local File Name = %s \n",LocalRankFilename);
// CopyToHost(Phase.data,Phi,N*sizeof(double));
// CopyToHost(Phase.get(),Phi,N*sizeof(double));
FILE *PHASE;
PHASE = fopen(LocalRankFilename,"wb");
fwrite(Press.data,8,N,PHASE);
// fwrite(MeanCurvature.data,8,N,PHASE);
fwrite(Press.get(),8,N,PHASE);
// fwrite(MeanCurvature.get(),8,N,PHASE);
fclose(PHASE);
/* double *DensityValues;