Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
DislocationNucleation.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
9#ifndef model_DislocationNucleation_cpp
10#define model_DislocationNucleation_cpp
11
12
15
16//#include <TypeTraits.h>
17//#include <LatticeModule.h>
18//#include <BCClattice.h>
19//#include <FCClattice.h>
20//#include <Grain.h>
21//#include <TerminalColors.h>
22//#include <DefectiveCrystal/DefectiveCrystalTraitsIO.h>
23
24namespace model
25{
26
27template <int dim>
33
34template <int dim>
35void DislocationNucleation<dim>::bulkNucleate(const int& bulkNucleationModel)
36{
37 switch (bulkNucleationModel)
38 {
39 case 1:
40 {// NucleationModel #1: shear loop nucleation
41 MicrostructureGenerator mg(DN.ddBase);
42 for(const auto& simplex : DN.ddBase.mesh.simplices())
43 {
44 const auto c(simplex.second->center());
45 const auto grainID(simplex.second->region->regionID);
46 const auto& grain(DN.ddBase.poly.grain(grainID));
47 const auto sigma(DN.microstructures.stress(c,nullptr,nullptr,nullptr));
48 std::map<float,std::shared_ptr<SlipSystem>> rssMap;
49 for(const auto& ss : grain->slipSystems())
50 {
51 rssMap.emplace((sigma*ss.second->unitSlip).dot(ss.second->unitNormal),ss.second);
52 }
53 if(rssMap.begin()->first < 0.05)
54 {
55 const auto& maxRssSlipSystem(rssMap.begin()->second);
57 spec.slipSystemIDs.push_back(maxRssSlipSystem->sID);
58 spec.loopRadii.push_back(50.0);
59 spec.loopCenters=c.transpose();
60 spec.loopSides.push_back(10);
61 mg.addShearLoopIndividual(spec);
62 }
63 }
64 DN.addConfiguration(mg.config());
65 break;
66 }
67
68 default:
69 {
70 break;
71 }
72 }
73}
74
75template <int dim>
76void DislocationNucleation<dim>::surfaceNucleate(const int& surfaceNucleationModel)
77{
78
79}
80
81template struct DislocationNucleation<3>;
82
83}
84#endif
void addShearLoopIndividual(const ShearLoopIndividualSpecification &spec)
c
Definition int_R.m:15
DislocationNetwork< dim > & DN
DislocationNucleation(DislocationNetwork< dim > &DN_in)
void bulkNucleate(const int &bulkNucleationModel)
void surfaceNucleate(const int &surfaceNucleationModel)
newsubseg ss[0]