Dom = PeriodicShearedDomain(Ld, Ld, Ld) # Initialize fiber discretization fibDisc = ChebyshevDiscretization( Lf, eps, Eb, mu, N, deltaLocal=deltaLocal, trueRPYMobility=RPYMob, NupsampleForDirect=128) # Initialize Ewald for non-local velocities Ewald = GPUEwaldSplitter( np.exp(1.5) / 4 * eps * Lf, mu, xi, Dom, fibDisc._nptsDirect * nFib) # Initialize the master list of fibers allFibers = fiberCollection(nFib, 10, fibDisc, nonLocal, mu, omega, gam0, Dom, nThreads=4) # Initialize the fiber list fibList = [None] * nFib
for nonLocal in [0,3,4]: # Initialize the domain and spatial database Dom = PeriodicShearedDomain(Ld,Ld,Ld); # Initialize fiber discretization NupsampleForDirect=128; fibDisc = ChebyshevDiscretization(Lf,eps,Eb,mu,N,deltaLocal=0.1,nptsUniform=40,NupsampleForDirect=NupsampleForDirect); fibList = makeFibBundle(nFib,N,fibDisc); # Initialize the master list of fibers allFibers = fiberCollection(nFib,10,fibDisc,nonLocal,mu,omega,gam0,Dom); #allFibers.initFibList(fibList,Dom,pointsfileName='StiffLocs'+str(seed+1)+'.txt',tanvecfileName='StiffTanVecs'+str(seed+1)+'.txt'); allFibers.initFibList(fibList,Dom); allFibers.fillPointArrays(); Ewald = GPUEwaldSplitter(allFibers.getaRPY()*eps*Lf,mu,xi*1.4*(fibDisc.getNumDirect()/N)**(1/3),Dom,NupsampleForDirect*nFib); # Initialize the temporal integrator TIntegrator = CrankNicolson(allFibers); if (nonLocal==3): nIts = 2; TIntegrator.setMaxIters(nIts); TIntegrator.setLargeTol(0.1); # Prepare the output file and write initial locations of = prepareOutFile('BundleTest/XLooseBundle'+str(nonLocal)+'.txt'); allFibers.writeFiberLocations(of); stopcount = int(tf/dt+1e-10); Lamstress = np.zeros(stopcount); Elstress = np.zeros(stopcount); nLinks =np.zeros(stopcount)
Eb, mu, N, deltaLocal=0.1, trueRPYMobility=True, NupsampleForDirect=128) # Initialize the master list of fibers allFibers = fiberCollection(nFib, 10, fibDisc, nonLocal, mu, omega, gam0, Dom) fibList = makeThreeSheared(Lf, N, fibDisc) allFibers.initFibList(fibList, Dom) allFibers.fillPointArrays() # Initialize Ewald for non-local velocities Ewald = GPUEwaldSplitter(allFibers.getaRPY() * eps * Lf, mu, xi, Dom, fibDisc._nptsDirect * nFib) # Initialize the temporal integrator TIntegrator = BackwardEuler(allFibers, FPimp=0) # Number of GMRES iterations for nonlocal solves # 1 = block diagonal solver # N > 1 = N-1 extra iterations of GMRES TIntegrator.setMaxIters(giters) TIntegrator.setLargeTol(1e-6) # Prepare the output file and write initial locations of = prepareOutFile('ThreeSheared/BE_Eps2RPYExLocsN' + str(N) + 'G' + str(giters) + str(dt) + '.txt') allFibers.writeFiberLocations(of) # Time loop