Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
PeriodicGlidePlaneFactory.h
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_PeriodicGlidePlaneFactory_H_
9#define model_PeriodicGlidePlaneFactory_H_
10
11
12#include <memory>
13#include <string>
14#include <list>
15#include <WeakPtrFactories.h>
16
17#include <GlidePlane.h>
18#include <PeriodicGlidePlane.h>
19#include <GlidePlaneFactory.h>
20#include <TerminalColors.h>
21#include <DiophantineSolver.h>
22#include <PeriodicGlidePlane.h>
23//#include <PeriodicGlidePlane.hpp>
24namespace model
25{
26
27 template<int dim>
28 struct PeriodicGlidePlaneFactory : public KeyConstructableWeakPtrFactory<PeriodicGlidePlaneFactory<dim>,PeriodicGlidePlane<dim>>
29// /* */,public Lattice<dim>
30 {
31
32 typedef Eigen::Matrix<double,dim,1> VectorDim;
38 typedef std::shared_ptr<PeriodicGlidePlaneType> PeriodicGlidePlaneSharedPtrType;
39
40 public:
41
44// const Eigen::Matrix<long int,dim,dim> N; // B=AN, where A is lattice matrix
45 PeriodicGlidePlaneFactory(const Polycrystal<dim>& poly_in,GlidePlaneFactory<dim>& glidePlaneFactory_in);
46 // PeriodicGlidePlaneSharedPtrType get(const GlidePlaneType& plane);
49 const BaseType& periodicGlidePlanes() const;
50// static Eigen::Matrix<double,dim,dim> get_B(const Polycrystal<dim>& poly);
51// static Eigen::Matrix<long int,dim,dim> get_N(const Polycrystal<dim>& poly,const Eigen::Matrix<double,dim,dim>& B);
52
53
54 // GlidePlaneKeyType periodicPlaneKey(const GlidePlaneKeyType& key) const
55 // // GlidePlaneKeyType periodicPlaneKey(const GlidePlaneType& plane) const
56 // {
57 //
58 // const VectorDim meshCenter(0.5*(poly.mesh.xMax()+poly.mesh.xMin()));
59 // const ReciprocalLatticeVector<dim> r(key.reciprocalDirectionComponents(),poly.grains().begin()->second);
60 // const long int meshCenterPlaneIndex(r.closestPlaneIndexOfPoint(meshCenter));
61 // const auto gcd(LatticeGCD<dim>::gcd(key.reciprocalDirectionComponents().transpose()*N));
62 // const long int meshCenterPlaneIndexTemp=meshCenterPlaneIndex/gcd; // make mesh center belong to correct family by flooring
63 // const long int meshCenterPlaneIndexAct=meshCenterPlaneIndexTemp*gcd;
64 // const auto periodicPlaneIndex(key.planeIndex()>=0? key.planeIndex()%gcd : (key.planeIndex()%gcd)+gcd); // adjust sign
65 // return GlidePlaneKeyType(key.reciprocalDirectionComponents(),periodicPlaneIndex+meshCenterPlaneIndexAct,key.latticeID()); // get closest plane to center of mesh
66 // }
67
68 };
69
70}
71#endif
GlidePlaneKey< dim > KeyType
Definition GlidePlane.h:49
PeriodicGlidePlane< dim > PeriodicGlidePlaneType
PeriodicGlidePlaneFactory(const Polycrystal< dim > &poly_in, GlidePlaneFactory< dim > &glidePlaneFactory_in)
GlidePlaneFactory< dim > & glidePlaneFactory
PeriodicGlidePlaneSharedPtrType get(const GlidePlaneKeyType &temp)
std::shared_ptr< PeriodicGlidePlaneType > PeriodicGlidePlaneSharedPtrType
Eigen::Matrix< double, dim, 1 > VectorDim
KeyConstructableWeakPtrFactory< PeriodicGlidePlaneFactoryType, PeriodicGlidePlaneType > BaseType
PeriodicGlidePlaneFactory< dim > PeriodicGlidePlaneFactoryType
vertex temp