Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
Lattices_NEW/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 <LatticePlaneBase.h>
14#include <Plane.h>
15
16namespace model
17{
18
19
20 template<int dim>
21 struct LatticePlaneKey
22 {// dim ints for direction, 1 int for heigth
23
24
25 typedef long int LongIntType;
26 typedef Eigen::Matrix<double,dim,1> VectorDimD;
27 typedef Eigen::Matrix<LongIntType,dim,1> VectorDimI;
28 typedef std::array<LongIntType,dim+2> ArrayType;
29 //
30 /**************************************************************************/
32
33 /**************************************************************************/
34 static int sgn(const LongIntType& val);
35
36 /**************************************************************************/
38
39
40 const ArrayType array;
41
42 /**********************************************************************/
44 const LongIntType& h,
45 const LongIntType& latticeID) ;
46
47 /**********************************************************************/
50 /**********************************************************************/
53
54 /**********************************************************************/
55 LatticePlaneKey(const long int& hin,
57
58
59 Eigen::Map<const VectorDimI> reciprocalDirectionComponents() const;
60
61 const LongIntType& planeIndex() const;
62
63 const LongIntType& latticeID() const;
64
65 bool operator<(const LatticePlaneKey<dim>& other) const;
66 /**********************************************************************/
67 template <class T>
68 friend T& operator << (T& os, const LatticePlaneKey<dim>& key)
69 {
70 for(const auto& val : key.array)
71 {
72 os<<val<<" ";
73 }
74 return os;
75 }
76
77 };
78
79
80 struct LatticePlane
81 {
82 static constexpr int dim=3;
83 typedef Eigen::Matrix<double,dim,1> VectorDimD;
85
86 /**********************************************************************/
87 static std::pair<bool,long int> computeHeight(const ReciprocalLatticeDirection<dim>& r,
88 const VectorDimD& P);
89
90 /**********************************************************************/
91 static std::pair<bool,long int> computeHeight(const ReciprocalLatticeDirection<dim>& r,
92 const LatticeVector<dim>& L);
93
97
98 /**********************************************************************/
101 /**********************************************************************/
104 /**********************************************************************/
105 LatticePlane(const long int& hin,
107
108 /**********************************************************************/
110
111 };
112
113}
114#endif
115
VectorDimD planeOrigin() const
LatticeVector< dim > LatticeVectorType
LatticePlane(const long int &hin, const ReciprocalLatticeDirection< dim > &r)
static constexpr int dim
static std::pair< bool, long int > computeHeight(const ReciprocalLatticeDirection< dim > &r, const VectorDimD &P)
LatticePlane(const LatticeVector< dim > &L, const ReciprocalLatticeDirection< dim > &r)
const LatticePlaneKey< dim >::LongIntType planeIndex
Eigen::Matrix< double, dim, 1 > VectorDimD
const LatticePlaneKey< dim > key
const ReciprocalLatticeDirection< dim > n
static std::pair< bool, long int > computeHeight(const ReciprocalLatticeDirection< dim > &r, const LatticeVector< dim > &L)
LatticePlane(const VectorDimD &P, const ReciprocalLatticeDirection< dim > &r)
LatticePlaneKey(const LatticeVector< dim > &L, const ReciprocalLatticeDirection< dim > &r)
friend T & operator<<(T &os, const LatticePlaneKey< dim > &key)
Eigen::Map< const VectorDimI > reciprocalDirectionComponents() const
const LongIntType & planeIndex() const
Eigen::Matrix< double, dim, 1 > VectorDimD
LatticePlaneKey(const VectorDimD &P, const ReciprocalLatticeDirection< dim > &r)
const LongIntType & latticeID() const
static ArrayType hr2array(const VectorDimI &r, const LongIntType &h, const LongIntType &latticeID)
static int sgn(const LongIntType &val)
bool operator<(const LatticePlaneKey< dim > &other) const
Eigen::Matrix< LongIntType, dim, 1 > VectorDimI
LatticePlaneKey(const long int &hin, const ReciprocalLatticeDirection< dim > &r)
LatticePlaneKey(const VectorDimI &r, const LongIntType &h, const LongIntType &latticeID)
const LongIntType & latticeID() const
std::array< LongIntType, dim+2 > ArrayType
static ArrayType correct_h_sign(VectorDimI r, LongIntType h, const LongIntType &latticeID)
REAL * h
newbad key