How do I calculate the gradient and the Laplacian of a FEM mesh?

16 views (last 30 days)

Hi, I am going to make a program that solves a PDE in a discretized scalar field. The discretization in made in such a way that it can be considered being build up of an irregular triangular mesh, and where the function values are located in the vertices. It is going to be static so the mesh won't change. Here is an example of what it could look like:

To be able to solve the PDE, I need to be able to calculate both the gradient and the Laplacian of the field, but how can I do that in an irregular mesh? By the way, the mesh is going to be three-dimensional (so the image is a bit misleading), but maybe I can figure out a way to generalize a two-dimensional method to the corresponding three-dimensional one.

Is there any MatLab functions that can do this? In that way, maybe I could take a look at how those functions work. Thanks in advance!

Answers (1)

bym
bym on 6 Apr 2011
why re-invent the wheel? http://www.mathworks.com/products/pde/

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!