Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
DislocationLoopNodeIO.cpp
Go to the documentation of this file.
2#include <cfloat>
3
4namespace model
5{
6
7
8 template<short unsigned int dim>
10 const size_t& loopID_in,
11 const VectorDim& P_in, // position
12 const size_t& nnID,
13 const VectorDim& shift,
14 const std::pair<short int,short int>& edgeID_in) :
15 /* init */ loopID(loopID_in),
16 /* init */ sID(sID_in),
17 /* init */ P(P_in),
18 /* init */ networkNodeID(nnID),
19 /* init */ periodicShift(shift),
20 /* init */ edgeIDs(edgeID_in)
21 {// Constructor for MicrostructureGenerator
22 }
23
24 template<short unsigned int dim>
26 /* init */ loopID(0),
27 /* init */ sID(0),
28 /* init */ P(VectorDim::Zero()),
29 /* init */ networkNodeID(0),
30 /* init */ periodicShift(VectorDim::Zero()),
31 /* init */ edgeIDs(std::make_pair((short int) -1,(short int) -1))
32 {
33 }
34
35 template<short unsigned int dim>
37 /* init */ loopID(0),
38 /* init */ sID(0),
39 /* init */ P(VectorDim::Zero()),
40 /* init */ networkNodeID(0),
41 /* init */ periodicShift(VectorDim::Zero()),
42 /* init */ edgeIDs(std::make_pair((short int)-1,(short int)-1))
43 {
44 ss>>loopID;
45 ss>>sID;
46 for(int d=0;d<dim;++d)
47 {
48 ss>>P(d);
49 }
51 for(int d=0;d<dim;++d)
52 {
53 ss>>periodicShift(d);
54 }
55 ss>>edgeIDs.first;
56 ss>>edgeIDs.second;
57 }
58
59 template<short unsigned int dim>
60 std::ostream& DislocationLoopNodeIO<dim>::write(std::ostream& os) const
61 {
62 const auto& ds=*this;
63 os << ds.loopID<<"\t"
64 /**/<< ds.sID<<"\t"
65 /**/<< std::setprecision(15)<<std::scientific<<ds.P.transpose()<<"\t"
66 /**/<< ds.networkNodeID<<"\t"
67 /**/<< std::setprecision(15)<<std::scientific<<ds.periodicShift.transpose()<<"\t"
68 /**/<< ds.edgeIDs.first<<"\t"
69 /**/<< ds.edgeIDs.second<<"\t";
70 return os;
71
72 }
73
74 template struct DislocationLoopNodeIO<3>;
75}
std::pair< short int, short int > edgeIDs
Eigen::Matrix< double, dim, 1 > VectorDim
std::ostream & write(std::ostream &os) const
newsubseg ss[0]