core 1.8.1
Shared MPI block decomposition, asynchronous ghost-layer exchange, SDF geometry, load balancing (header-only C++20)
Loading...
Searching...
No Matches
peclet::core::Box< Dim > Struct Template Reference

A physical, axis-aligned box with per-axis periodicity. Continuous — no cells. More...

#include <domain.hpp>

Public Member Functions

Vec< Dim > upper () const
 Upper corner: origin + length.
Vec< Dim > centre () const
Real volume () const
bool contains (const Vec< Dim > &p) const
 Is the point inside [origin, origin+length) on every axis?
Vec< Dim > wrap (const Vec< Dim > &p) const
 Fold a point into the box along the periodic axes; non-periodic axes are left untouched.
Vec< Dim > minImage (const Vec< Dim > &a_, const Vec< Dim > &b) const
 Minimum-image separation b - a, shortened across the periodic axes.

Static Public Member Functions

static constexpr int dim ()

Public Attributes

Vec< Dim > origin {}
 lower corner
Vec< Dim > length {}
 extent per axis (> 0)
std::array< bool, Dim > periodic {}
 per-axis periodicity

Detailed Description

template<int Dim = 3>
struct peclet::core::Box< Dim >

A physical, axis-aligned box with per-axis periodicity. Continuous — no cells.

Definition at line 34 of file domain.hpp.

Member Function Documentation

◆ dim()

template<int Dim = 3>
constexpr int peclet::core::Box< Dim >::dim ( )
inlinestaticconstexpr

Definition at line 39 of file domain.hpp.

◆ upper()

template<int Dim = 3>
Vec< Dim > peclet::core::Box< Dim >::upper ( ) const
inline

Upper corner: origin + length.

Definition at line 42 of file domain.hpp.

References length, and origin.

◆ centre()

template<int Dim = 3>
Vec< Dim > peclet::core::Box< Dim >::centre ( ) const
inline

Definition at line 49 of file domain.hpp.

References length, and origin.

◆ volume()

template<int Dim = 3>
Real peclet::core::Box< Dim >::volume ( ) const
inline

Definition at line 56 of file domain.hpp.

References length.

◆ contains()

template<int Dim = 3>
bool peclet::core::Box< Dim >::contains ( const Vec< Dim > & p) const
inline

Is the point inside [origin, origin+length) on every axis?

Definition at line 64 of file domain.hpp.

References length, and origin.

◆ wrap()

template<int Dim = 3>
Vec< Dim > peclet::core::Box< Dim >::wrap ( const Vec< Dim > & p) const
inline

Fold a point into the box along the periodic axes; non-periodic axes are left untouched.

Definition at line 73 of file domain.hpp.

References length, origin, and periodic.

◆ minImage()

template<int Dim = 3>
Vec< Dim > peclet::core::Box< Dim >::minImage ( const Vec< Dim > & a_,
const Vec< Dim > & b ) const
inline

Minimum-image separation b - a, shortened across the periodic axes.

Definition at line 89 of file domain.hpp.

References length, and periodic.

Member Data Documentation

◆ origin

template<int Dim = 3>
Vec<Dim> peclet::core::Box< Dim >::origin {}

lower corner

Definition at line 35 of file domain.hpp.

Referenced by centre(), contains(), upper(), and wrap().

◆ length

template<int Dim = 3>
Vec<Dim> peclet::core::Box< Dim >::length {}

extent per axis (> 0)

Definition at line 36 of file domain.hpp.

Referenced by centre(), contains(), minImage(), upper(), volume(), and wrap().

◆ periodic

template<int Dim = 3>
std::array<bool, Dim> peclet::core::Box< Dim >::periodic {}

per-axis periodicity

Definition at line 37 of file domain.hpp.

Referenced by minImage(), and wrap().


The documentation for this struct was generated from the following file: