Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
StackingFaultTetrahedraIndividualSpecification.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_StackingFaultTetrahedraIndividualSpecification_cpp_
9#define model_StackingFaultTetrahedraIndividualSpecification_cpp_
10
12
13namespace model
14{
20
22 /* init */ MicrostructureSpecificationBase("StackingFaultTetrahedra","Individual",fileName)
23 /* init */,planeIDs(this->parser->readArray<int>("planeIDs",true))
24 /* init */,areInverted(this->parser->readArray<int>("areInverted",true))
25 /* init */,sizes(this->parser->readArray<double>("sizes",true))
26 /* init */,basePoints(this->parser->readMatrix<double>("basePoints",planeIDs.size(),3,true))
27 {
28 if(int(planeIDs.size())!=basePoints.rows())
29 {
30 std::cout<<"planeIDs.size()="<<planeIDs.size()<<std::endl;
31 std::cout<<"basePoints.rows()="<<basePoints.rows()<<std::endl;
32 throw std::runtime_error("You must provide one point for each SFT. Each point is a row of the matrix basePoints.");
33 }
34
35 if(planeIDs.size()!=sizes.size())
36 {
37 std::cout<<"planeIDs.size()="<<planeIDs.size()<<std::endl;
38 std::cout<<"sizes.size()="<<sizes.size()<<std::endl;
39 throw std::runtime_error("You must provide one size for each SFT. Each size is an element of the vector sizes.");
40 }
41
42 if(planeIDs.size()!=areInverted.size())
43 {
44 std::cout<<"planeIDs.size()="<<planeIDs.size()<<std::endl;
45 std::cout<<"areInverted()="<<sizes.size()<<std::endl;
46 throw std::runtime_error("You must provide one boolean value of areInverted for each SFT. Each value is an element of the vector areInverted.");
47 }
48 }
49}
50#endif
const std::unique_ptr< TextFileParser > parser
MicrostructureSpecificationBase(const std::string &type_in, const std::string &style_in)