MATLAB: Use triangular mesh when solving poisson equation in pde toolbox

fast poisson solverpdepoisson equation

Hello guys. I have this question when I am trying to solve poisson equation in matlab. Why use triangular mesh when solving poisson equation in pde toolbox? e.g. poisolv And how do I convert my data in rectangular mesh to triangular mesh? Because I only found the reverse, which is tri2grid(). The problem I have now is that I do not have a closed expression for the function on the right hand side. What I have is numerical, i.e. a matrix in rectangular mesh. How could I modify the fast poisson solver to satisfy my needs? Thanks!

Best Answer

Hi,
Because your domain is rectangular, you can use the poimesh function to generate a "regular" triangular mesh on that domain-- i.e. one that looks like your rectangular mesh except each cell has a diagonal across it.
Since your f-coefficient is defined from numerical data, you will need to write a MATLAB function to define f. That is described on this page:
That page also describes how to use the pdeintrp to interpolate your numerical data from the nodes (i.e. your rectangular grid) to the centroids of the triangular elements where f must be defined.
Bill
Related Question