Make regular mesh on rectangular geometry

poimesh IS NOT RECOMMENDED. To solve Poisson's equations, use solvepde. For details, see Solve Problems Using PDEModel Objects.


[p,e,t] = poimesh(g,nx,ny)
[p,e,t] = poimesh(g,n)
[p,e,t] = poimesh(g)


[p,e,t] = poimesh(g,nx,ny) constructs a regular mesh on the rectangular geometry specified by g, by dividing the "x edge" into nx pieces and the "y edge" into ny pieces, and placing (nx+1)*(ny+1) points at the intersections.

The "x edge" is the one that makes the smallest angle with the x-axis.

[p,e,t] = poimesh(g,n) uses nx = ny = n, and [p,e,t] = poimesh(g) uses nx = ny = 1.

The triangular mesh is described by the mesh data p, e, and t. For details on the mesh data representation, see initmesh.

For best performance with poisolv, the larger of nx and ny should be a power of 2.

If g does not seem to describe a rectangle, p is zero on return.

Was this topic helpful?