diff --git a/festim/meshing/mesh_from_vertices.py b/festim/meshing/mesh_from_vertices.py index 2162a57d9..24ca6bfea 100644 --- a/festim/meshing/mesh_from_vertices.py +++ b/festim/meshing/mesh_from_vertices.py @@ -24,12 +24,12 @@ def __init__(self, vertices, **kwargs) -> None: def generate_mesh_from_vertices(self): """Generates a 1D mesh""" + mesh = f.Mesh() if f.MPI.comm_world.rank == 0: vertices = sorted(np.unique(self.vertices)) nb_points = len(vertices) nb_cells = nb_points - 1 editor = f.MeshEditor() - mesh = f.Mesh() editor.open(mesh, "interval", 1, 1) # top. and geom. dimension are both 1 editor.init_vertices(nb_points) # number of vertices editor.init_cells(nb_cells) # number of cells