Rodin::Geometry::PointBase class

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 $ (x, r, p, \tau) $ where:

  • $ \tau $ is a polytope in the mesh $ \mathcal{T}_h $
  • $ x : K \rightarrow \tau $ is the geometric transformation
  • $ r \in K $ are the reference coordinates
  • $ p = x(r) \in \tau $ are the physical coordinates

The transformation satisfies:

\[ p = x(r) \]

Coordinate Systems

Points maintain two coordinate systems:

  • Reference coordinates $ r $ : coordinates in the reference element $ K $
  • Physical coordinates $ p $ : coordinates in the physical element $ \tau $

Jacobian Information

The class provides access to:

  • Jacobian matrix $ \mathbf{J}_x(r) = \frac{\partial x}{\partial r} $
  • Jacobian determinant $ |\mathbf{J}_x(r)| $
  • Inverse Jacobian $ \mathbf{J}_x^{-1}(r) $
  • 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 $ r \in K $ .

Physical

Physical coordinates $ p \in \tau $ .

Function documentation

Rodin::Geometry::PointBase::PointBase(const Polytope& polytope) explicit

Constructs a point on a polytope.

Parameters
polytope in The polytope containing this point

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 PointBase& other)

Copy constructor.

Parameters
other Object to copy from.

Rodin::Geometry::PointBase::PointBase(PointBase&& other)

Move constructor.

Parameters
other Object to move from.

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 $K^k\subset\mathbb{R}^s$ , reference coordinates have dimension $k$ and physical coordinates have dimension $s$ . 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::x() const

Gets the x-coordinate (first component).

Returns x-coordinate value

Real Rodin::Geometry::PointBase::y() const

Gets the y-coordinate (second component).

Returns y-coordinate value

Real Rodin::Geometry::PointBase::z() const

Gets the z-coordinate (third component).

Returns z-coordinate value

Real Rodin::Geometry::PointBase::norm() const

Computes the Euclidean norm.

Returns Euclidean norm $ \|p\|_2 $

Real Rodin::Geometry::PointBase::stableNorm() const

Computes the stable norm (avoids overflow).

Returns Stable norm

Real Rodin::Geometry::PointBase::blueNorm() const

Computes the Blue norm.

Returns Blue norm

template<size_t P>
Real Rodin::Geometry::PointBase::lpNorm() const

Computes the Lp norm.

Template parameters
P Norm order
Returns Lp norm $ \|p\|_p $

Real Rodin::Geometry::PointBase::squaredNorm() const

Computes the squared Euclidean norm.

Returns Squared norm $ \|p\|_2^2 $

bool Rodin::Geometry::PointBase::operator<(const PointBase& p) const

Lexicographical comparison operator.

Parameters
p in Point to compare with
Returns True if this point is lexicographically less than p

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 $ \mathbf{J}_x(r) $

The Jacobian is computed and cached on first access.

Real Rodin::Geometry::PointBase::getJacobianDeterminant() const

Gets the Jacobian determinant at this point.

Returns Determinant $ |\mathbf{J}_x(r)| $

The determinant is cached on first access.

const Math::SpatialMatrix<Real>& Rodin::Geometry::PointBase::getJacobianInverse() const

Computes the inverse Jacobian matrix.

Returns Inverse Jacobian $ \mathbf{J}_x^{-1}(r) $

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.