Main Content

pdeintrp

(Not recommended) Interpolate mesh nodal data to triangle midpoints

pdeintrp is not recommended. Use interpolateSolution and evaluateGradient instead.

Description

example

ut = pdeintrp(p,t,un) uses the data un at mesh nodes to linearly interpolate data at mesh triangle midpoints.

pdeintrp and pdeprtni are not inverse functions because the interpolation introduces some averaging.

Examples

collapse all

Solve the equation -Δu=1 on the L-shaped membrane and interpolate the solution from nodes to triangle midpoints.

First, create a [p,e,t] mesh on the L-shaped membrane.

[p,e,t] = initmesh('lshapeg'); 

Solve the equation using the Dirichlet boundary condition u=0 on Ω. The result is the solution at the mesh nodes.

un = assempde('lshapeb',p,e,t,1,0,1);

Interpolate the solution from the mesh nodes to the triangle midpoints.

ut = pdeintrp(p,t,un);

Interpolate the solution back to nodes by using the pdeprtni function. Compare the result and the original solution at the mesh nodes. The pdeprtni and pdeintrp functions are not inverse.

un2 = pdeprtni(p,t,ut);
isequal(un,un2)
ans = logical
   0

Input Arguments

collapse all

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 un describe the first component, the following Np values of un describe the second component, and so on.

Data Types: double

Output Arguments

collapse all

Data at triangle midpoints, returned as a row vector.

For a PDE system of N equations and a mesh with Nt elements, the first Nt values of ut describe the first component, the following Nt values of ut describe the second component, and so on.

Version History

Introduced before R2006a

collapse all

R2016a: Not recommended

pdeintrp is not recommended. Use interpolateSolution and evaluateGradient instead. There are no plans to remove pdeintrp.