oILAB
Loading...
Searching...
No Matches
gbLAB::Lattice< dim > Class Template Reference

Lattice class. More...

#include <Lattice.h>

+ Inheritance diagram for gbLAB::Lattice< dim >:

Public Member Functions

 Lattice (const MatrixDimD &A, const MatrixDimD &Q=MatrixDimD::Identity())
 
LatticeVector< dim > latticeVector (const VectorDimD &p) const
 Returns a lattice vector (in the current lattice) with Cartesian coordinates p.
 
LatticeDirection< dim > latticeDirection (const VectorDimD &d, const double &tol=FLT_EPSILON) const
 Returns the lattice direction along a vector.
 
ReciprocalLatticeVector< dim > reciprocalLatticeVector (const VectorDimD &p) const
 Returns a reciprocal lattice vector (in the dual of the current lattice) with Cartesian coordinates p.
 
ReciprocalLatticeDirection< dim > reciprocalLatticeDirection (const VectorDimD &d, const double &tol=FLT_EPSILON) const
 Returns the reciprocal lattice direction along a vector.
 
std::vector< ReciprocalLatticeDirection< dim > > directionOrthogonalReciprocalLatticeBasis (const LatticeDirection< dim > &l, const bool &useRLLL=false) const
 Given a lattice direction \(\textbf l\), this function returns a direction-orthogonal reciprocal lattice basis \([\textbf r_1,\cdots,\textbf r_{dim}]\), with the property \(\textbf r_1 \cdot \textbf l=1\) and the remaining reciprocal basis vectors are orthogonal to \(\textbf l\), i.e., \(\boldsymbol r_i \cdot \textbf l = 0\) for \(i=2,\cdots,dim\).
 
RationalLatticeDirection< dim > rationalLatticeDirection (const VectorDimD &d, const typename BestRationalApproximation::LongIntType &maxDen, const double &magnitudeTol, const double &directionTol=FLT_EPSILON) const
 
RationalReciprocalLatticeDirection< dim > rationalReciprocalLatticeDirection (const VectorDimD &d, const typename BestRationalApproximation::LongIntType &maxDen, const double &magnitudeTol, const double &directionTol=FLT_EPSILON) const
 
std::vector< LatticeDirection< dim > > planeParallelLatticeBasis (const ReciprocalLatticeDirection< dim > &l, const bool &useRLLL=false) const
 Given a reciprocal lattice direction \(\textbf l\), this function returns a plane-parallel lattice basis \([\textbf b_1,\cdots,\textbf b_{dim}]\), with the property \(\textbf b_1 \cdot \textbf l=1\) and the remaining basis vectors lie in the lattice plane represented by \(\textbf l\), i.e. \(\textbf b_i \cdot \textbf l = 0\) for \(i=2,\cdots,dim\).
 
double interPlanarSpacing (const ReciprocalLatticeDirection< dim > &r) const
 Computes the interplanar spacing.
 
template<int dm = dim>
std::enable_if< dm==3, std::vector< MatrixDimD > >::type generateCoincidentLattices (const ReciprocalLatticeDirection< dim > &rd, const double &maxDen=100, const int &N=100) const
 
template<int dm = dim>
std::enable_if< dm==2, std::vector< MatrixDimD > >::type generateCoincidentLattices (const double &maxStrain, const int &maxDen=50, const int &N=30) const
 
template<int dm = dim>
std::enable_if< dm==2, std::vector< MatrixDimD > >::type generateCoincidentLattices (const Lattice< dim > &undeformedLattice, const double &maxStrain, const int &maxDen=50, const int &N=30) const
 
template<int dm = dim>
std::enable_if< dm==3, std::vector< LatticeVector< dim > > >::type box (const std::vector< LatticeVector< dim > > &boxVectors, const std::string &filename="") const
 
template<int dm = dim>
std::enable_if< dm==2, std::vector< LatticeVector< dim > > >::type box (const std::vector< LatticeVector< dim > > &boxVectors, const std::string &filename="") const
 
- Public Member Functions inherited from gbLAB::StaticID< Lattice< dim > >
 StaticID ()
 
 StaticID (const StaticID &)
 

Data Fields

