![]() |
LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
LehrFEM++ provides an interface for geometry data: lf::geometry::Geometry. Geometry data for entities is stored as a mapping \( \Phi_K(\hat{x}) \) from the reference element (unit triangle, square, unit segment) to any general element. \( \Phi_K^{*}(\hat{x}) \) represents the inverse mapping from the general element to the reference element.
For any one element, it is enough to store the mapping \( \Phi_K(\hat{x}) \) from the reference element and the type of the reference element.
More details and mathematical background can be found in Lecture Document Section 2.8.
To get the geometry of an entity:
A number of convenience functions are provided by the Geometry class.
In addition, we can test for some properties of the geometry:
Objects implementing the lf::geometry::Geometry interface provide the following methods:
This part is discussed in detail in Lecture Document Section 2.8. Usage of the following methods is discussed in the Assembly Quick Reference.
The lf::geometry::Geometry class provides the lf::geometry::Geometry::Global method to map points from local to global coordinates. In LehrFEM++, local points generally refer to points on the reference element.
The method lf::geometry::Geometry::IntegrationElement computes the integration element
\[ g(\xi) := \sqrt{\mathrm{det}\left|D\Phi^T(\xi) D\Phi(\xi) \right|} \]
for each point in points as an Eigen::VectorXd.
The method lf::geometry::Geometry::Jacobian computes the Jacobian matrix \( D\Phi(\hat{x}) \) for each point in points.
The Jacobian evaluated at every point is itself a matrix of size dim_global x num_points. The JacobianInverseGramian evaluated at every point is a matrix of size dim_local x (dim_global * num_points). To access the Jacobian at a specific point, use the following code:
If dim_local == dim_global == 2 and we pass three points for evaluation, Geometry::Jacobian returns a \( 2 \times 6 \) matrix:
To access the Jacobian for the second point, we can use Eigen block access:
The method lf::geometry::Geometry::JacobianInverseGramian computes the inverse of the JacobianInverseGramian matrix for each point in points. Details can be found in Lecture Document Paragraph 2.8.3.14 and the method docs. Similarly to Geometry::Jacobian, it also returns a horizontally stacked matrix. Individual matrices can be accessed using Eigen block.