physical_line_map = \ [('LineReceiver', [(-150, -20, 300), (-150, 20, 300)])] simple_3d = \ {'name': name, 'dim_x': 500, 'dim_y': 500, 'dim_z': 300, 'periodicity': (True, True, True), 'nb_x': 2, 'nb_y': 2, 'space_x': 250, 'space_y': 250, 'pos_x': 0, 'pos_y': 0, 'crystal_shape': 'square', 'el_size_bulk': 25, 'bulk_tag': 'mat1', 'inclusion_map': map_simple, 'inclusion_types': [None, type1, holes], 'physical_point_map': physical_point_map, 'physical_line_map': physical_line_map} my_crystal = Crystal(**simple_3d) my_mesh = my_crystal.mesh() file = open('%s.geo' % name, 'w') file.write(my_mesh) file.close() print 'Geo saved' my_svg = my_crystal.image() my_svg.save('%s.svg' % name) print 'SVG saved'
def image_equal_string(self, description, result): my_crystal = Crystal(**description) self.assertEquals(my_crystal.image().getXML(), result)
def mesh_equal_string(self, description, result): my_crystal = Crystal(**description) mesh = my_crystal.mesh() print mesh self.assertEquals(mesh, result)