Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
DislocationLoopIO.cpp
Go to the documentation of this file.
2#include <cfloat>
3
4namespace model
5{
6
7
8 template<short unsigned int dim>
9 DislocationLoopIO<dim>::DislocationLoopIO(const size_t& sID_in, // sID
10 const VectorDim& B_in, // position
11 const VectorDim& N_in, // velocity
12 const VectorDim& P_in, // velocity
13 const size_t& grainID_in,
14 const int& loopType_in
15 ) :
16 /* init */ sID(sID_in)
17 /* init */,B(B_in)
18 /* init */,N(N_in)
19 /* init */,P(P_in)
20 /* init */,grainID(grainID_in)
21 /* init */,loopType(loopType_in)
22 /* init */,loopLength(std::make_tuple(0.0,0.0,0.0,0.0))
23 /* init */,slippedArea(0.0)
24 {
25
26 }
27
28 template<short unsigned int dim>
30 /* init */ sID(0)
31 /* init */,B(VectorDim::Zero())
32 /* init */,N(VectorDim::Zero())
33 /* init */,P(VectorDim::Zero())
34 /* init */,grainID(0)
35 /* init */,loopType(0)
36 /* init */,loopLength(std::make_tuple(0.0,0.0,0.0,0.0))
37 /* init */,slippedArea(0.0)
38 {
39
40 }
41
42 template<short unsigned int dim>
44 /* init */ sID(0)
45 /* init */,B(VectorDim::Zero())
46 /* init */,N(VectorDim::Zero())
47 /* init */,P(VectorDim::Zero())
48 /* init */,grainID(0)
49 /* init */,loopType(0)
50 /* init */,loopLength(std::make_tuple(0.0,0.0,0.0,0.0))
51 /* init */,slippedArea(0.0)
52 {
53 ss>>sID;
54 for(int d=0;d<dim;++d)
55 {
56 ss>>B(d);
57 }
58 for(int d=0;d<dim;++d)
59 {
60 ss>>N(d);
61 }
62 for(int d=0;d<dim;++d)
63 {
64 ss>>P(d);
65 }
66 ss>>grainID;
67 ss>>loopType;
68 double l1,l2,l3,A;
69 ss>>l1>>l2>>l3>>A;
70 loopLength=std::make_tuple(l1,l2,l3,A);
72 }
73
74 template<short unsigned int dim>
75 std::ostream& DislocationLoopIO<dim>::write(std::ostream& os) const
76 {
77 const auto& ds=*this;
78 os << ds.sID<<"\t"
79 /**/<< std::setprecision(15)<<std::scientific<<ds.B.transpose()<<"\t"
80 /**/<< std::setprecision(15)<<std::scientific<<ds.N.transpose()<<"\t"
81 /**/<< std::setprecision(15)<<std::scientific<<ds.P.transpose()<<"\t"
82 /**/<< ds.grainID<<"\t"
83 /**/<< ds.loopType<<"\t"
84 /**/<< std::get<0>(ds.loopLength)<<"\t"<< std::get<1>(ds.loopLength)<<"\t"<< std::get<2>(ds.loopLength)<<"\t"<< std::get<3>(ds.loopLength)<<"\t"
85 /**/<< ds.slippedArea;
86 return os;
87
88 }
89
90 template struct DislocationLoopIO<3>;
91}
function infiniteDisplacement syms Ax Ay Az Bx By Bz qx qy qz u L x y z real A
Eigen::Matrix< double, dim, 1 > VectorDim
std::tuple< double, double, double, double > loopLength
std::ostream & write(std::ostream &os) const
newsubseg ss[0]