Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
SphericalInclusionIO.cpp
Go to the documentation of this file.
1/* This file is part of MoDELib, distributed under GNU GPL v2. */
4
5namespace model
6{
7
8 template <int dim>
13
14 template <int dim>
15 SphericalInclusionIO<dim>::SphericalInclusionIO(const size_t &inclusionID_in, const VectorDim &C_in,
16 const double &a_in, const MatrixDim &eT_in,
17 const double &mobilityReduction_in, const int &phaseID_in)
18 : inclusionID(inclusionID_in), C(C_in), a(a_in), eT(eT_in), mobilityReduction(mobilityReduction_in),
19 phaseID(phaseID_in)
20 {
21 }
22
23 template <int dim>
28
29 template <int dim>
31 : inclusionID(0), C(VectorDim::Zero()), a(0), eT(MatrixDim::Zero()), mobilityReduction(1.0), phaseID(0)
32 {
33 ss >> inclusionID;
34 for (int d = 0; d < dim; ++d)
35 {
36 ss >> C(d);
37 }
38 ss >> a;
39 for (int i = 0; i < dim; ++i)
40 {
41 for (int j = 0; j < dim; ++j)
42 {
43 double temp;
44 ss >> temp;
45 eT(i, j) = temp;
46 }
47 }
49 ss >> phaseID;
50 }
51
52 template <int dim> void SphericalInclusionIO<dim>::write(std::ostream &os) const
53 {
54 os << inclusionID
55 << "\t"
56 /**/
57 << std::setprecision(15) << std::scientific << C.transpose()
58 << "\t"
59 /**/
60 << std::setprecision(15) << std::scientific << a << "\t";
61 for (int d = 0; d < dim; ++d)
62 {
63 os << std::setprecision(15) << std::scientific << eT.row(d) << "\t";
64 }
65 os << std::setprecision(15) << std::scientific << mobilityReduction
66 << "\t"
67 /**/
68 << phaseID;
69 return;
70 }
71 template struct SphericalInclusionIO<3>;
72
73} // namespace model
void write(std::ostream &os) const
Eigen::Matrix< double, dim, 1 > VectorDim
Eigen::Matrix< double, dim, dim > MatrixDim
int j
newsubseg ss[0]
int i
vertex temp