(wires, mesh, logger)
| 152 | return mesh; |
| 153 | |
| 154 | def compute_cell_labels(wires, mesh, logger): |
| 155 | start_time = time(); |
| 156 | arrangement = pymesh.Arrangement2(); |
| 157 | arrangement.points = wires.vertices; |
| 158 | arrangement.segments = wires.edges; |
| 159 | arrangement.run(); |
| 160 | mesh.add_attribute("face_centroid"); |
| 161 | centroids = mesh.get_face_attribute("face_centroid"); |
| 162 | r = arrangement.query(centroids); |
| 163 | finish_time = time(); |
| 164 | t = finish_time - start_time; |
| 165 | logger.info("Arrangement running time: {}".format(t)); |
| 166 | |
| 167 | cell_type = np.array([item[0] for item in r]); |
| 168 | cell_ids = np.array([item[1] for item in r]); |
| 169 | cell_ids[cell_type != pymesh.Arrangement2.ElementType.CELL] = -1; |
| 170 | mesh.add_attribute("cell"); |
| 171 | mesh.set_attribute("cell", cell_ids); |
| 172 | |
| 173 | def solve_heat_equation(mesh): |
| 174 | cell_ids = mesh.get_attribute("cell").ravel().astype(int); |
no test coverage detected