const MatrixDimD latticeBasis
 
const MatrixDimD reciprocalBasis
 
const MatrixDimD F
 
- Data Fields inherited from gbLAB::StaticID< Lattice< dim > >
const size_t sID
 The static ID of this.
 

Private Types

using VectorDimD = typename LatticeCore< dim >::VectorDimD
 
using MatrixDimD = typename LatticeCore< dim >::MatrixDimD
 
using VectorDimI = typename LatticeCore< dim >::VectorDimI
 
using MatrixDimI = typename LatticeCore< dim >::MatrixDimI
 
using IntScalarType = typename LatticeCore< dim >::IntScalarType
 

Static Private Attributes

static constexpr double roundTol =FLT_EPSILON
 

Additional Inherited Members

- Static Public Member Functions inherited from gbLAB::StaticID< Lattice< dim > >
static size_t nextID ()
 
static size_t & get_count ()
 
static void set_count (const size_t &newCount)
 
static void set_increment (const size_t &newIncrement)
 

Detailed Description

template<int dim>
class gbLAB::Lattice< dim >

Lattice class.

The Lattice<dim> class describes a lattice in dim dimensions

Examples
testCoincidentRotations.cpp, testGb.cpp, testGb3d.cpp, testGenerateGBs.cpp, testLattice.cpp, testMoire.cpp, testPlaneParallelLatticeDirections.cpp, and testSNF.cpp.

Definition at line 33 of file Lattice.h.

Member Typedef Documentation

◆ IntScalarType

template<int dim>
using gbLAB::Lattice< dim >::IntScalarType = typename LatticeCore<dim>::IntScalarType
private

Definition at line 41 of file Lattice.h.

◆ MatrixDimD

template<int dim>
using gbLAB::Lattice< dim >::MatrixDimD = typename LatticeCore<dim>::MatrixDimD
private

Definition at line 38 of file Lattice.h.

◆ MatrixDimI

template<int dim>
using gbLAB::Lattice< dim >::MatrixDimI = typename LatticeCore<dim>::MatrixDimI
private

Definition at line 40 of file Lattice.h.

◆ VectorDimD

template<int dim>
using gbLAB::Lattice< dim >::VectorDimD = typename LatticeCore<dim>::VectorDimD
private

Definition at line 37 of file Lattice.h.

◆ VectorDimI

template<int dim>
using gbLAB::Lattice< dim >::VectorDimI = typename LatticeCore<dim>::VectorDimI
private

Definition at line 39 of file Lattice.h.

Constructor & Destructor Documentation

◆ Lattice()

template<int dim>
gbLAB::Lattice< dim >::Lattice ( const MatrixDimD A,
const MatrixDimD Q = MatrixDimD::Identity() 
)

Definition at line 46 of file Lattice.cpp.

Member Function Documentation

◆ box() [1/2]

template<int dim>
template<int dm>
std::enable_if< dm==2, std::vector< LatticeVector< dim > > >::type gbLAB::Lattice< dim >::box ( const std::vector< LatticeVector< dim > > &  boxVectors,
const std::string &  filename = "" 
) const

This function outputs/prints lattice points within a box bounded by the input box vectors. The box vectors have to be linearly independent lattice vectors. This function is specialized to dim=3.

Template Parameters
dmdimension (int)
Parameters
boxVectorsthree linearly independent lattice vectors
filename(optional) name of the output file
Returns
Lattice points bounded by the box vectors
Examples
testLattice.cpp.

Definition at line 467 of file Lattice.cpp.

◆ box() [2/2]

template<int dim>
template<int dm = dim>
std::enable_if< dm==2, std::vector< LatticeVector< dim > > >::type gbLAB::Lattice< dim >::box ( const std::vector< LatticeVector< dim > > &  boxVectors,
const std::string &  filename = "" 
) const

This function outputs/prints lattice points within a box bounded by the optional input box vectors. The box vectors have to be linearly independent lattice vectors. This function is specialized to dim=2.

Template Parameters
dmdimension (int)
Parameters
boxVectorstwo linearly independent lattice vectors
filename(optional) name of the output file
Returns
Lattice points bounded by the box vectors

◆ directionOrthogonalReciprocalLatticeBasis()

