try at membrane simulator

This commit is contained in:
James McClure
2022-03-18 18:08:44 -04:00
parent c94d4e5194
commit 702eaae1c1
5 changed files with 270 additions and 36 deletions

View File

@@ -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");

View File

@@ -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