Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
CrossSlipModels.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
9#ifndef model_CrossSlipModels_H
10#define model_CrossSlipModels_H
11
12#include <deque>
13#include <CrossSlipBranch.h>
14#include <map>
15#include <tuple>
16
17#include <Eigen/Dense>
18
19#include <TypeTraits.h>
20#include <LatticeModule.h>
21#include <BCClattice.h>
22#include <FCClattice.h>
23#include <Grain.h>
24#include <TerminalColors.h>
26
27namespace model
28{
29 template<int dim> class DislocationNetwork;
30 template <int dim>
32 {
36 typedef std::tuple<std::shared_ptr<NetworkNodeType>,std::shared_ptr<NetworkNodeType>,size_t,size_t> CrossSlipTupleType;
37 typedef std::deque<CrossSlipTupleType> CrossSlipContainerType;
38
39
41 virtual ~BaseCrossSlipModel() = default;
42
43 virtual void addToCrossSlip(const NetworkLinkType& link,CrossSlipContainerType& crossSlipDeq) = 0;
44 virtual std::pair<bool,std::pair<int,int>> isCrossSlipLink(const NetworkLinkType& link) = 0;
45 std::pair<bool,int> isBaseCrossSlipLink(const NetworkLinkType& link, const bool enforceRemeshLength=true) const;
46 virtual bool isThermal() const { return false; }
47 virtual std::optional<ThermalCrossSlipEvent> sampleBranch(const std::vector<const NetworkLinkType*>&,const double) { return std::nullopt; }
48
49 const double crossSlipDeg;
50 const double sinCrossSlip;
51 };
52
53 template <int dim>
55 {
59 typedef std::tuple<std::shared_ptr<NetworkNodeType>,std::shared_ptr<NetworkNodeType>,size_t,size_t> CrossSlipTupleType;
60 typedef std::deque<CrossSlipTupleType> CrossSlipContainerType;
61
63 void addToCrossSlip(const NetworkLinkType& link,CrossSlipContainerType& crossSlipDeq) override;
64 std::pair<bool,std::pair<int,int>> isCrossSlipLink(const NetworkLinkType& link) override;
65 };
66
67// template <int dim> //For FCC lattice the same is BCC
68// struct EscaigCrossSlipModelFCC : public BaseCrossSlipModel<dim>
69// {
70// typedef TypeTraits<DislocationNetwork<dim>> TraitsType;
71// static constexpr int dim=TraitsType::dim;
72// typedef typename TraitsType::NetworkLinkType NetworkLinkType;
73// typedef typename TraitsType::NetworkNodeType NetworkNodeType;
74// typedef std::tuple<std::shared_ptr<NetworkNodeType>,std::shared_ptr<NetworkNodeType>,size_t,size_t> CrossSlipTupleType;
75// typedef std::deque<CrossSlipTupleType> CrossSlipContainerType;
76//
77// std::random_device rd;
78// std::mt19937 gen;
79// std::uniform_real_distribution<> dist;
80// // const bool enableBasalSlipSystems;
81// const double kB_DD;
82// const double lengthC;
83// const double activeVol;
84// const double Tcs;
85// const double omegaA;
86// const double Ea;
87// const double Tau_3;
88//
89//
90// EscaigCrossSlipModelFCC(const PolycrystallineMaterialBase& material,const DefectiveCrystalTraitsIO& traitsIO);
91// double crossSlipRateKernel(const int& k,const NetworkLinkType& link,const SlipSystem& css,
92// const double& w,
93// const double& L,
94// const double& dE,
95// const double& Veff
96// ) const;
97// void addToCrossSlip(const NetworkLinkType& link,CrossSlipContainerType& crossSlipDeq) override;
98// std::pair<bool,std::pair<int,int>> isCrossSlipLink(const NetworkLinkType& link) override;
99// };
100
101 template <int dim>
103 {
107 typedef std::tuple<std::shared_ptr<NetworkNodeType>,std::shared_ptr<NetworkNodeType>,size_t,size_t> CrossSlipTupleType;
108 typedef std::deque<CrossSlipTupleType> CrossSlipContainerType;
109
110 std::random_device rd;
111 std::mt19937 gen;
112 std::uniform_real_distribution<> dist;
116 const double csw;
117 const double csLb;
118 const double csLp;
119 const double csb2pE;
120 const double csb2pVeg;
121 const double csb2pVsc;
122 const double csb2pVec;
123 const double csp2bE;
124 const double csp2bVeg;
125 const double csp2bVsc;
126 const double csp2bVec;
127
129 bool isThermal() const override { return true; }
130 std::optional<ThermalCrossSlipEvent> sampleBranch(const std::vector<const NetworkLinkType*>& links,const double dt) override;
131 std::map<int,double> targetRates(const NetworkLinkType& link) const;
132 double nucleationLength(const NetworkLinkType& link) const;
133 double crossSlipRateKernel(const int& k,const NetworkLinkType& link,const SlipSystem& css,
134 const double& w,
135 const double& L,
136 const double& dE,
137 const double& Veg,
138 const double& Vsc,
139 const double& Vec) const;
140 void addToCrossSlip(const NetworkLinkType& link,CrossSlipContainerType& crossSlipDeq) override;
141 std::pair<bool,std::pair<int,int>> isCrossSlipLink(const NetworkLinkType& link) override;
142 };
143}
144#endif
std::tuple< std::shared_ptr< NetworkNodeType >, std::shared_ptr< NetworkNodeType >, size_t, size_t > CrossSlipTupleType
std::pair< bool, std::pair< int, int > > isCrossSlipLink(const NetworkLinkType &link) override
AthermalCrossSlipModel(const DefectiveCrystalTraitsIO &traitsIO)
std::deque< CrossSlipTupleType > CrossSlipContainerType
void addToCrossSlip(const NetworkLinkType &link, CrossSlipContainerType &crossSlipDeq) override
TraitsType::NetworkLinkType NetworkLinkType
TraitsType::NetworkNodeType NetworkNodeType
TypeTraits< DislocationNetwork< dim > > TraitsType
std::tuple< std::shared_ptr< NetworkNodeType >, std::shared_ptr< NetworkNodeType >, size_t, size_t > CrossSlipTupleType
virtual std::pair< bool, std::pair< int, int > > isCrossSlipLink(const NetworkLinkType &link)=0
virtual bool isThermal() const
virtual std::optional< ThermalCrossSlipEvent > sampleBranch(const std::vector< const NetworkLinkType * > &, const double)
std::pair< bool, int > isBaseCrossSlipLink(const NetworkLinkType &link, const bool enforceRemeshLength=true) const
TraitsType::NetworkNodeType NetworkNodeType
BaseCrossSlipModel(const DefectiveCrystalTraitsIO &traitsIO)
std::deque< CrossSlipTupleType > CrossSlipContainerType
TraitsType::NetworkLinkType NetworkLinkType
virtual ~BaseCrossSlipModel()=default
virtual void addToCrossSlip(const NetworkLinkType &link, CrossSlipContainerType &crossSlipDeq)=0
TypeTraits< DislocationNetwork< dim > > TraitsType
bool isThermal() const override
std::pair< bool, std::pair< int, int > > isCrossSlipLink(const NetworkLinkType &link) override
double crossSlipRateKernel(const int &k, const NetworkLinkType &link, const SlipSystem &css, const double &w, const double &L, const double &dE, const double &Veg, const double &Vsc, const double &Vec) const
TraitsType::NetworkNodeType NetworkNodeType
std::optional< ThermalCrossSlipEvent > sampleBranch(const std::vector< const NetworkLinkType * > &links, const double dt) override
TypeTraits< DislocationNetwork< dim > > TraitsType
std::map< int, double > targetRates(const NetworkLinkType &link) const
std::deque< CrossSlipTupleType > CrossSlipContainerType
double nucleationLength(const NetworkLinkType &link) const
std::tuple< std::shared_ptr< NetworkNodeType >, std::shared_ptr< NetworkNodeType >, size_t, size_t > CrossSlipTupleType
void addToCrossSlip(const NetworkLinkType &link, CrossSlipContainerType &crossSlipDeq) override
TraitsType::NetworkLinkType NetworkLinkType
std::uniform_real_distribution dist
EscaigCrossSlipModelHEX(const PolycrystallineMaterialBase &material, const DefectiveCrystalTraitsIO &traitsIO)
REAL w[16]
int k