Figure 1: 2D Comparison
Figure 2: 1D Comparison
When solving engineering problems using the Finite Element Method (FEM), we often need to represent a continuous physical field (temperature, stress, velocity, etc.) on a discrete mesh. Two common ways to do this are nodal interpolation and L² projection.
The Exact FunctionFor demonstration, we used the following 2D oscillatory function as our "true" or exact solution:
f ( x , y ) = sin ( 2 π x ) cos ( 2 π y ) + 0.8 sin ( 4 π x ) sin ( 4 π y )
This function contains multiple waves, making it a good test case to see how well different approximation techniques perform.1. Nodal InterpolationNodal interpolation is the simplest approach. We evaluate the exact function only at the mesh nodes and then use linear shape functions to create a piecewise linear surface across each triangle.
Characteristics:
References:
1. Larson, M. G., & Bengzon, F. (2013). The Finite Element Method: Theory, implementation, and applications. In Texts in computational science and engineering. https://doi.org/10.1007/978-3-642-33287-6
2. Grok
Characteristics:
- The approximated surface passes exactly through the nodal values.
- Easy to implement.
- Can be "peaky" or overshoot/undershoot between nodes, especially on coarse meshes.
This is achieved by solving a linear system involving the mass matrix M and the load vector b.Characteristics:
While nodal interpolation is fast and intuitive, L² projection often gives a superior representation of the solution — especially when accuracy across the entire domain is important.
- Does not necessarily pass exactly through the nodal values of the exact function.
- Usually provides a smoother and more accurate overall approximation.
- Better at capturing average behavior across each element.
- Left: Exact function — smooth and wavy.
- Middle: Nodal Interpolation — follows the nodes but shows visible faceting and local inaccuracies.
- Right: L² Projection — visibly smoother and closer to the true surface in the least-squares sense.
- Choose proper post-processing techniques
- Reduce approximation errors
- Better interpret results from simulation software
While nodal interpolation is fast and intuitive, L² projection often gives a superior representation of the solution — especially when accuracy across the entire domain is important.
References:
1. Larson, M. G., & Bengzon, F. (2013). The Finite Element Method: Theory, implementation, and applications. In Texts in computational science and engineering. https://doi.org/10.1007/978-3-642-33287-6
2. Grok