Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
VTKGenerator.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_VTKGenerator_cpp_
9#define model_VTKGenerator_cpp_
10
11#include <numbers>
12#include <chrono>
13#include <random>
14#include <cmath>
15#include <list>
16#include <assert.h>
17#include <Eigen/LU>
18#include <Eigen/Cholesky>
19#include <limits>
20
21//#include <Simplex.h>
22#include <SimplicialMesh.h>
23#include <Polycrystal.h>
25#include <LatticeModule.h>
26//#include <PlaneMeshIntersection.h>
33
35#include <TextFileParser.h>
37#include <MeshBoundarySegment.h>
38//#include <ConfinedDislocationObject.h>
39#include <GlidePlaneModule.h>
40#include <MeshModule.h>
41#include <Plane.h>
43#include <VTKGenerator.h>
45
46namespace model
47{
48
49 VTKGenerator::VTKGenerator(const std::string& fileName) :
50 /* init */ MicrostructureGeneratorBase(fileName)
51 {
52
53 }
54
56 {
57 throw std::runtime_error("VTKGenerator only works for single entities.");
58 }
59
61 {
62 const std::string vtkRelFile(this->parser.readString("vtkFile",false));
63 const std::string vtkFile(std::filesystem::path(this->microstructureFileName).parent_path().string()+"/"+vtkRelFile);
64
65 std::cout<<magentaBoldColor<<"Generating VTK microstructure from "<<vtkFile<<defaultColor<<std::endl;
66
67 const std::string dislocationType(this->parser.readString("dislocationType",false));
68
69 if(dislocationType=="loop")
70 {
71
72
73// mg.insertJunctionLoop(loopNodePos,glidePlane,
74// slipSystem.s.cartesian(),glidePlane->referencePlane->unitNormal,
75// glidePlane->referencePlane->snapToPlane(P0),grainID,DislocationLoopIO<dim>::GLISSILELOOP);
76
77
78 }
79// else if(dislocationType=="dipole")
80// {
81//
82// }
83 else
84 {
85 throw std::runtime_error("Unknown type "+dislocationType);
86 }
87
88 }
89
90}
91#endif
void generateDensity(MicrostructureGenerator &mg) override
void generateIndividual(MicrostructureGenerator &mg) override
VTKGenerator(const std::string &fileName)
static std::string defaultColor
static std::string magentaBoldColor