A More Interesting Example
Let's solve a larger and more interesting Laplacian problem: a simple sink and a source on a rectangular grid. It can be defined with the following boundary conditions and mesh.
Figure 3. A two-dimensional Laplacian problem: (a) Problem description and (b) the FEM mesh.
The mesh in Figure 3(b) is formed by the following regular grid:
Each node in the domain has only one degree-of-freedom ; therefore it has the same index as the node number. Providing the fixed dofs and their values as below, we solve the linear system of equations:
The FEM domain is represented by a regular grid. The result can be plotted with the built-in function
Figure 4. The contour plot for the scalar field approximated by the FEM solution.
Converted by Mathematica