mydomain = ReadGmsh('footing.msh',numDim=dim,integrationOrder=2) # read Gmsh mesh with 6-node triangle element (2500 tri6); each element has 3 Gauss points k = kronecker(mydomain) numg = 3*2500; # number of Gauss points nump = 16; # number of processes in multiprocessing packNo=list(range(0,numg,50)) prob = MultiScale(domain=mydomain,ng=numg,np=nump,random=False,rtol=1e-2,usePert=False,pert=-2.e-5,verbose=False) disp = Vector(0.,Solution(mydomain)) t=0 stress = prob.getCurrentStress() proj = Projector(mydomain) sig = proj(stress) sig_bounda = interpolate(sig,FunctionOnBoundary(mydomain)) traction = matrix_mult(sig_bounda,mydomain.getNormal()) x = mydomain.getX() bx = FunctionOnBoundary(mydomain).getX() footingBase = whereZero(bx[1]-sup(bx[1]))*whereNonPositive(bx[0]-B) tractFoot = traction*footingBase forceFoot = integrate(tractFoot,where=FunctionOnBoundary(mydomain)) lengthFoot = integrate(footingBase,where=FunctionOnBoundary(mydomain)) fout=file('./result/bearing.dat','w') fout.write('0 '+str(forceFoot[0])+' '+str(forceFoot[1])+' '+str(lengthFoot)+'\n') # Dirichlet BC, rollers at left and right, fixties at bottom, rigid and rough footing Dbc = whereZero(x[0])*[1,0]+whereZero(x[0]-sup(x[0]))*[1,0]+whereZero(x[1]-inf(x[1]))*[1,1]+whereZero(x[1]-sup(x[1]))*whereNonPositive(x[0]-B)*[1,1] Vbc = whereZero(x[0])*[0,0]+whereZero(x[0]-sup(x[0]))*[0,0]+whereZero(x[1]-inf(x[1]))*[0,0]+whereZero(x[1]-sup(x[1]))*whereNonPositive(x[0]-B)*[0,vel] # Neumann BC, surcharge at the rest area of the top surface Nbc = whereZero(bx[1]-sup(bx[1]))*wherePositive(bx[0]-B)*[0,surcharge]
# check quasi-static state while Ek > rtol or Ek <0: u, u_t = prob.solve(damp=0.99,dynRelax=True) Ek = integrate(length(u_t)**2*rho)/2. print t, Ek # get stress at (n) timesteps stress = prob.getCurrentStress() dom = prob.getDomain() proj = Projector(dom) # project Gauss point value to nodal value sig = proj(stress) # interpolate to stress at the boundary sig_bounda = interpolate(sig,FunctionOnBoundary(dom)) # compute boundary traction by s_ij*n_j traction = matrix_mult(sig_bounda,dom.getNormal()) # get mask for boundary nodes on the bottom botSurf = whereZero(bx[1]) # traction at the bottom tractBot = traction*botSurf # resultant force at the bottom forceBot = integrate(tractBot,where=FunctionOnBoundary(dom)) # length of the bottom surface lengthBot = integrate(botSurf,where=FunctionOnBoundary(dom)) # write stress at the bottom surface fout.write(str(t*dt)+' '+str(forceBot[0])+' '+str(forceBot[1])+' '+str(lengthBot)+'\n') # get local void ratio vR = prob.getLocalVoidRatio(); vR = proj(vR) # get local fabric intensity fab = prob.getLocalFabric()