fix typo and build pass

This commit is contained in:
Rex Zhe Li 2021-02-25 21:25:29 -05:00
parent 99f1d9b727
commit 1a393ab266
4 changed files with 13 additions and 13 deletions

View File

@ -207,7 +207,7 @@ extern "C" void ScaLBL_D3Q19_AAodd_FreeLeeModel_SingleFluid_BGK(int *neighborLis
extern "C" void ScaLBL_D3Q19_AAeven_FreeLeeModel_SingleFluid_BGK(double *dist, double *Vel, double *Pressure,
double tau, double rho0, double Fx, double Fy, double Fz, int start, int finish, int Np);
extern "C" void ScaLBL_D3Q9_MGTest(int *Map, double *Phi,double *ColorGrad, int start, int finish, Np);
extern "C" void ScaLBL_D3Q9_MGTest(int *Map, double *Phi,double *ColorGrad,int strideY, int strideZ, int start, int finish, int Np);
// BOUNDARY CONDITION ROUTINES

View File

@ -1917,7 +1917,7 @@ extern "C" void ScaLBL_D3Q19_AAeven_FreeLeeModel_SingleFluid_BGK(double *dist, d
}
}
extern "C" void ScaLBL_D3Q9_MGTest(int *Map, double *Phi,double *ColorGrad, int start, int finish, Np){
extern "C" void ScaLBL_D3Q9_MGTest(int *Map, double *Phi,double *ColorGrad,int strideY, int strideZ, int start, int finish, int Np){
int n,nn,nn2x,ijk;
double m1,m2,m4,m6,m8,m9,m10,m11,m12,m13,m14,m15,m16,m17,m18;

View File

@ -1069,7 +1069,7 @@ void ScaLBL_FreeLeeModel::Create_DummyPhase_MGTest(){
if (rank==0) printf ("Create ScaLBL_Communicator \n");
// Create a communicator for the device (will use optimized layout)
// ScaLBL_Communicator ScaLBL_Comm(Mask); // original
//ScaLBL_Comm = std::shared_ptr<ScaLBL_Communicator>(new ScaLBL_Communicator(Mask));
ScaLBL_Comm = std::shared_ptr<ScaLBL_Communicator>(new ScaLBL_Communicator(Mask));
//ScaLBL_Comm_Regular = std::shared_ptr<ScaLBL_Communicator>(new ScaLBL_Communicator(Mask));
ScaLBL_Comm_WideHalo = std::shared_ptr<ScaLBLWideHalo_Communicator>(new ScaLBLWideHalo_Communicator(Mask,2));
@ -1174,9 +1174,9 @@ void ScaLBL_FreeLeeModel::MGTest(){
comm.barrier();
ScaLBL_Comm_WideHalo->Send(Phi);
ScaLBL_D3Q9_MGTest(dvcMap,Phi,ColorGrad, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np);
ScaLBL_Comm_WideHalo->Send(Phi);
ScaLBL_D3Q9_MGTest(dvcMap,Phi,ColorGrad, 0, ScaLBL_Comm->LastExterior(), Np);
ScaLBL_D3Q9_MGTest(dvcMap,Phi,ColorGrad,Nx,Nx*Ny, ScaLBL_Comm->FirstInterior(), ScaLBL_Comm->LastInterior(), Np);
ScaLBL_Comm_WideHalo->Recv(Phi);
ScaLBL_D3Q9_MGTest(dvcMap,Phi,ColorGrad,Nx,Nx*Ny, 0, ScaLBL_Comm->LastExterior(), Np);
//check the sum of ColorGrad
double cgx_loc = 0.0;
@ -1186,12 +1186,12 @@ void ScaLBL_FreeLeeModel::MGTest(){
double *ColorGrad_host;
ColorGrad_host = new double [3*Np];
ScaLBL_CopyToHost(&ColorGrad_host[0],&ColorGrad[0], 3*Np*sizeof(double));
for (int i = ScaLBL_Comm->FirstInterior(), i<ScaLBL_Comm->LastInterior(),i++){
for (int i = ScaLBL_Comm->FirstInterior(); i<ScaLBL_Comm->LastInterior();i++){
cgx_loc+=ColorGrad_host[0*Np+i];
cgy_loc+=ColorGrad_host[1*Np+i];
cgz_loc+=ColorGrad_host[2*Np+i];
}
for (int i = 0, i<ScaLBL_Comm->LastExterior(),i++){
for (int i = 0; i<ScaLBL_Comm->LastExterior();i++){
cgx_loc+=ColorGrad_host[0*Np+i];
cgy_loc+=ColorGrad_host[1*Np+i];
cgz_loc+=ColorGrad_host[2*Np+i];
@ -1200,9 +1200,9 @@ void ScaLBL_FreeLeeModel::MGTest(){
cgy=Dm->Comm.sumReduce( cgy_loc);
cgz=Dm->Comm.sumReduce( cgz_loc);
if (rank==0){
printf("Sum of all x-component of the mixed gradient = %.2g",cgx);
printf("Sum of all y-component of the mixed gradient = %.2g",cgy);
printf("Sum of all z-component of the mixed gradient = %.2g",cgz);
printf("Sum of all x-component of the mixed gradient = %.2g \n",cgx);
printf("Sum of all y-component of the mixed gradient = %.2g \n",cgy);
printf("Sum of all z-component of the mixed gradient = %.2g \n",cgz);
}
delete [] ColorGrad_host;

View File

@ -22,7 +22,7 @@ inline void Initialize_DummyPhaseField(ScaLBL_FreeLeeModel &LeeModel){
for (i=0;i<Nx;i++){
n = k*Nx*Ny + j*Nz + i;
LeeModel.Mask->id[n]=1;
LeeMOdel.id[n] = LeeModel.Mask->id[n];
LeeModel.id[n] = LeeModel.Mask->id[n];
}
}
}
@ -68,7 +68,7 @@ int main( int argc, char **argv )
LeeModel.SetDomain();
Initialize_DummyPhaseField(LeeModel);
LeeModel.Create_DummyPhase_MGTest();
LeeModel.MGTest()
LeeModel.MGTest();
PROFILE_STOP( "Main" );
auto file = db->getWithDefault<std::string>( "TimerFile", "TestMixedGrad" );