template<int dim>
std::vector< ReciprocalLatticeDirection< dim > > gbLAB::Lattice< dim >::directionOrthogonalReciprocalLatticeBasis ( const LatticeDirection< dim > &  l,
const bool &  useRLLL = false 
) const

Given a lattice direction \(\textbf l\), this function returns a direction-orthogonal reciprocal lattice basis \([\textbf r_1,\cdots,\textbf r_{dim}]\), with the property \(\textbf r_1 \cdot \textbf l=1\) and the remaining reciprocal basis vectors are orthogonal to \(\textbf l\), i.e., \(\boldsymbol r_i \cdot \textbf l = 0\) for \(i=2,\cdots,dim\).

Parameters
[in]lLattice direction
Returns
a reciprocal lattice basis \([\textbf r_1,\cdots,\textbf r_{dim}]\)
Examples
testPlaneParallelLatticeDirections.cpp.

Definition at line 235 of file Lattice.cpp.

◆ generateCoincidentLattices() [1/3]

template<int dim>
template<int dm>
template std::vector< typename Lattice< 2 >::MatrixDimD > gbLAB::Lattice< dim >::generateCoincidentLattices< 2 > ( const double &  maxStrain,
const int &  maxDen = 50,
const int &  N = 30 
) const

This function generates deformations \(\mathbf F\) such that the deformations of *this lattice share moire supercells with the undeformed *this lattice

Definition at line 361 of file Lattice.cpp.

◆ generateCoincidentLattices() [2/3]

template<int dim>
template<int dm>
std::enable_if< dm==2, std::vector< typenameLattice< dim >::MatrixDimD > >::type gbLAB::Lattice< dim >::generateCoincidentLattices ( const Lattice< dim > &  undeformedLattice,
const double &  maxStrain,
const int &  maxDen = 50,
const int &  N = 30 
) const

This function generates deformations \(\mathbf F\) such that the deformations of *this lattice share moire supercells with a given undeformed 2D lattice. It is specialized to dim=2.

The current algorithm betters the one given in Algorithm 2 of

[1] Admal, Nikhil Chandra, et al. "Interface dislocations and grain boundary disconnections using Smith normal bicrystallography." Acta materialia 240 (2022): 118340.

Note: There was a typo in Algorithm 2 in [1] - \(\mathfrak q_1\) and \(\mathfrak r_1\) should be replaced by the basis vectors \(\mathbf q_1\) and \(\mathbf r_1\) of lattice \(\mathcal B\).

Template Parameters
undeformedLatticeunderformed lattice
dmdimension (int)
Parameters
maxStrainmaximum strain
maxDeninteger parameter that determines the resolution for the search of rotations
Ninteger parameter that determines the maximum size of the CSL
Returns
A set of deformation gradients of *this lattice that result in moire superlattices with the undeformed lattice

Definition at line 370 of file Lattice.cpp.

◆ generateCoincidentLattices() [3/3]

template<int dim>
template<int dm>
std::enable_if< dm==3, std::vector< typenameLattice< dim >::MatrixDimD > >::type gbLAB::Lattice< dim >::generateCoincidentLattices ( const ReciprocalLatticeDirection< dim > &  rd,
const double &  maxDen = 100,
const int &  N = 100 
) const

This function generates rotations (about a given axis) that result in a coincident site lattice. It is specialized to dim=3

Template Parameters
dmdimension (int)
Parameters
rdaxis (Reciprocal lattice direction)
maxDeninteger parameter that determines the resolution for the search of rotations
Ninteger parameter that determines the maximum size of the CSL
Returns
A set of rotations that result in CSLs.

Definition at line 312 of file Lattice.cpp.

◆ interPlanarSpacing()

template<int dim>
double gbLAB::Lattice< dim >::interPlanarSpacing ( const ReciprocalLatticeDirection< dim > &  r) const

Computes the interplanar spacing.

Parameters
rReciprocal lattice direction
Returns
interPlanarSpacing

Definition at line 303 of file Lattice.cpp.

◆ latticeDirection()

template<int dim>
LatticeDirection< dim > gbLAB::Lattice< dim >::latticeDirection ( const VectorDimD d,
const double &  tol = FLT_EPSILON 
) const

