[ux,uy] = pdegrad(p,t,u) returns the gradient of u evaluated at the center of each mesh triangle.
The gradient is the same everywhere in the triangle interior because pdegrad uses only linear basis functions. The derivatives at the boundaries of the triangles can be discontinuous.
[ux,uy] = pdegrad(p,t,u,FaceID) restricts the computation to the faces listed in FaceID.
Mesh nodes, specified as a 2-by-Np matrix of nodes (points), where Np is the number of nodes in the mesh. For details on the mesh data representation, see initmesh.
Data Types: double
t — Mesh elements matrix
Mesh elements, specified as a 4-by-Nt matrix of triangles, where Nt is the number of triangles in the mesh. For details on the mesh data representation, see initmesh.
Data Types: double
u — Data at nodes column vector
Data at nodes, specified as a column vector.
For a PDE system of N equations and a mesh with Np node points, the first Np values of u describe the first component, the following Np values of u describe the second component, and so on.
ux — x-component of the gradient of u evaluated at the center of each triangle row vector | matrix
x-component of the gradient of u evaluated at the center of each triangle, returned as a row vector for a scalar PDE or a matrix for a system of PDEs. The number of elements in a row vector or columns in a matrix corresponds to the number Nt of mesh triangles. For a PDE system of N equations, each row i from 1 to N contains ∂ui∂x.
uy — y-component of the gradient of u evaluated at the center of each triangle row vector | matrix
y-component of the gradient of u evaluated at the center of each triangle, returned as a row vector for a scalar PDE or a matrix for a system of PDEs. The number of elements in a row vector or columns in a matrix corresponds to the number Nt of mesh triangles. For a PDE system of N equations, each row i from 1 to N contains ∂ui∂y.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.