22 """Generates discretization of circle so that area of all nodes are same"""
25 sim_particle_r = radius
31 sim_particles_area = []
34 sim_num_r_points = num_r_points
35 sim_annlui_width = 1. / sim_num_r_points
38 for i
in xrange(sim_num_r_points):
40 radius_inner = (i + 1.) * sim_annlui_width
41 radius_outer = (i) * sim_annlui_width
45 dtheta = 2. * np.pi / float(dn)
48 for theta
in xrange(dn):
51 radius_quad = (i - 1. / 2.) * sim_annlui_width
52 x = [radius_quad * np.cos(theta * dtheta), radius_quad * np.sin(theta * dtheta)]
54 area = sim_annlui_width * sim_annlui_width * np.pi / 3.
56 sim_particles.append(x)
57 sim_particles_area.append(area)
67 sim_particles_new = []
68 sim_particles_area_new = []
69 for i
in xrange(len(sim_particles)):
71 x = [radius * sim_particles[i][0], radius * sim_particles[i][1]]
72 area = radius * radius * sim_particles_area[i]
73 sim_particles_new.append(x)
74 sim_particles_area_new.append(area)
80 inpf = open(
'mesh_cir.csv',
'w')
83 inpf.write(
"id, x, y, volume\n")
85 for i
in xrange(len(sim_particles_new)):
86 inpf.write(
"%d, %4.6e, %4.6e, %4.6e\n" % (i, sim_particles_new[i][0], sim_particles_new[i][1], sim_particles_area_new[i]))