I have a 2D mesh that I generated via ToElementMesh
. It discretizes a square domain with a small hole whose shape comes from a parametric B-spline. I now want to change the shape of the hole very very slightly and produce a new mesh identical in every respect to the original, except that (only) the coordinates of nodes on the hole are changed. The change is small enough so that I do not have to worry about excessive element distortion. Is there any way to update "Coordinates"
in the mesh "object" without changing anything else in it?
I tried to build the new mesh manually by extracting "Coordinates"
and "MeshElements"
from the original. For instance,
XC = meshoriginal["Coordinates"];
ME = meshoriginal["MeshElements"];
meshupdated = ToElementMesh["Coordinates" -> XC, "MeshElements" -> ME];
changes many properties in meshupdated
, which I want to keep the same as in meshoriginal
(e.g., "BoundaryElements"
and several other properties change);
The purpose of this is to compute a finite difference estimate of the gradient of the response with respect to the B-spline parameters.
I apologize in advance if my question does not conform to this forum standards. It's the first time I ask a question. Thanks!