Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
Lattices/LatticePlane.h
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MODEL is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_LatticePlane_h_
9#define model_LatticePlane_h_
10
11#include <iomanip>
12#include <LatticeVector.h>
13#include <Plane.h>
14
15namespace model
16{
17
18 template<int dim>
20 {// dim ints for direction, 1 int for heigth
21
22
23 typedef long int LongIntType;
24 typedef Eigen::Matrix<double,dim,1> VectorDimD;
25 typedef Eigen::Matrix<LongIntType,dim,1> VectorDimI;
26 typedef std::array<LongIntType,dim+2> ArrayType;
27
28 static ArrayType hr2array(const VectorDimI& r, const LongIntType& h,const LongIntType& latticeID);
29 static int sgn(const LongIntType& val);
31
34 const LongIntType& h,
35 const LongIntType& latticeID) ;
40 LatticePlaneKey(const long int& hin,
43 const LongIntType& planeIndex() const;
44 const LongIntType& latticeID() const;
45 bool operator<(const LatticePlaneKey<dim>& other) const;
46 template <class T>
47 friend T& operator << (T& os, const LatticePlaneKey<dim>& key)
48 {
49 for(const auto& val : key.array)
50 {
51 os<<val<<" ";
52 }
53 return os;
54 }
55 };
56
57
59 {
60 static constexpr int dim=3;
61 typedef Eigen::Matrix<double,dim,1> VectorDimD;
63
64 static std::pair<bool,long int> computeHeight(const ReciprocalLatticeDirection<dim>& r,
65 const VectorDimD& P);
66 static std::pair<bool,long int> computeHeight(const ReciprocalLatticeDirection<dim>& r,
67 const LatticeVector<dim>& L);
68
72
73 LatticePlane(const VectorDimD& P,
77 LatticePlane(const long int& hin,
79 VectorDimD planeOrigin() const;
80 };
81
82}
83#endif
84
LatticeVector< dim > LatticeVectorType
static std::pair< bool, long int > computeHeight(const ReciprocalLatticeDirection< dim > &r, const VectorDimD &P)
static constexpr int dim
const LatticePlaneKey< dim >::LongIntType planeIndex
Eigen::Matrix< double, dim, 1 > VectorDimD
const LatticePlaneKey< dim > key
const ReciprocalLatticeDirection< dim > n
LatticePlane(const VectorDimD &P, const ReciprocalLatticeDirection< dim > &r)
VectorDimD planeOrigin() const
friend T & operator<<(T &os, const LatticePlaneKey< dim > &key)
Eigen::Matrix< double, dim, 1 > VectorDimD
static int sgn(const LongIntType &val)
static ArrayType hr2array(const VectorDimI &r, const LongIntType &h, const LongIntType &latticeID)
bool operator<(const LatticePlaneKey< dim > &other) const
Eigen::Matrix< LongIntType, dim, 1 > VectorDimI
LatticePlaneKey(const VectorDimI &r, const LongIntType &h, const LongIntType &latticeID)
const LongIntType & latticeID() const
std::array< LongIntType, dim+2 > ArrayType
const LongIntType & planeIndex() const
static ArrayType correct_h_sign(VectorDimI r, LongIntType h, const LongIntType &latticeID)
VectorDimI reciprocalDirectionComponents() const
REAL * h
newbad key