This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

How does vertex_to_dof_map work with multiple processors, say running mpirun -np 2 python test.py

0 votes
asked Nov 19, 2015 by hardikk FEniCS Novice (140 points)

1 Answer

0 votes

It will return the mapping from the vertices of the local portion of the mesh to the local portion of the dofmap (in local numbering).

answered Nov 19, 2015 by chris_richardson FEniCS Expert (31,740 points)

thanks! However my following code snippet leads to the error out of bound index when run with mpirun with more than one processors

mesh.init(tdim-1, 0)
mesh.init(0, tdim-2)
assigned = False
d_net = -1
x = 0
y = 0
z = 0
told = 1e-2
for facet in facets(mesh):
if facet.exterior() and facet.normal(2) < -0.5:
for v in facet.entities(0):
d = sqrt(u_v[v_d[v3]]2 + u_v[v_d[v*3+1]]2 + u_v[v_d[v3+2]]**2)
vertex = Vertex(mesh, v)
distance = bbtree.compute_closest_entity(vertex.point())
if d > d_net:
if distance[1] < told:
x = mesh_points[v][0]
y = mesh_points[v][1]
z = mesh_points[v][2]
assigned = True
d_net = d
vertex_m = vertex
vertex_mark = v
facet_mark = facet

May be there is a better way to do this but I want to find the deformation (solution to elasticity problem) on the nodes on the boundary and find the maximum one.

Thanks, for help

...