Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
GlidePlane.cpp
Go to the documentation of this file.
1/* This file is part of MoDELib, the Mechanics Of Defects Evolution Library.
2 *
3 *
4 * MoDELib is distributed without any warranty under the
5 * GNU General Public License (GPL) v2 <http://www.gnu.org/licenses/>.
6 */
7
8#ifndef model_GLIDEPLANE_cpp
9#define model_GLIDEPLANE_cpp
10
11#include <GlidePlane.h>
12
13namespace model
14{
15
16 template <int dim>
18 const GlidePlaneKeyType& key_in) :
19 /* init */ LatticePlane(key_in.planeIndex(),ReciprocalLatticeDirection<dim>(key_in.reciprocalDirectionComponents(),*gpF->poly.grain(key_in.latticeID()))) // BETTER TO CONSTRUCT N WITH PRIMITIVE VECTORS ON THE PLANE
20 /* init */,MeshPlane<dim>(gpF->poly.mesh,key_in.latticeID(),this->planeOrigin(),this->n.cartesian())
21 /* init */,glidePlaneFactory(*gpF)
22 /* init */,grain(*gpF->poly.grain(key_in.latticeID()))
23 /* init */,key(key_in)
24 {
25 VerboseGlidePlane(1,"Creating GlidePlane "<<this->sID<<std::endl;);
26 }
27
28 template <int dim>
30 {
31 VerboseGlidePlane(1,"Destroying GlidePlane "<<this->sID<<std::endl;);
32 }
33
34 template <int dim>
35 std::set<std::shared_ptr<SlipSystem>> GlidePlane<dim>::slipSystems() const
36 {
37 std::set<std::shared_ptr<SlipSystem>> temp;
38 for(const auto& ss : grain.slipSystems())
39 {
40 if(this->n.cross(ss.second->n).base().squaredNorm()==0)
41 {
42 temp.emplace(ss.second);
43 }
44 }
45 return temp;
46 }
47
48template <int dim>
49std::shared_ptr<GlidePlaneBase> GlidePlane<dim>::planeBase() const
50{
51 for(const auto& ss : grain.planeNormals())
52 {
53 if(this->n.cross(*ss.second).base().squaredNorm()==0)
54 {
55 return ss.second;
56 }
57 }
58 return std::shared_ptr<GlidePlaneBase>(nullptr);
59}
60
61template <int dim>
63{
64 for(const auto& ss : grain.planeNormals())
65 {
66 if(this->n.cross(*ss.second).base().squaredNorm()==0)
67 {
68 return int(ss.first);
69 }
70 }
71 return -1;
72}
73
74
75template struct GlidePlane<3>;
76}
77#endif
78
std::set< std::shared_ptr< SlipSystem > > slipSystems() const
const GlidePlaneFactoryType & glidePlaneFactory
Definition GlidePlane.h:54
const GlidePlaneKeyType key
Definition GlidePlane.h:56
std::shared_ptr< GlidePlaneBase > planeBase() const
GlidePlane(const GlidePlaneFactoryType *const gpF, const GlidePlaneKeyType &key_in)
GlidePlaneFactory< dim > GlidePlaneFactoryType
Definition GlidePlane.h:47
KeyType GlidePlaneKeyType
Definition GlidePlane.h:50
const Grain< dim > & grain
Definition GlidePlane.h:55
int planeBaseID() const
static constexpr int dim
const LatticePlaneKey< dim >::LongIntType planeIndex
const ReciprocalLatticeDirection< dim > n
LatticePlane(const VectorDimD &P, const ReciprocalLatticeDirection< dim > &r)
VectorDimD planeOrigin() const
MeshPlane(const SimplicialMesh< dim > &mesh, const size_t &rID, const VectorDim &p, const VectorDim &n)
Definition MeshPlane.cpp:57
newsubseg ss[0]
vertex temp
b poly