[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.
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
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
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.
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 .
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 .