Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
src/InclusionMicrostructure/SphericalInclusion.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_SphericalInclusion_cpp_
9#define model_SphericalInclusion_cpp_
10
11
13
14namespace model
15{
16
17
18// template <int dim>
19// void SphericalInclusion<dim>::addSlipSystems(const std::vector<std::shared_ptr<SlipSystem>>& slipSystems)
20// {
21//
22// for(const auto& slipSystem : slipSystems)
23// {
24// if(gammaSurfaceMap.find(slipSystem->gammaSurface.get())==gammaSurfaceMap.end())
25// {// current slipSystem gammaSurface not found
26//
27// // GammaSurface temp();
28// //
29// // gammaSurfaceMap.emaplace(slipSystem->gammaSurface.get(),temp);
30// }
31// }
32//
33// }
34
35// template <int dim>
36// double SphericalInclusion<dim>::misfitEnergy(const Eigen::Matrix<double,3,1>& b, const GammaSurface* const matrixGammaSurface) const
37// {
38// const auto iter(gammaSurfaceMap.find(matrixGammaSurface));
39// return iter==gammaSurfaceMap.end()? 0.0 : iter->second(b);
40// }
41
42 /**********************************************************************/
43 template <int dim>
45 const double& _a,
46 const MatrixDim& _eT,
47 const double& _nu,
48 const double& _mu,
49 const double& _mobilityReduction,
50 const int& _phaseID,
51 const std::shared_ptr<SecondPhase<dim>>& sph) :
52 /* init */ EshelbyInclusionBase<dim>(_eT,_nu,_mu,_mobilityReduction,_phaseID,sph)
53 /* init */,L((5.0*this->nu-1.0)/15.0/(1.0-this->nu))
54 /* init */,M((4.0-5.0*this->nu)/15.0/(1.0-this->nu))
55 // /* init */,K((3.0*L+2.0*M)/3.0)
56 /* init */,C(_C)
57 /* init */,a(_a)
58 /* init */,a2(a*a)
59 {
60// std::cout<<"Creating SphericalInclusion "<<this->sID<<" (type "<<this->phaseID<<"):\n C="<<C.transpose()<<"\n a="<<a<<"\n eT="<<this->eT<<std::endl;
61 }
62
63 /**********************************************************************/
64 template <int dim>
65 bool SphericalInclusion<dim>::contains(const VectorDim& x) const
66 {
67 return (x-C).squaredNorm()<a2;
68 }
69
70 /**********************************************************************/
71 template <int dim>
72 typename SphericalInclusion<dim>::MatrixDim SphericalInclusion<dim>::stress(const VectorDim& x) const
73 {
74
75 if(this->eTNorm>FLT_EPSILON)
76 {
77 const VectorDim r(x-C);
78 const double R2(r.squaredNorm());
79 const double R(sqrt(R2));
80
81 if(R>a)
82 {
83 const double R3=std::pow(R,3);
84 const double R4=std::pow(R,4);
85 const double a2R2=std::pow(a,2)/R2;
86 const double a3R3=std::pow(a,3)/R3;
87
88 const VectorDim pTr=this->pT*r;
89 const double pTrr=pTr.dot(r);
90 const double pTt=this->pT.trace();
91 return a3R3/2.0/(1-this->nu)*( (10.0*(1.0-2.0*this->nu)+6.0*a2R2)/15.0*this->pT
92 +(2.0*this->nu-2.0*a2R2)/R2*(pTr*r.transpose()+r*pTr.transpose())
93 +((3.0*a2R2-5.0*(1.0-2.0*this->nu))/15.0*pTt + (1.0-2.0*this->nu-a2R2)/R2*pTrr)*MatrixDim::Identity()
94 +(-(5.0-7.0*a2R2)/R4*pTrr+(1.0-a2R2)/R2*pTt)*r*r.transpose()
95 );
96 }
97 else
98 {
99 return 2.0*this->mu*((L+this->nu/(1.0-2.0*this->nu)*(2.0*M+3.0*L))*this->eT.trace()*MatrixDim::Identity()+2.0*M*this->eT)-this->pT;
100 }
101 }
102 else
103 {
104 return MatrixDim::Zero();
105 }
106 }
107
108 template class SphericalInclusion<3>;
109
110}
111#endif
EshelbyInclusionBase(const MatrixDim &_eT, const double &_nu, const double &_mu, const double &_mobilityReduction, const int &_phaseID, const std::shared_ptr< SecondPhase< dim > > &sph)
SphericalInclusion(const VectorDim &_C, const double &_a, const MatrixDim &_eT, const double &_nu, const double &_mu, const double &_mobilityReduction, const int &_phaseID, const std::shared_ptr< SecondPhase< dim > > &sph)
bool contains(const VectorDim &x) const override
MatrixDim stress(const VectorDim &x) const override
x
Definition int_R.m:12