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

Modifying the mesh during integration

+3 votes

I have a time-dependent code that runs on a triangulated surface, and after a fixed number of iterations the coordinates of all the nodes get shifted slightly based on the value of the solution at that node.

Each time the mesh is deformed, is it necessary to recompute a FunctionSpace and/or the associated Test and Trial functions?

asked Aug 9, 2013 by irozada FEniCS Novice (330 points)

1 Answer

+6 votes
 
Best answer

No, the coordinates are always accessed during assembly so you don't need to worry about recreating the FunctionSpace or other variables.

One exception is point evaluation of a Function. In that case, you need to update the BoundingBoxTree used to compute the location of points in the Mesh. You can update the tree (using the development version) by

mesh.bounding_box_tree.build(mesh)

or (on older versions) by

mesh.intersection_operator().clear()
answered Aug 10, 2013 by logg FEniCS Expert (11,790 points)
edited Aug 10, 2013 by Jan Blechta
...