Returns the lattice direction along a vector.

Parameters
[in]dcartesian coordinates of a vector
Returns
Lattice direction along d
Examples
testLattice.cpp.

Definition at line 56 of file Lattice.cpp.

◆ latticeVector()

template<int dim>
LatticeVector< dim > gbLAB::Lattice< dim >::latticeVector ( const VectorDimD p) const

Returns a lattice vector (in the current lattice) with Cartesian coordinates p.

Parameters
[in]dcartesian coordinates of a vector
Returns
Lattice vector
Examples
testLattice.cpp.

Definition at line 155 of file Lattice.cpp.

◆ planeParallelLatticeBasis()

template<int dim>
std::vector< LatticeDirection< dim > > gbLAB::Lattice< dim >::planeParallelLatticeBasis ( const ReciprocalLatticeDirection< dim > &  l,
const bool &  useRLLL = false 
) const

Given a reciprocal lattice direction \(\textbf l\), this function returns a plane-parallel lattice basis \([\textbf b_1,\cdots,\textbf b_{dim}]\), with the property \(\textbf b_1 \cdot \textbf l=1\) and the remaining basis vectors lie in the lattice plane represented by \(\textbf l\), i.e. \(\textbf b_i \cdot \textbf l = 0\) for \(i=2,\cdots,dim\).

Parameters
[in]lReciprocal lattice direction
Returns
A lattice basis \([\textbf b_1,\cdots,\textbf b_{dim}]\)
Examples
testPlaneParallelLatticeDirections.cpp.

Definition at line 169 of file Lattice.cpp.

◆ rationalLatticeDirection()

template<int dim>
RationalLatticeDirection< dim > gbLAB::Lattice< dim >::rationalLatticeDirection ( const VectorDimD d,
const typename BestRationalApproximation::LongIntType maxDen,
const double &  magnitudeTol,
const double &  directionTol = FLT_EPSILON 
) const

Definition at line 110 of file Lattice.cpp.

◆ rationalReciprocalLatticeDirection()

template<int dim>
RationalReciprocalLatticeDirection< dim > gbLAB::Lattice< dim >::rationalReciprocalLatticeDirection ( const VectorDimD d,
const typename BestRationalApproximation::LongIntType maxDen,
const double &  magnitudeTol,
const double &  directionTol = FLT_EPSILON 
) const

Definition at line 133 of file Lattice.cpp.

◆ reciprocalLatticeDirection()

template<int dim>
ReciprocalLatticeDirection< dim > gbLAB::Lattice< dim >::reciprocalLatticeDirection ( const VectorDimD d,
const double &  tol = FLT_EPSILON 
) const

Returns the reciprocal lattice direction along a vector.

Parameters
[in]dcartesian coordinates of a vector
Returns
Reciprocal lattice direction along d
Examples
testGb3d.cpp.

Definition at line 83 of file Lattice.cpp.

◆ reciprocalLatticeVector()

template<int dim>
ReciprocalLatticeVector< dim > gbLAB::Lattice< dim >::reciprocalLatticeVector ( const VectorDimD p) const

Returns a reciprocal lattice vector (in the dual of the current lattice) with Cartesian coordinates p.

Parameters
[in]pcartesian coordinates of a vector
Returns
Reciprocal lattice vector

Definition at line 162 of file Lattice.cpp.

Field Documentation

◆ F

template<int dim>
const MatrixDimD gbLAB::Lattice< dim >::F

Definition at line 48 of file Lattice.h.

◆ latticeBasis

template<int dim>
const MatrixDimD gbLAB::Lattice< dim >::latticeBasis
Examples
testGenerateGBs.cpp, testLattice.cpp, and testMoire.cpp.

Definition at line 46 of file Lattice.h.

◆ reciprocalBasis

template<int dim>
const MatrixDimD gbLAB::Lattice< dim >::reciprocalBasis
Examples
testLattice.cpp.

Definition at line 47 of file Lattice.h.

◆ roundTol

template<int dim>
constexpr double gbLAB::Lattice< dim >::roundTol =FLT_EPSILON
staticconstexprprivate

Definition at line 35 of file Lattice.h.


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