r = pss.cppr_mid pss.mesh_Shps[0, :, :], part_area[0] = pss.gen_circle(r) lx, ly = 35., 35. UC = pss.unit_cell(LX=lx, LY=ly) N = 5 UCX = np.array([0., lx, lx, 0., lx / 2.]) UCY = np.array([0., 0., ly, ly, ly / 2.]) MATS = np.array([1., 1., 1., 1., 1.]) RAD = np.array([8., 8., 8., 8., 8.]) for i in range(N): pss.place_shape(pss.mesh_Shps[0, :, :], UCY[i], UCX[i], MATS[i], UC, LX=lx, LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],0,0,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],48,32+16,2,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],32,32-20,3,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],48,32-16,4,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],32,32+20,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],lx,0,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],0,ly,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],lx,ly,1,UC,LX=lx,LY=ly) plt.figure()
part_area = np.zeros((1)) cppr_range = pss.cppr_max - pss.cppr_min r = pss.cppr_mid pss.mesh_Shps[0,:,:],part_area[0] = pss.gen_circle(r) lx, ly = 35., 35. UC = pss.unit_cell(LX=lx,LY=ly) N = 5 UCX = np.array([0.,lx,lx,0.,lx/2.]) UCY = np.array([0.,0.,ly,ly,ly/2.]) MATS = np.array([1.,1.,1.,1.,1.]) RAD = np.array([8.,8.,8.,8.,8.]) for i in range(N): pss.place_shape(pss.mesh_Shps[0,:,:],UCY[i],UCX[i],MATS[i],UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],0,0,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],48,32+16,2,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],32,32-20,3,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],48,32-16,4,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],32,32+20,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],lx,0,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],0,ly,1,UC,LX=lx,LY=ly) #pss.place_shape(pss.mesh_Shps[0,:,:],lx,ly,1,UC,LX=lx,LY=ly) plt.figure()
L_cells = 234 # T - Transverse, L - Longitudinal T_cells = 407 r = 8 T_length = 25.4e-3 L_length = 14.6e-3 GRIDSPC = L_length / L_cells print GRIDSPC pss.generate_mesh(L_cells, T_cells, CPPR=r, mat_no=5, GridSpc=GRIDSPC) mats = pss.mats pss.mesh_Shps[0, :, :] = pss.gen_circle(r) i = np.where(abs(pss.yh - 12.7e-3) < pss.GS / 2.) j = np.where(abs(pss.xh - 4.51e-3) < pss.GS / 2.) I, J, M = i[0], j[0], mats[4] pss.place_shape(pss.mesh_Shps[0, :, :], J, I, M) Cu1_T1 = 0. Cu1_T2 = 25.4e-3 Cu1_L1 = 0. Cu1_L2 = 1.3e-3 pss.fill_rectangle(Cu1_L1, Cu1_T1, Cu1_L2, Cu1_T2, mats[0]) Cu2_T1 = 7.7e-3 Cu2_T2 = 17.7e-3 Cu2_L1 = 1.3e-3 Cu2_L2 = 2.6e-3 pss.fill_rectangle(Cu2_L1, Cu2_T1, Cu2_L2, Cu2_T2, mats[0]) Al1_T1 = 6.55e-3 Al1_T2 = 7.7e-3
y_length = 1.e-4 GRIDSPC = x_length/X_cells mat_no = 5 pss.generate_mesh(X_cells,Y_cells,mat_no,cppr,PR,vol_frac) mats = pss.mats part_area = np.zeros((1)) cppr_range = pss.cppr_max - pss.cppr_min r = pss.cppr_mid pss.mesh_Shps[0,:,:],part_area[0] = pss.gen_circle(r) ANGLE = 60 ANG = ANGLE*np.pi/180. pss.place_shape(pss.mesh_Shps[0,:,:],0,28,0) pss.place_shape(pss.mesh_Shps[0,:,:],16,28,1) dX = 2*cppr*np.sin(ANG) dY = 2*cppr*np.cos(ANG) pss.place_shape(pss.mesh_Shps[0,:,:],16+dY,28+dX,2) pss.place_shape(pss.mesh_Shps[0,:,:],32+dY,28+dX,3) pss.place_shape(pss.mesh_Shps[0,:,:],32+dY,28+dX-16,4) #pss.place_shape(pss.mesh_Shps[0,:,:],50,25,3) #pss.place_shape(pss.mesh_Shps[0,:,:],50,41,4) #pss.place_shape(pss.mesh_Shps[0,:,:],50,9,2)
L_cells = 234 # T - Transverse, L - Longitudinal T_cells = 407 r = 8 T_length = 25.4e-3 L_length = 14.6e-3 GRIDSPC = L_length/L_cells print GRIDSPC pss.generate_mesh(L_cells,T_cells,CPPR=r,mat_no=5,GridSpc=GRIDSPC) mats = pss.mats pss.mesh_Shps[0,:,:] = pss.gen_circle(r) i = np.where(abs(pss.yh-12.7e-3)<pss.GS/2.) j = np.where(abs(pss.xh-4.51e-3)<pss.GS/2.) I, J, M = i[0],j[0],mats[4] pss.place_shape(pss.mesh_Shps[0,:,:],J,I,M) Cu1_T1 = 0. Cu1_T2 = 25.4e-3 Cu1_L1 = 0. Cu1_L2 = 1.3e-3 pss.fill_rectangle(Cu1_L1,Cu1_T1,Cu1_L2,Cu1_T2,mats[0]) Cu2_T1 = 7.7e-3 Cu2_T2 = 17.7e-3 Cu2_L1 = 1.3e-3 Cu2_L2 = 2.6e-3 pss.fill_rectangle(Cu2_L1,Cu2_T1,Cu2_L2,Cu2_T2,mats[0]) Al1_T1 = 6.55e-3 Al1_T2 = 7.7e-3
# The Separation is only for the vert lines case. here we need it for the rotated case # and must rotate the separation appropriately M = 0 j = cppr ind_i = np.arange(0, pss.meshx, di) N = np.size(ind_i) #ind_i = np.append(ind_i,ind_i[-1]+Separation) xc = [] yc = [] radii = [] mats = [] while j < pss.meshy + cppr: for item in ind_i: if item > -cppr and item < pss.meshx + cppr: pss.place_shape(pss.mesh_Shps[0, :, :], j, item, M) yc.append(j) xc.append(item) radii.append(float(r)) mats.append(M) M += 1 if M > 4: M = 0 ind_i += dind for k in range(N - 1, -1, -1): if ind_i[k] > (pss.meshx): ind_i[k] = ind_i[0] - di ind_i = np.roll(ind_i, 1) j += dj mats = np.array(mats) radii = np.array(radii)
# The Separation is only for the vert lines case. here we need it for the rotated case # and must rotate the separation appropriately M = 0 j = cppr ind_i = np.arange(0,pss.meshx,di) N = np.size(ind_i) #ind_i = np.append(ind_i,ind_i[-1]+Separation) xc = [] yc = [] radii = [] mats = [] while j < pss.meshy+cppr: for item in ind_i: if item>-cppr and item < pss.meshx+cppr: pss.place_shape(pss.mesh_Shps[0,:,:],j,item,M) yc.append(j) xc.append(item) radii.append(float(r)) mats.append(M) M += 1 if M > 4: M = 0 ind_i += dind for k in range(N-1,-1,-1): if ind_i[k] > (pss.meshx): ind_i[k] = ind_i[0] - di ind_i = np.roll(ind_i,1) j += dj mats = np.array(mats) radii = np.array(radii)