Partial Differential Equation Toolbox | ![]() ![]() |
Syntax
[p1,e1,t1]=refinemesh(g,p,e,t) [p1,e1,t1]=refinemesh(g,p,e,t,'regular') [p1,e1,t1]=refinemesh(g,p,e,t,'longest') [p1,e1,t1]=refinemesh(g,p,e,t,it) [p1,e1,t1]=refinemesh(g,p,e,t,it,'regular') [p1,e1,t1]=refinemesh(g,p,e,t,it,'longest') [p1,e1,t1,u1]=refinemesh(g,p,e,t,u) [p1,e1,t1,u1]=refinemesh(g,p,e,t,u,'regular') [p1,e1,t1,u1]=refinemesh(g,p,e,t,u,'longest') [p1,e1,t1,u1]=refinemesh(g,p,e,t,u,it) [p1,e1,t1,u1]=refinemesh(g,p,e,t,u,it,'regular') [p1,e1,t1,u1]=refinemesh(g,p,e,t,u,it,'longest')
Description
[p1,e1,t1]=refinemesh(g,p,e,t)
returns a refined version of the triangular mesh specified by the geometry g
, Point matrix p
, Edge matrix e
, and Triangle matrix t
.
The triangular mesh is given by the mesh data p
, e
, and t
. For details on the mesh data representation, see initmesh
.
[p1,e1,t1,u1]=refinemesh(g,p,e,t,u)
refines the mesh and also extends the function u
to the new mesh by linear interpolation. The number of rows in u
should correspond to the number of columns in p
, and u1
has as many rows as there are points in p1
. Each column of u
is interpolated separately.
An extra input argument it
is interpreted as a list of subdomains to refine, if it is a row vector, or a list of triangles to refine, if it is a column vector.
The default refinement method is regular refinement, where all of the specified triangles are divided into four triangles of the same shape. Longest edge refinement, where the longest edge of each specified triangle is bisected, can be demanded by giving longest
as a final parameter. Using regular
as a final parameter results in regular refinement. Some triangles outside of the specified set may also be refined, in order to preserve the triangulation and its quality.
Examples
Refine the mesh of the L-shaped membrane several times. Plot the mesh for the geometry of the L-shaped membrane.
[p,e,t]=initmesh('lshapeg','hmax',inf); subplot(2,2,1), pdemesh(p,e,t) [p,e,t]=refinemesh('lshapeg',p,e,t); subplot(2,2,2), pdemesh(p,e,t) [p,e,t]=refinemesh('lshapeg',p,e,t); subplot(2,2,3), pdemesh(p,e,t) [p,e,t]=refinemesh('lshapeg',p,e,t); subplot(2,2,4), pdemesh(p,e,t) subplot
Algorithm
The algorithm is described by the steps below:
e
by two new entries.
See Also
initmesh
, pdegeom
, pdesdt
, pdeent
![]() | poisolv | sptarn | ![]() |