GridFunction.h file
Grid function class for representing FEM solutions.
This file defines the GridFunction class, which represents functions defined on a finite element mesh by their degrees of freedom. Grid functions are the discrete representation of solutions in finite element analysis.
Mathematical Foundation
A grid function represents a function by its coefficients:
where:
- are the degrees of freedom (stored in the grid function)
- are the basis functions from the finite element space
- is the number of DOFs
Features
- Storage: Manages coefficient vector for FEM solutions
- Evaluation: Point-wise evaluation using basis function interpolation
- I/O: Export to visualization formats (VTK, MEDIT, etc.)
- Operations: Arithmetic operations, norms, projections
- Assignment: Can be set from functions or expressions
Usage Examples
P1 Vh(mesh); GridFunction<P1> u(Vh); // Create grid function // Set from analytical function u = [](const Point& p) { return sin(p.x()) * cos(p.y()); }; // Evaluate at a point Real value = u(point); // Export for visualization u.save("solution.vtu");
Namespaces
- namespace Rodin
- The Rodin library for Shape and Topology Optimization.
- namespace Rodin::FormLanguage
- Module for writing high level abstract expressions.
- namespace Rodin::Variational
- Module which provides the necessary tools for constructing variational problems.
Classes
-
template<class StrictType>class Rodin::Variational::GridFunctionBaseReference
- Base class for discrete finite element functions.
-
template<class Derived, class FES = typename FormLanguage::class Rodin::Variational::GridFunctionBase
Traits<Derived>::FESType, class Data = typename FormLanguage:: Traits<Derived>::DataType> - Base class for grid function objects.