Local Refinement and MPI

8 months ago by
I am solving 2D heat equation in parallel. Everything works well. However, by local refinement of my mesh, it dose not give the correct result in parallel.
To refine the following code is used:
cell_markers = CellFunction("bool", mesh)
		origin = Point(x_refine, y_refine)
		for cell in cells(mesh):
			p = cell.midpoint()
			if p.distance(origin) < refine_criteria:
				cell_markers[cell] = True
		refined_mesh = refine(mesh, cell_markers,True)​
By running is series it works well and the result is correct as well. In the parallel case it refine correctly but the result is non sense.
For each mesh the problem, u,u_n and space function (V) are adopted and the newest problem is solved:
adapt(V, refined_mesh)
adapt(u_n, refined_mesh)
adapt(u, refined_mesh)
adapt(problem, refined_mesh)
V = V.child()
problem = problem.child()
u_n = u_n.child()
u = u.child()
solver = LinearVariationalSolver(problem.leaf_node())​

In addition, to do mesh partitioning following parameters are applied:

parameters["allow_extrapolation"] = True
parameters["partitioning_approach"] = "PARTITION"
parameters["mesh_partitioner"] = "ParMETIS"

It could be as a result of not partitioning locally correct in parallel (although the mesh shows correct refinement) or maybe nodes writes their results on other nodes.
Is it at all possible to do local refinement in parallel like that? Should I implement it in the other way?
I searched to find the the solution but could not find yet. I really appreciate it if somebody could give me help or hint.
Many thanks
Community: FEniCS Project
Have you tried without re-balancing the mesh across compute nodes? As far as I'm aware, mesh to mesh interpolation isn't well supported in dolfin in parallel.

Also the adapt stuff isn't really very snazzy either. I'm not sure if it's been worked on since 2013.
written 8 months ago by Nate  
Thanks for considering my problem. What do you mean by re-balancing? adapt or redistribution which is "True" in  refine function.
written 8 months ago by Nasibeh Hassanjanikhoshkroud  
Yes, I mean does setting redistribution to False help? Then each partition of the mesh and the refined mesh should exactly overlap on each process. This makes mesh to mesh interpolation easier.
written 8 months ago by Nate  
Vow, You are right. It works now...Thanks a lot Nate.
written 8 months ago by Nasibeh Hassanjanikhoshkroud  
Please login to add an answer/comment or follow this question.

Similar posts:
Search »