pdejmps
(Not recommended) Error estimates for adaptation
pdejmps is not recommended. Use meshes represented as
FEMesh objects instead of [p,e,t] meshes. For more
information, see Version History.
Description
calculates the error indication function used for mesh adaptation. The columns of
errf = pdejmps(p,t,c,a,f,u,alpha,beta,m)errf correspond to triangles, and the rows correspond to the
equations in the PDE system.
The function computes the error indicator E(K) for each triangle K as
where is the unit normal of edge and the braced term is the jump in flux across the element edge. Here, α and β are weight indices, and m is an order parameter. The norm is an L2 norm computed over the element K.
Examples
Solve the Laplace equation over a circle sector, with Dirichlet boundary conditions u = cos(2/3atan2(y,x)) along the arc and u = 0 along the straight lines. Use the original coarser mesh and the refined mesh, and calculate the error indication function in both cases.
Generate and plot a mesh for the circle sector geometry.
[p,e,t] = initmesh('cirsg');
pdemesh(p,e,t)
Solve the Laplace equation.
u = assempde('cirsb',p,e,t,1,0,0);Calculate the error indication function for each mesh triangle. Use the weight indices , , and the order parameter m = 1.
alpha = 0.15; beta = 0.15; m = 1; errf = pdejmps(p,t,1,0,0,u,alpha,beta,m);
Find the maximum value of the error indication function.
max(abs(errf))
ans = 0.0306
Refine the original mesh and plot the result.
[p,e,t] = refinemesh('cirsg',p,e,t);
pdemesh(p,e,t)
Solve the same equation on the refined mesh, and calculate the error indication function for each mesh triangle. Use the same values for the weight indices and the order parameter.
u = assempde('cirsb',p,e,t,1,0,0);
errf = pdejmps(p,t,1,0,0,u,alpha,beta,m);Find the maximum value of the error indication function.
max(abs(errf))
ans = 0.0194
Solve the same equation using the adaptmesh function.
[u,p,e,t] = adaptmesh('cirsg','cirsb',1,0,0);
Number of triangles: 197 Number of triangles: 201 Number of triangles: 216 Number of triangles: 233 Number of triangles: 254 Number of triangles: 265 Number of triangles: 313 Number of triangles: 344 Number of triangles: 417 Number of triangles: 475 Number of triangles: 629 Maximum number of refinement passes obtained.
Plot the mesh.
pdemesh(p,e,t)

Calculate the error indication function for each mesh triangle.
errf = pdejmps(p,t,1,0,0,u,alpha,beta,m);
Find the maximum value of the error indication function.
max(abs(errf))
ans = 0.0024
Input Arguments
Mesh node points, specified as a 2-by-Np matrix of points
(nodes), where Np is the number of nodes in the mesh. For details on
mesh data representation, see initmesh.
Data Types: double
Mesh elements, specified as a 4-by-Nt matrix
of triangles, where Nt is the number of triangles in the mesh. For
details on mesh data representation, see initmesh.
Data Types: double
PDE coefficient, specified as a scalar, matrix, character vector, character array,
string scalar, string vector, or coefficient function. c represents
the c coefficient in the scalar PDE
or in the system of PDEs
The coefficients c, a, and
f can depend on the solution u if you use the
nonlinear solver by setting the value of 'Nonlin' to
'on'. The coefficients cannot be functions of the time
t.
Example: 'cosh(x+y.^2)'
Data Types: double | char | string | function_handle
PDE coefficient, specified as a scalar, matrix, character vector, character array,
string scalar, string vector, or coefficient function. a represents
the a coefficient in the scalar PDE
or in the system of PDEs
The coefficients c, a, and
f can depend on the solution u if you use the
nonlinear solver by setting the value of 'Nonlin' to
'on'. The coefficients cannot be functions of the time
t.
Example: 2*eye(3)
Data Types: double | char | string | function_handle
PDE coefficient, specified as a scalar, matrix, character vector, character array,
string scalar, string vector, or coefficient function. f represents
the f coefficient in the scalar PDE
or in the system of PDEs
The coefficients c, a, and
f can depend on the solution u if you use the
nonlinear solver by setting the value of 'Nonlin' to
'on'. The coefficients cannot be functions of the time
t.
Example: char('sin(x)';'cos(y)';'tan(z)')
Data Types: double | char | string | function_handle
PDE solution, specified as a vector.
If the PDE is scalar, meaning that it has only one equation, then
uis a column vector representing the solution u at each node in the mesh.If the PDE is a system of N > 1 equations, then
uis a column vector withN*Npelements, whereNpis the number of nodes in the mesh. The firstNpelements ofurepresent the solution of equation 1, the nextNpelements represent the solution of equation 2, and so on.
Weight index, specified as number.
Data Types: double
Weight index, specified as a number.
Data Types: double
Order parameter, specified as number.
Data Types: double
Output Arguments
Error indicator, returned as a matrix with the number of columns equal to the number
of triangles t and the number of rows equal to the number of PDEs
in the system.
Each matrix row corresponds to an equation in the PDE system.
Each column corresponds to a triangle.
Version History
Introduced before R2006apdejmps and [p,e,t] meshes are not recommended.
Use meshes represented as FEMesh objects instead. There are no plans to
remove pdejmps and [p,e,t] meshes.
Starting in R2016a, use the generateMesh function to create meshes as
FEMesh objects. For details about these meshes, see Mesh Data.
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)