MATLAB: It’s possible to update nodes value in a mesh that was created with pde toolbox

pdepdetoolbox

Hello,
i'm trying to update my mesh nodes values with the result of a simulation. What i like to do is something like this:
results = solvepde(model);
u = results.NodalSolutions;
mesh.Nodes = mesh.Nodes + u;
i know that this last line is wrong, but exist a function that do this?

Best Answer

Hello Gabriel,
You can achieve this using geometryFromMesh function. Following your example:
results = solvepde(model);
u = results.NodalSolutions;
oldNodes = model.Mesh.Nodes;
newNodes = oldNodes + u';
elements = model.Mesh.Elements;
% Delete the geometry. As you will create new geometry with deformed mesh.
model.Geometry = []
newMesh = geometryFromMesh(model,newNodes,elements);
Regards,
Ravi