try at membrane simulator
This commit is contained in:
@@ -95,6 +95,14 @@ int main(int argc, char **argv)
|
||||
int *neighborList;
|
||||
IntArray Map(Nx,Ny,Nz);
|
||||
neighborList= new int[18*Npad];
|
||||
|
||||
//......................device distributions.................................
|
||||
int *NeighborList;
|
||||
int *dvcMap;
|
||||
//...........................................................................
|
||||
ScaLBL_AllocateDeviceMemory((void **) &NeighborList, neighborSize);
|
||||
ScaLBL_AllocateDeviceMemory((void **) &dvcMap, sizeof(int)*Npad);
|
||||
ScaLBL_CopyToDevice(NeighborList, neighborList, 18*Np*sizeof(int));
|
||||
|
||||
Np = ScaLBL_Comm->MemoryOptimizedLayoutAA(Map,neighborList,Dm->id.data(),Np,1);
|
||||
comm.barrier();
|
||||
@@ -120,7 +128,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
/* create a membrane data structure */
|
||||
Membrane M(Dm, neighborList, Np);
|
||||
Membrane M(Dm, NeighborList, Np);
|
||||
|
||||
int MembraneCount = M.Create(Dm, Distance, Map);
|
||||
if (rank==0) printf (" Number of membrane links: %i \n", MembraneCount);
|
||||
@@ -159,13 +167,6 @@ int main(int argc, char **argv)
|
||||
if (argc > 1)
|
||||
Dm->AggregateLabels("membrane.raw");
|
||||
|
||||
//......................device distributions.................................
|
||||
int *NeighborList;
|
||||
int *dvcMap;
|
||||
//...........................................................................
|
||||
ScaLBL_AllocateDeviceMemory((void **) &NeighborList, neighborSize);
|
||||
ScaLBL_AllocateDeviceMemory((void **) &dvcMap, sizeof(int)*Npad);
|
||||
|
||||
//...........................................................................
|
||||
// Update GPU data structures
|
||||
if (rank==0) printf ("Setting up device map and neighbor list \n");
|
||||
|
||||
@@ -69,6 +69,7 @@ int main(int argc, char **argv)
|
||||
IonModel.SetDomain();
|
||||
IonModel.ReadInput();
|
||||
IonModel.Create();
|
||||
IonModel.SetMembrane();
|
||||
|
||||
// Create analysis object
|
||||
ElectroChemistryAnalyzer Analysis(IonModel.Dm);
|
||||
@@ -95,7 +96,7 @@ int main(int argc, char **argv)
|
||||
timestep++;
|
||||
PoissonSolver.Run(IonModel.ChargeDensity,timestep);//solve Poisson equtaion to get steady-state electrical potental
|
||||
StokesModel.Run_Lite(IonModel.ChargeDensity, PoissonSolver.ElectricField);// Solve the N-S equations to get velocity
|
||||
IonModel.Run(StokesModel.Velocity,PoissonSolver.ElectricField); //solve for ion transport and electric potential
|
||||
IonModel.RunMembrane(StokesModel.Velocity,PoissonSolver.ElectricField,PoissonSolver.Psi); //solve for ion transport with membrane
|
||||
|
||||
timestep++;//AA operations
|
||||
|
||||
|
||||
Reference in New Issue
Block a user