Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
Classes | Public Types | Static Public Member Functions | Static Public Attributes | List of all members
shammath::LatticeHCP< Tvec > Class Template Reference

utility for generating HCP crystal lattices More...

#include <shammath/include/shammath/crystalLattice.hpp>

Classes

class  Iterator
 Iterator utility to generate the lattice. More...
 
class  IteratorDiscontinuous
 Iterator utility to generate the lattice. More...
 

Public Types

using Tscal = shambase::VecComponent< Tvec >
 

Static Public Member Functions

static constexpr Tvec generator (Tscal dr, std::array< i32, dim > coord) noexcept
 generate a HCP lattice centered on (0,0,0)
 
static constexpr bool can_make_periodic_box (std::array< i32, dim > coord_min, std::array< i32, dim > coord_max)
 check if the given lattice coordinates bounds can make a periodic box
 
static constexpr CoordRange< Tvec > get_periodic_box (Tscal dr, std::array< i32, dim > coord_min, std::array< i32, dim > coord_max)
 Get the periodic box corresponding to integer lattice coordinates this function will throw if the coordinates asked cannot make a periodic lattice.
 
static constexpr std::pair< std::array< i32, dim >, std::array< i32, dim > > get_box_index_bounds (Tscal dr, Tvec box_min, Tvec box_max)
 
static constexpr std::pair< std::array< i32, dim >, std::array< i32, dim > > nearest_periodic_box_indices (std::array< i32, dim > coord_min, std::array< i32, dim > coord_max)
 get the nearest integer triplets bound that gives a periodic box
 

Static Public Attributes

static constexpr u32 dim = 3
 

Detailed Description

template<class Tvec>
class shammath::LatticeHCP< Tvec >

utility for generating HCP crystal lattices

Template Parameters
Tvecposition vector type

Definition at line 52 of file crystalLattice.hpp.

Member Typedef Documentation

◆ Tscal

template<class Tvec >
using shammath::LatticeHCP< Tvec >::Tscal = shambase::VecComponent<Tvec>

Definition at line 59 of file crystalLattice.hpp.

Member Function Documentation

◆ can_make_periodic_box()

template<class Tvec >
static constexpr bool shammath::LatticeHCP< Tvec >::can_make_periodic_box ( std::array< i32, dim >  coord_min,
std::array< i32, dim >  coord_max 
)
inlinestaticconstexpr

check if the given lattice coordinates bounds can make a periodic box

Parameters
coord_mininteger triplet for the minimal coordinates on the lattice
coord_maxinteger triplet for the maximal coordinates on the lattice
Returns
true
false

Definition at line 90 of file crystalLattice.hpp.

◆ generator()

template<class Tvec >
static constexpr Tvec shammath::LatticeHCP< Tvec >::generator ( Tscal  dr,
std::array< i32, dim >  coord 
)
inlinestaticconstexprnoexcept

generate a HCP lattice centered on (0,0,0)

Parameters
dr
coord
Returns
constexpr Tvec

Definition at line 68 of file crystalLattice.hpp.

◆ get_box_index_bounds()

template<class Tvec >
static constexpr std::pair< std::array< i32, dim >, std::array< i32, dim > > shammath::LatticeHCP< Tvec >::get_box_index_bounds ( Tscal  dr,
Tvec  box_min,
Tvec  box_max 
)
inlinestaticconstexpr

Definition at line 140 of file crystalLattice.hpp.

◆ get_periodic_box()

template<class Tvec >
static constexpr CoordRange< Tvec > shammath::LatticeHCP< Tvec >::get_periodic_box ( Tscal  dr,
std::array< i32, dim >  coord_min,
std::array< i32, dim >  coord_max 
)
inlinestaticconstexpr

Get the periodic box corresponding to integer lattice coordinates this function will throw if the coordinates asked cannot make a periodic lattice.

Parameters
drthe particle spacing in the lattice
coord_mininteger triplet for the minimal coordinates on the lattice
coord_maxinteger triplet for the maximal coordinates on the lattice
Returns
constexpr CoordRange<Tvec> the periodic box bounds

Definition at line 116 of file crystalLattice.hpp.

+ Here is the call graph for this function:

◆ nearest_periodic_box_indices()

template<class Tvec >
static constexpr std::pair< std::array< i32, dim >, std::array< i32, dim > > shammath::LatticeHCP< Tvec >::nearest_periodic_box_indices ( std::array< i32, dim >  coord_min,
std::array< i32, dim >  coord_max 
)
inlinestaticconstexpr

get the nearest integer triplets bound that gives a periodic box

Parameters
coord_mininteger triplet for the minimal coordinates on the lattice
coord_maxinteger triplet for the maximal coordinates on the lattice
Returns
constexpr std::pair<std::array<i32, dim>, std::array<i32, dim>> the new bounds

Definition at line 173 of file crystalLattice.hpp.

Member Data Documentation

◆ dim

template<class Tvec >
constexpr u32 shammath::LatticeHCP< Tvec >::dim = 3
staticconstexpr

Definition at line 54 of file crystalLattice.hpp.


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