refine mesh in PDEModel
Show older comments
Hello, I'm trying to solve a laplace equation using PDEModel. I created the mesh object like this:
model=createpde;
msh=generateMesh(model,'Hmax',l/20);
But it looks like it is not good enough (there are no nodes in the bulk). Is there a way to refine the mesh in the PDEModel?
I also tried to refine it like this:
[p,e,t] = meshToPet(msh);
[p,e,t] = refinemesh(dl,p,e,t);
But I dont know how to convert the [p,e,t]-mesh into FEMesh and insert it to the PDEModel object. Is there an opposite function to the meshToPet maybe?
I attached to pictures of the mesh using "generateMesh" command and mesh using "refinemesh" command and
Accepted Answer
More Answers (2)
Ian Jentz
on 2 Oct 2020
There is now a port of refinemesh() available for PDEModel. Like refinemesh(), it works for 2D linear triangular geometries only.
This is how you would run your problem:
model=createpde;
msh=generateMesh(model,'Hmax',l/20);
model = refinePDEMmesh(model);
Lukasz
on 25 Apr 2025
0 votes
Hello, I am a beginner and I need help.
I am creating geometry in the PDE Toolbox - example below.
How can I refine the mesh at the edges in a selected corner of the square, or along the edge on a chosen segment?
I do not want to refine the mesh in the whole area.

Categories
Find more on Geometry and Mesh in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!