Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
SingleCrystalBase.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_SingleCrystalBase_cpp_
10#define model_SingleCrystalBase_cpp_
11
12#include <cmath>
13#include <string>
14#include <vector>
15#include <tuple>
16#include <iterator>
17
18#include <SingleCrystalBase.h>
19
20namespace model
21{
22
23template<int dim>
25{
26 if(mat.crystalStructure=="BCC")
27 {
29 }
30 else if(mat.crystalStructure=="FCC")
31 {
33 }
34 else if(mat.crystalStructure=="HEX")
35 {
37 }
38 else if(mat.crystalStructure=="CubicFluorite")
39 {
41 }
42 else
43 {
44 throw std::runtime_error("SingleCrystalSelector::latticeBasis: unknown crystal structure "+mat.crystalStructure);
45 return MatrixDim::Identity();
46 }
47}
48
49template<int dim>
51{
52 if(mat.crystalStructure=="BCC")
53 {
54 return BCClattice<dim>::planeNormals(mat,lat);
55 }
56 else if(mat.crystalStructure=="FCC")
57 {
58 return FCClattice<dim>::planeNormals(mat,lat);
59 }
60 else if(mat.crystalStructure=="HEX")
61 {
62 return HEXlattice<dim>::planeNormals(mat,lat);
63 }
64 else if(mat.crystalStructure=="CubicFluorite")
65 {
67 }
68 else
69 {
70 throw std::runtime_error("SingleCrystalSelector::planeNormals: unknown crystal structure "+mat.crystalStructure);
72 }
73}
74
75template<int dim>
77{
78 if(mat.crystalStructure=="BCC")
79 {
80 return BCClattice<dim>::slipSystems(mat,lat,pnc);
81 }
82 else if(mat.crystalStructure=="FCC")
83 {
84 return FCClattice<dim>::slipSystems(mat,lat,pnc);
85 }
86 else if(mat.crystalStructure=="HEX")
87 {
88 return HEXlattice<dim>::slipSystems(mat,lat,pnc);
89 }
90 else if(mat.crystalStructure=="CubicFluorite")
91 {
93 }
94 else
95 {
96 throw std::runtime_error("SingleCrystalSelector::slipSystems: unknown crystal structure "+mat.crystalStructure);
98 }
99}
100
101template<int dim>
103{
104 if(mat.crystalStructure=="BCC")
105 {
106 return BCClattice<dim>::secondPhases(mat,lat,pnc);
107 }
108 else if(mat.crystalStructure=="FCC")
109 {
110 return FCClattice<dim>::secondPhases(mat,lat,pnc);
111 }
112 else if(mat.crystalStructure=="HEX")
113 {
114 return HEXlattice<dim>::secondPhases(mat,lat,pnc);
115 }
116 else if(mat.crystalStructure=="CubicFluorite")
117 {
118 return CubicFluoriteCrystal<dim>::secondPhases(mat,lat,pnc);
119 }
120 else
121 {
122 throw std::runtime_error("SingleCrystalSelector::secondPhases: unknown crystal structure "+mat.crystalStructure);
124 }
125}
126
127template<int dim>
136
137template<int dim>
142
143template<int dim>
148
149template<int dim>
154
155template<int dim>
156const GlidePlaneBase& SingleCrystalBase<dim>:: planeBase(const size_t& planeID) const
157{
158 return *planeNormals().at(planeID);
159}
160
161template<int dim>
162const SlipSystem& SingleCrystalBase<dim>:: slipSystem(const size_t& ssID) const
163{
164 return *slipSystems().at(ssID);
165}
166
167template<int dim>
169{
170 return *secondPhases().at(spID);
171}
172
173template struct SingleCrystalBase<3>;
174template struct SingleCrystalSelector<3>;
175
176}
177#endif
const MatrixDimD latticeBasis
SingleCrystalBase(const PolycrystallineMaterialBase &material, const MatrixDim &Q)
TypeTraits< SingleCrystalBase< dim > >::SlipSystemContainerType SlipSystemContainerType
TypeTraits< SingleCrystalBase< dim > >::PlaneNormalContainerType PlaneNormalContainerType
const PlaneNormalContainerType & planeNormals() const
const SecondPhase< dim > & secondPhase(const size_t &) const
TypeTraits< SingleCrystalBase< dim > >::LatticeType LatticeType
const SlipSystemContainerType & slipSystems() const
const SlipSystem & slipSystem(const size_t &) const
const GlidePlaneBase & planeBase(const size_t &) const
TypeTraits< SingleCrystalBase< dim > >::SecondPhaseContainerType SecondPhaseContainerType
TypeTraits< SingleCrystalBase< dim > >::MatrixDim MatrixDim
const SecondPhaseContainerType & secondPhases() const
static PlaneNormalContainerType planeNormals(const PolycrystallineMaterialBase &material, const LatticeType &lat)
static SlipSystemContainerType slipSystems(const PolycrystallineMaterialBase &material, const LatticeType &lat, const PlaneNormalContainerType &)
static MatrixDim latticeBasis(const PolycrystallineMaterialBase &material)
TypeTraits< SingleCrystalBase< dim > >::PlaneNormalContainerType PlaneNormalContainerType
static SecondPhaseContainerType secondPhases(const PolycrystallineMaterialBase &material, const LatticeType &lat, const PlaneNormalContainerType &)
TypeTraits< SingleCrystalBase< dim > >::MatrixDim MatrixDim
TypeTraits< SingleCrystalBase< dim > >::SecondPhaseContainerType SecondPhaseContainerType
TypeTraits< SingleCrystalBase< dim > >::LatticeType LatticeType
TypeTraits< SingleCrystalBase< dim > >::SlipSystemContainerType SlipSystemContainerType
Q