# Initialize fiber discretization fibDisc = ChebyshevDiscretization(Lf, eps, Eb, mu, N, deltaLocal=0.1, nptsUniform=Nuniformsites, NupsampleForDirect=NupsampleForDirect) # Initialize the master list of fibers allFibers = fiberCollection(nFib, turnovertime, fibDisc, nonLocal, mu, omega, gam0, Dom, nThreads=nThr) # Initialize Ewald for non-local velocities if (nonLocal > 0 and nonLocal < 4): Ewald = GPUEwaldSplitter( allFibers.getaRPY() * eps * Lf, mu, xi * 1.4 * (fibDisc.getNumDirect() / N)**(1 / 3), Dom, NupsampleForDirect * nFib) else: # This is so it doesn't try to initialize a GPU code if there isn't a GPU Ewald = EwaldSplitter(allFibers.getaRPY() * eps * Lf, mu, xi * 1.4 * (fibDisc.getNumDirect() / N)**(1 / 3), Dom, NupsampleForDirect * nFib)
omHz = 0; tf = 1#5/omHz; omega = 2*pi*omHz; gam0 = 0.1; 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');
np.random.seed(1) # Initialize the domain and spatial database Dom = PeriodicShearedDomain(Ld, Ld, Ld) # Initialize Ewald for non-local velocities Ewald = EwaldSplitter(np.exp(1.5) / 4 * eps * Lf, mu, xi, Dom, N * nFib) # Initialize fiber discretization fibDisc = ChebyshevDiscretization(Lf, eps, Eb, mu, N, deltaLocal=0.1) # Initialize the master list of fibers allFibers = fiberCollection(nFib, fibDisc, nonLocal, mu, omega, gam0, Dom, nThreads=4) # Initialize the fiber list (straight fibers) fibList = [None] * nFib #print('Loading from steady state') #XFile = 'SSLocsF'+str(nFib)+'C'+str(nCL)+'REV.txt'; #XsFile = 'SSTanVecsF'+str(nFib)+'C'+str(nCL)+'REV.txt'; allFibers.initFibList(fibList, Dom) #,pointsfileName=XFile,tanvecfileName=XsFile); allFibers.fillPointArrays() # Initialize the network of cross linkers (set links from file) # New seed for CLs