but that does not work because I am not updating the actual vertices inside Netgen.
What I would like is to have two pointers, one to the initial unperturbed mesh and one to the deformed mesh but I do not really know how to proceed.
Could you indicate me how to change user-defined vertex coordinates and update the mesh metrics in C++ while keeping an access to the initial mesh? I could not find how to do that when browsing the mesh classes of Netgen.
the shared_ptr holds a shared pointer to the Netgen class Mesh (in libsrc/meshing/meshclass.hpp), which can be accessed by “GetNetgenMesh()”.
Having the Mesh object on the Netgen side, you can get a reference to the points using the member function “Points()”, which allows you to modify them.
I guess you have to start with two meshes on the Netgen side and perturb one of them, otherwise you won’t be able to keep initial mesh.
Thank you very much for your reply! With your advice, I managed to modify the vertices coordinates.
What I would like is to keep the solution field the same before and after mesh perturbation, and just modify the mesh metrics. I am thus wondering which routines I should call to update the mesh topology properly (Jacobians, face normals, etc.)?
since you just change the coordinates of the points and not the topology (like number of vertices, edges, …) I think you need neither of them.
Jacobians, normals and so on are calculated based on the ElementTransformation, which loads the coordinates of the points when it is created. Thus you should get the updated ones.
Another option came into my mind, which is used for ALE. You could use