Mundy: Multibody Nonlocal Dynamics Version of the Day
Loading...
Searching...
No Matches
periodicity.hpp File Reference

Classes

class  mundy::FreeSpaceMetric< Scalar >
 Non-periodic (open-boundary) metric. All operations are identities. More...
class  mundy::OrthorhombicMetric< PeriodicAxes, Scalar >
 Axis-aligned periodic metric parameterised by a compile-time axis bitmask. More...
class  mundy::TriclinicMetric< PeriodicAxes, Scalar >
 General periodic metric for a tilted unit cell. More...
class  mundy::metric
 Runtime-polymorphic metric (stk::topology-style value class). More...
struct  mundy::is_free_space_metric< T >
 True when T is any instantiation of FreeSpaceMetric. More...
struct  mundy::is_free_space_metric< FreeSpaceMetric< Scalar > >
struct  mundy::is_orthorhombic_metric< T >
 True when T is any instantiation of OrthorhombicMetric. More...
struct  mundy::is_orthorhombic_metric< OrthorhombicMetric< PeriodicAxes, Scalar > >
struct  mundy::is_triclinic_metric< T >
 True when T is any instantiation of TriclinicMetric. More...
struct  mundy::is_triclinic_metric< TriclinicMetric< PeriodicAxes, Scalar > >
struct  mundy::is_periodic_metric< T >
 True when T is any periodic metric (orthorhombic or triclinic). More...

Namespaces

namespace  mundy

Functions

Non-member metric constructors
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr OrthorhombicMetric< PeriodicAxes, Scalarmundy::make_orthorhombic_metric (const Vector3< Scalar > &cell_widths)
 Orthorhombic metric from axis-aligned cell widths.
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr OrthorhombicMetric< PeriodicAxes, Scalarmundy::make_orthorhombic_metric (const Vector3< Scalar > &domain_min, const Vector3< Scalar > &domain_max)
 Orthorhombic metric from domain corners.
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr TriclinicMetric< PeriodicAxes, Scalarmundy::make_triclinic_metric (const Matrix3< Scalar > &h)
 Triclinic metric from a cell matrix.
template<unsigned PeriodicAxes = AXIS_XYZ, typename Scalar>
constexpr TriclinicMetric< PeriodicAxes, Scalarmundy::make_triclinic_metric (const Vector3< Scalar > &cell_widths)
 Triclinic metric from axis-aligned cell widths (diagonal h).
reference_point protocol
template<typename Object>
auto mundy::reference_point (const Object &obj)
 Returns the canonical reference point for an object.
Wrapping utilities
template<typename Integer, typename Object, typename Metric>
auto mundy::shift_image (const Object &obj, const Vector3< Integer > &lattice_vector, const Metric &metric)
 Translate an object by an integer number of lattice images.
template<typename Object, typename Metric>
auto mundy::wrap_rigid (const Object &obj, const Metric &metric)
 Translate an object so its reference point lies in the primary cell.
template<typename Object, typename Metric>
void mundy::wrap_rigid_inplace (Object &obj, const Metric &metric)
 In-place variant of wrap_rigid.
template<FinitePrimitive Object, typename Metric>
auto mundy::wrap_points (const Object &obj, const Metric &metric)
 Wrap each geometric point of an object independently into the primary cell.
template<FinitePrimitive Object, typename Metric>
void mundy::wrap_points_inplace (Object &obj, const Metric &metric)
 In-place variant of wrap_points.
template<FinitePrimitive Object, ValidPointType PointT, typename Metric>
auto mundy::unwrap_points_to_ref (const Object &obj, const Metric &metric, const PointT &ref_point)
 Move each point to the periodic image closest to ref_point.
template<FinitePrimitive Object, ValidPointType PointT, typename Metric>
void mundy::unwrap_points_to_ref_inplace (Object &obj, const Metric &metric, const PointT &ref_point)
 In-place variant of unwrap_points_to_ref.
template<ValidPointType PointT, typename Metric>
Vector3< intmundy::image_index (const PointT &p, const Metric &metric)
 The integer periodic image of a point: the lattice cell k such that the point lies in cell k.
template<typename Integer, typename Metric>
Vector3< typename Metric::value_type > mundy::lattice_displacement (const Vector3< Integer > &n, const Metric &metric)
 The Cartesian displacement of an integer lattice combination n, i.e. Σ nᵢ·aᵢ over the lattice vectors.

Variables

Axis bitmask constants
constexpr unsigned mundy::AXIS_X = 0b001u
 Bitmask selecting the X axis (or first lattice vector).
constexpr unsigned mundy::AXIS_Y = 0b010u
 Bitmask selecting the Y axis (or second lattice vector).
constexpr unsigned mundy::AXIS_Z = 0b100u
 Bitmask selecting the Z axis (or third lattice vector).
constexpr unsigned mundy::AXIS_XY = AXIS_X | AXIS_Y
constexpr unsigned mundy::AXIS_XZ = AXIS_X | AXIS_Z
constexpr unsigned mundy::AXIS_YZ = AXIS_Y | AXIS_Z
constexpr unsigned mundy::AXIS_XYZ = AXIS_X | AXIS_Y | AXIS_Z
Metric type traits

Compile-time predicates that classify concrete metric types. These traits are defined here alongside the metric classes so that any code working with metrics can branch on their structural properties without inspecting member names or relying on ad-hoc partial specialisations elsewhere.

Primary templates evaluate to false_type; explicit specialisations below opt each metric family in to the appropriate trait.

template<typename T>
constexpr bool mundy::is_free_space_metric_v = is_free_space_metric<T>::value
template<typename T>
constexpr bool mundy::is_orthorhombic_metric_v = is_orthorhombic_metric<T>::value
template<typename T>
constexpr bool mundy::is_triclinic_metric_v = is_triclinic_metric<T>::value
template<typename T>
constexpr bool mundy::is_periodic_metric_v = is_periodic_metric<T>::value