コード例 #1
0
grav=0              # value of gravity if it exists
saveEvery=50;
nIts = 1;   # number of iterations
rl = 0.05;

N = 16;
Eb = 0.07;
dt = 1e-4;#[2.5e-3,1e-3,5e-4,2.5e-4]; # Max stable = 5e-3
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
コード例 #2
0
nlist.updateList(pos=positions,
             Lx=lx, Ly=ly, Lz=lz,
             numberParticles=numberParticles,
             rcut=rcut,useGPU=False,maxNeighbors=25,nThr=nThr)
print('GPU Update list time %f' %(time.time()-thist))
thist = time.time()
neighbors=nlist.list;
AllNeighbors = np.reshape(neighbors,(len(neighbors)//2,2));
print('GPU sort time %f' %(time.time()-thist))
print(AllNeighbors.shape)
Neighbs1=np.savetxt('N1.txt',AllNeighbors)
"""

# Check with ckd tree
Dom = PeriodicShearedDomain(lx, ly, lz)
SpatialChk = ckDSpatial(positions, Dom)
thist = time.time()
SpatialChk.updateSpatialStructures(positions, Dom)
AllNeighbors2 = SpatialChk.selfNeighborList(rcut * 1.1)
print('CPU Update list time %f' % (time.time() - thist))
print(AllNeighbors2.shape)
Neighbs2 = np.savetxt('N2.txt', AllNeighbors2)

# Check with linked list class
Dom = PeriodicShearedDomain(lx, ly, lz)
SpatialChk = CellLinkedList(positions, Dom, nThr=nThr)
thist = time.time()
SpatialChk.updateSpatialStructures(positions, Dom)
AllNeighbors2 = SpatialChk.selfNeighborList(rcut)
print('Class LL Update list time %f' % (time.time() - thist))
コード例 #3
0
"""

# The hexagonal array calculation
# Initialization
g = 0.5
# strain for parallelepiped
Lx = 2.0
Ly = 2.0
Lz = 2.0
a = 1e-2
mu = 3.0
xi = 5.0
Npts = 4
pts = np.array([[0, 0, 0], [1, 0, 0], [0.5, 1, 0], [1.5, 1, 0]])
forces = np.array([[1.0, 1, 1], [-1, -1, -1], [2, 2, 2], [-2.0, -2, -2]])
ShearDom = PeriodicShearedDomain(Lx, Ly, Lz)
ShearDom.setg(g)
Ewald = EwaldSplitter(a, mu, xi, ShearDom, Npts)
SpatialkD = ckDSpatial(pts, ShearDom)

# Velocity of the blobs - parallelogram domain
uParallelogram = Ewald.calcBlobTotalVel(pts, forces, ShearDom, SpatialkD)
par = uammd.PSEParameters(psi=Ewald._xi,
                          viscosity=mu,
                          hydrodynamicRadius=a,
                          tolerance=1e-6,
                          Lx=Lx,
                          Ly=Ly,
                          Lz=Lz)
pse = uammd.UAMMD(par, Npts)
#pse.Mdot assumes interleaved positions and forces, that is x1,y1,z1,x2,y2,z2,...