PointBase class
#include <Rodin/Geometry/Point.h>
Base class for spatial points on a discrete mesh.
This class represents a point in the computational domain, maintaining both reference and physical coordinates along with the associated polytope.
Mathematical Foundation
A Point represents the tuple where:
- is a polytope in the mesh
- is the geometric transformation
- are the reference coordinates
- are the physical coordinates
The transformation satisfies:
Coordinate Systems
Points maintain two coordinate systems:
- Reference coordinates : coordinates in the reference element
- Physical coordinates : coordinates in the physical element
Jacobian Information
The class provides access to:
- Jacobian matrix
- Jacobian determinant
- Inverse Jacobian
- Distortion measure
Architecture
Unevaluated physical coordinates optionally carry the logical identity and index of an owned reference sample. Evaluation replaces this state with owned physical coordinates. Neither state borrows a formula or reference table. A missing thread-local reference table uses direct evaluation; rebinding clears both the provenance and the geometric caches.
Thread Safety
This class is not thread-safe. Each thread should use its own Point instances.
Derived classes
- class Point final
- Concrete implementation of a spatial point on a mesh.
Public types
- enum class Coordinates { Reference, Physical }
- Enumeration of coordinate types.
Constructors, destructors, conversion operators
- PointBase(const Polytope& polytope) explicit
- Constructs a point on a polytope.
-
PointBase(const Polytope& polytope,
const Math::
SpatialPoint& pc) explicit - Constructs a point with physical coordinates.
-
PointBase(const Math::
SpatialMatrix<Real>& jacobian, const Polytope& polytope) - Constructs a point with its geometric Jacobian already evaluated.
- PointBase(const PointBase& other)
- Copy constructor.
- PointBase(PointBase&& other)
- Move constructor.
-
PointBase(const Math::
SpatialMatrix<Real>& jacobian, const Polytope& polytope, const QF:: QuadratureFormulaBase& qf, size_t qp) protected - Constructs lazy coordinates with owned quadrature-sample provenance.
Public functions
-
auto getDimension(Coordinates coords = Coordinates::
Physical) const -> size_t - Gets the dimension of coordinates.
- auto operator()(size_t i) const -> Real
- Accesses the i-th physical coordinate.
- auto vector() const -> const auto&
- Gets physical coordinates as a vector.
- auto x() const -> Real
- Gets the x-coordinate (first component).
- auto y() const -> Real
- Gets the y-coordinate (second component).
- auto z() const -> Real
- Gets the z-coordinate (third component).
- auto norm() const -> Real
- Computes the Euclidean norm.
- auto stableNorm() const -> Real
- Computes the stable norm (avoids overflow).
- auto blueNorm() const -> Real
- Computes the Blue norm.
-
template<size_t P>auto lpNorm() const -> Real
- Computes the Lp norm.
- auto squaredNorm() const -> Real
- Computes the squared Euclidean norm.
- auto operator<(const PointBase& p) const -> bool
- Lexicographical comparison operator.
- auto getPolytope() const -> const Polytope&
- Gets the associated polytope.
-
auto getPhysicalCoordinates() const -> const Math::
SpatialVector<Real>& - Gets the physical coordinates.
-
auto getCoordinates(Coordinates coords = Coordinates::
Physical) const -> const Math:: SpatialVector<Real>& - Gets coordinates of specified type.
-
auto getJacobian() const -> const Math::
SpatialMatrix<Real>& virtual - Computes the Jacobian matrix at this point.
- auto getJacobianDeterminant() const -> Real
- Gets the Jacobian determinant at this point.
-
auto getJacobianInverse() const -> const Math::
SpatialMatrix<Real>& - Computes the inverse Jacobian matrix.
- auto getDistortion() const -> Real
- Computes the distortion measure at this point.
- auto setPolytope(const Polytope& polytope) -> PointBase&
- Sets the polytope for this point.
-
auto getReferenceCoordinates() const -> const Math::
SpatialVector<Real>& pure virtual - Gets the reference coordinates (pure virtual).
Enum documentation
enum class Rodin:: Geometry:: PointBase:: Coordinates
Enumeration of coordinate types.
| Enumerators | |
|---|---|
| Reference |
Reference coordinates . |
| Physical |
Physical coordinates . |
Function documentation
Rodin:: Geometry:: PointBase:: PointBase(const Polytope& polytope,
const Math:: SpatialPoint& pc) explicit
Constructs a point with physical coordinates.
| Parameters | |
|---|---|
| polytope in | The polytope containing this point |
| pc in | Physical coordinates |
Rodin:: Geometry:: PointBase:: PointBase(const Math:: SpatialMatrix<Real>& jacobian,
const Polytope& polytope)
Constructs a point with its geometric Jacobian already evaluated.
| Parameters | |
|---|---|
| jacobian in | Geometric Jacobian at the point's reference coordinates. |
| polytope in | Polytope whose transformation produced the matrix. |
The matrix is owned by the point, just as after lazy evaluation. Physical coordinates, inverse, determinant and distortion remain lazy. Rebinding the point invalidates this matrix with the other geometric data.
Rodin:: Geometry:: PointBase:: PointBase(const Math:: SpatialMatrix<Real>& jacobian,
const Polytope& polytope,
const QF:: QuadratureFormulaBase& qf,
size_t qp) protected
Constructs lazy coordinates with owned quadrature-sample provenance.
| Parameters | |
|---|---|
| jacobian | Geometric Jacobian evaluated at the sample. |
| polytope | Polytope whose map defines the point. |
| qf | Formula supplying the reference sample. |
| qp | Sample index in the formula. |
The derived point must own the reference coordinates of sample qp. Only the formula identity and index are retained, never the formula.
size_t Rodin:: Geometry:: PointBase:: getDimension(Coordinates coords = Coordinates:: Physical) const
Gets the dimension of coordinates.
| Parameters | |
|---|---|
| coords in | Type of coordinates (Reference or Physical) |
| Returns | Dimension of the specified coordinate system |
For a bound entity , reference coordinates have dimension and physical coordinates have dimension . The containing mesh dimension does not determine the reference dimension of a lower-dimensional entity.
Real Rodin:: Geometry:: PointBase:: operator()(size_t i) const
Accesses the i-th physical coordinate.
| Parameters | |
|---|---|
| i in | Coordinate index |
| Returns | i-th physical coordinate value |
const auto& Rodin:: Geometry:: PointBase:: vector() const
Gets physical coordinates as a vector.
| Returns | Reference to physical coordinate vector |
|---|
Real Rodin:: Geometry:: PointBase:: stableNorm() const
Computes the stable norm (avoids overflow).
| Returns | Stable norm |
|---|
Real Rodin:: Geometry:: PointBase:: squaredNorm() const
Computes the squared Euclidean norm.
| Returns | Squared norm |
|---|
const Polytope& Rodin:: Geometry:: PointBase:: getPolytope() const
Gets the associated polytope.
| Returns | Reference to the polytope containing this point |
|---|
const Math:: SpatialVector<Real>& Rodin:: Geometry:: PointBase:: getPhysicalCoordinates() const
Gets the physical coordinates.
| Returns | Reference to physical coordinate vector |
|---|
const Math:: SpatialVector<Real>& Rodin:: Geometry:: PointBase:: getCoordinates(Coordinates coords = Coordinates:: Physical) const
Gets coordinates of specified type.
| Parameters | |
|---|---|
| coords in | Type of coordinates to retrieve |
| Returns | Reference to coordinate vector |
const Math:: SpatialMatrix<Real>& Rodin:: Geometry:: PointBase:: getJacobian() const virtual
Computes the Jacobian matrix at this point.
| Returns | Jacobian matrix |
|---|
The Jacobian is computed and cached on first access.
Real Rodin:: Geometry:: PointBase:: getJacobianDeterminant() const
Gets the Jacobian determinant at this point.
| Returns | Determinant |
|---|
The determinant is cached on first access.
const Math:: SpatialMatrix<Real>& Rodin:: Geometry:: PointBase:: getJacobianInverse() const
Computes the inverse Jacobian matrix.
| Returns | Inverse Jacobian |
|---|
The inverse is computed and cached on first access.
Real Rodin:: Geometry:: PointBase:: getDistortion() const
Computes the distortion measure at this point.
| Returns | Distortion value |
|---|
Measures how much the transformation distorts space at this point.
PointBase& Rodin:: Geometry:: PointBase:: setPolytope(const Polytope& polytope)
Sets the polytope for this point.
| Parameters | |
|---|---|
| polytope in | New polytope |
| Returns | Reference to this point for method chaining |
const Math:: SpatialVector<Real>& Rodin:: Geometry:: PointBase:: getReferenceCoordinates() const pure virtual
Gets the reference coordinates (pure virtual).
| Returns | Reference coordinate vector |
|---|
Must be implemented by derived classes.