Skip to content

Commit

Permalink
Upd
Browse files Browse the repository at this point in the history
  • Loading branch information
KulaginVladimir committed Nov 4, 2023
1 parent 0a80758 commit f088aae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion festim/meshing/mesh_from_vertices.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f088aae

Please sign in to comment.