Mechanics of Defect Evolution Library
Loading...
Searching...
No Matches
VTKsegments.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_VTKsegments_cpp_
9#define model_VTKsegments_cpp_
10
11
12#include <VTKsegments.h>
13
14namespace model
15{
16
17template <int dim>
18double getEwaldLength(const std::vector<Eigen::Matrix<double,dim,1>>& periodicBasis,const double& EwaldLengthFactor)
19{
20
21 if(periodicBasis.size())
22 {
23 // Compute generalized volume of periodic lattice cell
24 Eigen::MatrixXd B(Eigen::MatrixXd::Zero(3,periodicBasis.size()));
25 for(size_t k=0;k<periodicBasis.size();++k)
26 {
27 B.col(k)=periodicBasis[k];
28 }
29 const double vol(sqrt((B.transpose()*B).determinant())/CTM::factorial(periodicBasis.size()));
30// std::cout<<"vol="<<vol<<std::endl;
31// std::cout<<"edge="<<std::pow(vol,1.0/periodicBasis.size())<<std::endl;
32// std::cout<<"elength="<<EwaldLengthFactor*std::pow(vol,1.0/periodicBasis.size())<<std::endl;
33 return EwaldLengthFactor*std::pow(vol,1.0/periodicBasis.size());
34 }
35 else
36 {
37 return 0.0;
38 }
39}
40
41 VTKsegments::VTKsegments(const std::string& folderName) :
43 /* init */ perser(folderName+"/inputFiles/vtkSegments.txt")
44 /* init */,material(perser.readString("materialFile",true),perser.readScalar<double>("absoluteTemperature",true))
45 /* init */,quadPerLength(perser.readScalar<double>("quadPerLength",true))
46 /* init */,externalStress(perser.readMatrix<double>("ExternalStress0",3,3,true))
47 /* init */,stochasticForceGenerator(nullptr)
48 /* init */,C2G(perser.readMatrix<double>("C2G",3,3,true))
49 {
50
51 }
52
53// typename VTKsegments::VectorDimI VTKsegments::getPbcFlags(const std::string& filename) const
54// {
55//
56// }
57
58
59 const std::vector<DislocationQuadraturePoint<3,0>>& VTKsegments::quadraturePoints() const
60 {
61 return *this;
62 }
63
64 std::vector<DislocationQuadraturePoint<3,0>>& VTKsegments::quadraturePoints()
65 {
66 return *this;
67 }
68
69 // const std::vector<StressStraight<3>>& VTKsegments::segments() const
70 // {
71 // return *this;
72 // }
73
74 // std::vector<StressStraight<3>>& VTKsegments::segments()
75 // {
76 // return *this;
77 // }
78
79
80 const std::map<std::pair<int,int>,StressStraight<3>> &VTKsegments::segments() const
81 {
82 return *this;
83 }
84
85 std::map<std::pair<int,int>,StressStraight<3>> &VTKsegments::segments()
86 {
87 return *this;
88 }
89
90 // const std::vector<typename VTKsegments::VectorDim>& VTKsegments::nodes() const
91 // {
92 // return *this;
93 // }
94
95 const std::deque<typename VTKsegments::VectorDim> &VTKsegments::nodes() const
96 {
97 return *this;
98 }
99
100
101 std::deque<typename VTKsegments::VectorDim> &VTKsegments::nodes()
102 {
103 return *this;
104 }
105
107{
108 if(material.crystalStructure=="BCC")
109 {
110 return 2.0*material.b_SI/sqrt(3.0);
111 }
112 else if(material.crystalStructure=="FCC")
113 {
114 return 2.0*material.b_SI/sqrt(2.0);
115 }
116 else
117 {
118 std::cout<<"Unknown lattice parameter for "<<material.crystalStructure<<"'. Exiting."<<std::endl;
119 exit(EXIT_FAILURE);
120 return 0.0;
121 }
122}
123
124// std::vector<typename VTKsegments::VectorDim>& VTKsegments::nodes()
125// {
126// return *this;
127// }
128
129
130 void VTKsegments::writeVTK(const std::string& vtkFilePrefix,std::map<std::pair<int,int>,std::pair<size_t,std::set<int>>> &segIDmap) const
131 {
132 const std::string quadFileName(vtkFilePrefix+"_quadrature.vtk");
133 std::ofstream quadFile(quadFileName);
134 quadFile<<"# vtk DataFile Version 3.0\n";
135 quadFile<<"# Dislocation lines converted from MoDELib file\n";
136 quadFile<<"ASCII\n";
137 quadFile<<"DATASET UNSTRUCTURED_GRID\n";
138 quadFile<<"POINTS "+std::to_string(quadraturePoints().size()+nodes().size())+" double\n";
139
140 for(const auto& node : nodes())
141 {// write all nodes positions
142 quadFile<<std::setprecision(15)<<std::scientific<<node.transpose()*material.b_SI*1.0e10<<"\n";
143 }
144
145 for(const auto& qp : quadraturePoints())
146 {// write all nodes positions
147 quadFile<<std::setprecision(15)<<std::scientific<<qp.r.transpose()*material.b_SI*1.0e10<<"\n";
148 }
149
150 // Create map of quadraturePoints by segments
151 std::map<std::pair<size_t,size_t>,std::set<size_t>> qPointMap;
152 for(size_t q=0;q<quadraturePoints().size();++q)
153 {
154 const auto& qp(quadraturePoints()[q]);
155 const std::pair<size_t,size_t> key(std::make_pair(qp.sourceID,qp.sinkID));
156 qPointMap[key].insert(q);
157 }
158
159 if(qPointMap.size()!=segments().size())
160 {
161 std::cout<<"qPointMap.size()="<<qPointMap.size()<<std::endl;
162 std::cout<<"segments().size()="<<segments().size()<<std::endl;
163 throw std::runtime_error("qPointMap.size()!=segments().size()");
164 }
165
166 quadFile<<"\nCELLS "+std::to_string(qPointMap.size())+" "+std::to_string(quadraturePoints().size()+3*qPointMap.size())+"\n";
167 for(const auto& pair : qPointMap)
168 {
169 quadFile<<pair.second.size()+2<<" "<<pair.first.first<<" ";
170 for(const auto& q : pair.second)
171 {
172 quadFile<<q+nodes().size()<<" ";
173 }
174 quadFile<<pair.first.second<<"\n";
175 }
176
177 quadFile << "\nCELL_TYPES " + std::to_string(segments().size()) + "\n";
178 for (const auto &pair : qPointMap)
179 {
180 quadFile << 4 << "\n";
181 }
182 quadFile << "\nPOINT_DATA " + std::to_string(quadraturePoints().size() + nodes().size()) + "\n";
183 quadFile << "VECTORS PK_force double\n";
184 for (const auto &node : nodes())
185 {
186 quadFile << std::setprecision(15) << std::scientific << Eigen::Matrix<double, 1, 3>::Zero() << "\n";
187 }
188 for (const auto &outerPair : qPointMap)
189 {
190 for (const auto &innerPair : outerPair.second)
191 {
192 const auto &qp(quadraturePoints()[innerPair]);
193 quadFile << std::setprecision(15) << std::scientific << qp.pkForce.transpose() * material.b_SI * material.mu_SI * 10.0 / 160.21766208 << "\n";
194 //quadFile << std::setprecision(15) << std::scientific << qp.pkForce.transpose() << "\n";
195 }
196 }
197 quadFile << "\nTENSORS stress double\n";
198
199 for (const auto &node : nodes())
200 {
201 quadFile << std::setprecision(15) << Eigen::Matrix<double, 3, 3>::Zero() << "\n\n";
202 }
203
204 for (const auto &outerPair : qPointMap)
205 {
206 for (const auto &innerPair : outerPair.second)
207 {
208 const auto &qp(quadraturePoints()[innerPair]);
209 quadFile << std::setprecision(15) << std::scientific << qp.stress * material.mu_SI * 1e-9 << "\n\n";
210 }
211 }
212 quadFile << "\nCELL_DATA " + std::to_string(qPointMap.size()) + "\n";
213 quadFile << "SCALARS dislocation_index int\n";
214 quadFile << "LOOKUP_TABLE default\n";
215 for (size_t k = 0; k < qPointMap.size(); ++k)
216 {
217 quadFile << k << "\n"; // not sure if this is the right number to write
218 }
219 //NEED TO ENABLE THIS SECTION
220 quadFile << "\nVECTORS burgers_vector_global double\n";
221
222 for (const auto &pair : segIDmap)
223 {
224
225 const auto segID = pair.first;
226 const auto &seg(segments().at(segID));
227 std::cout<<"SegID: "<<segID.first<<"-> "<<segID.second <<"-> seg.b: "<<seg.b.transpose() * material.b_SI * 1.0e10<<std::endl;
228 quadFile << seg.b.transpose() * material.b_SI * 1.0e10 << "\n";
229 }
230
231 quadFile << "\nVECTORS burgers_vector_local double\n";
232 const auto G2C(C2G.inverse());
233 std::cout<<"C2G: "<<C2G<<std::endl;
234 std::cout<<"G2C: "<<G2C<<std::endl;
235
236 for (const auto &pair : segIDmap)
237 {
238
239 const auto segID = pair.first;
240 const auto &seg(segments().at(segID));
241
242 quadFile << (G2C * seg.b).transpose() * material.b_SI / latticeParameter() << "\n";
243
244 }
245
246
247 }
248
250 {
251 const auto externalStress=perser.readMatrix<double>("externalStress",3,3,true);
252 }
253
254 void VTKsegments::readCAFile(const std::string& vtkFilePrefix)
255 {
256 VectorDimI pbcFlags;
257 const std::string caFileName(vtkFilePrefix+".ca");
258 std::ifstream caFile(caFileName); //access vtk file
259
260
261
262 if(caFile.is_open())
263 {
264
265 std::string line;
266 while (std::getline(caFile, line)) //begin parsing vtk file for lines
267 {
268 if(line.find("SIMULATION_CELL_MATRIX")!=std::string::npos) //if POINTS is read, read npos
269 {
270 for(int d=0;d<dim;++d)
271 {
272 std::getline(caFile, line);
273 std::stringstream ss(line);//store lines of vtk file in ss
274 ss>>cellMatrix(d,0)>>cellMatrix(d,1)>>cellMatrix(d,2);//store nodal positions to x,y,z
275 }
276 std::cout<<"SIMULATION_CELL_MATRIX=\n"<<cellMatrix<<std::endl;
277
278 std::vector<Eigen::Matrix<double,dim,1>> cellVectors;
279 for(int d=0;d<3;++d)
280 {
281 cellVectors.emplace_back(cellMatrix.row(d)*1.0e-10/material.b_SI);
282 }
283 EwaldLength=getEwaldLength(cellVectors,perser.readScalar<double>("EwaldLengthFactor",true));
284 std::cout<<"Ewald Length"<<std::endl;
285 std::cout<<EwaldLength<<std::endl;
286 }
287
288 if(line.find("PBC_FLAGS")!=std::string::npos) //if POINTS is read, read npos
289 {
290 std::string temp;
291 std::stringstream ss(line);//store lines of vtk file in ss
292 ss>>temp;
293 ss>>pbcFlags(0)>>pbcFlags(1)>>pbcFlags(2);
294 std::cout<<"PBC_FLAGS="<<pbcFlags.transpose()<<std::endl;
295
296 }
297
298 }
299
300 periodicShifts.clear();
301 for(int i=-pbcFlags(0);i<pbcFlags(0)+1;++i)
302 {
303 for(int j=-pbcFlags(1);j<pbcFlags(1)+1;++j)
304 {
305 for(int k=-pbcFlags(2);k<pbcFlags(2)+1;++k)
306 {
307 periodicShifts.push_back( i*cellMatrix.row(0)*1.0e-10/material.b_SI
308 +j*cellMatrix.row(1)*1.0e-10/material.b_SI
309 +k*cellMatrix.row(2)*1.0e-10/material.b_SI);
310 }
311 }
312 }
313 std::cout<<"periodicShifts.size()="<<periodicShifts.size()<<std::endl;
314
315 //prints PBCvectors
316 std::cout<<"PBCvectors"<<std::endl;
317 for (const auto& matrix : periodicShifts)
318 {
319 std::cout << matrix << std::endl;
320 }
321
322 }
323 else
324 {
325 throw std::runtime_error("Cannot open file "+ caFileName);
326 }
327
328 }
329
330
331 void VTKsegments::updateQuadraturePoints(const std::string& vtkFilePrefix, MatrixDim externalStress, std::map<std::pair<int,int>,std::pair<size_t,std::set<int>>> &segIDmap )
332 {
333
334
335
336
337
338
339 #ifdef _OPENMP
340 const size_t nThreads = omp_get_max_threads();
341 #else
342 const size_t nThreads = 1;
343 #endif
344 std::cout <<"updating QuadraturePoints (" << nThreads << " threads) " << std::flush;
345 const auto t0= std::chrono::system_clock::now();
346
347 #ifdef _OPENMP
348 #pragma omp parallel for
349 #endif
350 for(size_t q=0;q<quadraturePoints().size();++q)
351 {
352 auto& qPoint(quadraturePoints()[q]);
353 for(const auto& seg : segments())
354 {
355 for(const auto& shift : periodicShifts)
356 {
357 qPoint.stress+=seg.second.stress(qPoint.r+shift);
358 }
359 }
360 }
361 for (size_t q = 0; q < quadraturePoints().size(); ++q)
362 {
363 auto &qPoint(quadraturePoints()[q]);
364 qPoint.stress += externalStress;
365 }
366
367 for (const auto &pair : segIDmap)
368 {
369 const auto segID = pair.first;
370 const auto &seg(segments().at(segID));
371 for (const auto &qID : pair.second.second)
372 {
373 auto &qPoint(quadraturePoints()[qID]);
374 qPoint.pkForce = (qPoint.stress * seg.b).cross(qPoint.rl);
375 }
376 }
377
378 std::cout<<magentaColor<<std::setprecision(3)<<std::scientific<<" ["<<(std::chrono::duration<double>(std::chrono::system_clock::now()-t0)).count()<<" sec]."<<defaultColor<<std::endl;
379
380 writeVTK(vtkFilePrefix,segIDmap);
381 }
382
383 void VTKsegments::readVTK(const std::string& vtkFilePrefix)
384 {
385 nodes().clear();
386 segments().clear();
387 quadraturePoints().clear();
388
389 const std::string vtkFileName(vtkFilePrefix+".vtk");
390 std::ifstream vtkFile(vtkFileName); //access vtk file
391 std::map<std::pair<int,int>, std::pair<size_t,std::set<int>>> segIDmap; // key= [segID] value=[cellID, set of qID's]
392
393
394 readCAFile(vtkFilePrefix);
395
396 if(vtkFile.is_open())
397 {
398// std::vector<VectorDim> rawPoints;
399 std::vector<std::vector<size_t>> cells;
400 std::vector<VectorDim> rawBurgers;
401 const auto sfCoeffs(SplineSegmentBase<3,0>::sfCoeffs(0.0)); // shape function coefficients for linear segments
402
403 int loopsSize(0);
404 std::vector<VectorDim> nAVector;
405 std::string line;
406
407
408 while (std::getline(vtkFile, line)) //begin parsing vtk file for lines
409 {
410 if(line.find("POINTS")!=std::string::npos) //if POINTS is read, read npos
411 {
412 const size_t firstSpace(line.find(' ')); //vtk file formatting const
413 const size_t secondSpace(line.find(' ',firstSpace+1)); //vtk file formatting const
414
415 if(secondSpace>firstSpace) // if the line indentation is longer...
416 {
417 const size_t nodesSize(std::atoi(line.substr(firstSpace+1,secondSpace-firstSpace-1).c_str())); //read the number of nodes
418
419 std::cout<<"Reading "<<nodesSize<<" nodes"<<std::endl; //print the number of nodes
420
421 double x,y,z; //create doubles to store node positions
422
423 for(size_t n=0;n<nodesSize;++n) //index over all nodes
424 {
425 std::getline(vtkFile, line); //access lines of vtk file
426 std::stringstream ss(line);//store lines of vtk file in ss
427 ss>>x>>y>>z;//store nodal positions to x,y,z
428 nodes().push_back((VectorDim()<<x,y,z).finished()*1.0e-10/material.b_SI);//construct nodes() [<x_1,x_2,x_3>,loopNo]
429 }
430 }
431 else
432 {//POINTS was not read
433 throw std::runtime_error("Unable to extract number of nodes from line: "+line);
434 }
435 }
436
437 if(line.find("CELLS")!=std::string::npos) //if CELLS is read, read npos
438 {
439 const size_t firstSpace(line.find(' ')); //vtk file formatting const
440 const size_t secondSpace(line.find(' ',firstSpace+1)); //vtk file formatting const
441
442 if(secondSpace>firstSpace) // if the line indentation is longer...
443 {
444
445 loopsSize=std::atoi(line.substr(firstSpace+1,secondSpace-firstSpace-1).c_str()); //read the total number of loops loopsSize
446
447 std::cout<<"Reading "<<loopsSize<<" cells"<<std::endl; // print the total number of loops
448 // cells.emplace_back();
449 for(int n=0;n<loopsSize;++n) // index over the number of loops
450 {
451 std::getline(vtkFile, line); // read the contents of cells
452 std::stringstream ss(line); // store the contents of cells in ss
453 cells.emplace_back(); //populate cells
454 int temp; //creante int temp
455 int count =0; //create a count initialized at 0
456
457 while (ss >> temp) // while the nodal index is less than temp...
458 {
459 if(count==0) //if count = 0
460 {
461 count++; // increase count by 1
462 continue; //rerun the loop
463 }
464 cells.back().push_back(temp); //populate cells wih node connections <node pts, Burgers vector>
465 }
466 }
467 }
468 else
469 {//CELLS was not read
470 throw std::runtime_error("Unable to extract number of loops from line: "+line);
471 }
472 }
473
474
475 if(line.find("burgers_vector_world")!=std::string::npos) //if burgers_vector_world is read, read npos
476 {
477 double x,y,z; //initialize x,y,z, for burgers vector components
478
479 for(int n=0;n<loopsSize;++n) //index over the number of loops
480 {
481 std::getline(vtkFile, line);//read the contents of burgers_vector_world
482 std::stringstream ss(line);// store the contents of burgers_vector_world in ss
483 ss>>x>>y>>z;// pass ss to x,y,z
484 rawBurgers.push_back((VectorDim()<<x,y,z).finished()*1.0e-10/material.b_SI);
485 }
486 }
487 }
488
489 if(rawBurgers.size()==cells.size())
490 {
491
492 for (size_t k = 0; k < cells.size(); ++k)
493 {
494 const auto Burgers(rawBurgers[k]);
495 VectorDim nA(VectorDim::Zero()); // right-handed loop normal
496 const VectorDim P0(nodes()[0]); //sample point P0 from vtk file
497
498
499 for(int n=0;n<cells[k].size();++n)//index over all nodes
500 {
501 const int n1(n<cells[k].size()-1? n+1 : 0);//index k1 to be one less than the current node number
502
503 //std::cout<<"k1= "<<k1<<std::endl;// print the value of k1
504
505 const size_t sourceID(cells[k][n]);
506 const size_t sinkID(cells[k][n1]);
507 const VectorDim &sourceP(nodes()[sourceID]);
508 const VectorDim &sinkP(nodes()[sinkID]);
509 //std::cout<<"sourcePos->sinkPos: "<<sourcePos<<" -> "<<sinkPos<<std::endl;
510
511 const double linkNorm((sinkP-sourceP).norm());//returns the normal to the connection
512
513
514 nA+=0.5*(sourceP-P0).cross(sinkP-sourceP);//modify the right handed loop normal
515 }
516
517 nAVector.push_back(nA.normalized()); //normalize the right handed loop normal
518
519 for (size_t n = 0; n < cells[k].size() - 1; ++n)
520 {
521 const size_t sourceID(cells[k][n]);
522 const size_t sinkID(cells[k][n + 1]);
523
524
525 if (sinkID>sourceID)
526 {
527 const VectorDim &sourceP(nodes()[sourceID]);
528 const VectorDim &sinkP(nodes()[sinkID]);
529 const std::pair<int,int> sourceSink=std::make_pair(sourceID,sinkID);
530
531 // std::cout<<"Ewald1"<<std::endl;
532 // std::cout<<EwaldLength<<std::endl;
533
534 const std::pair<std::pair<int,int>,StressStraight<3>> temp=std::make_pair(sourceSink,StressStraight<3>(material, sourceP, sinkP, Burgers, EwaldLength));
535 segments().insert(temp
536 //std::piecewise_construct,
537 //std::make_tuple(sourceID,sinkID),
538 //std::make_tuple(material, sourceP, sinkP, Burgers)
539 );
540
541
542 // segments().emplace(std::piecewise_construct,
543 // std::make_tuple(sourceID,sinkID),
544 // std::make_tuple(material, sourceP, sinkP, Burgers, EwaldLength)
545 // );
546
547 // const VectorDim chord(sinkP - sourceP);
548 // const double chordLength(chord.norm());
549 // const int qOrder = QuadratureDynamicType::lowerOrder(quadPerLength * chordLength);
550 // const MatrixNcoeffDim dofs((MatrixNcoeffDim() << sourceP.transpose(), sinkP.transpose()).finished());
551
552 // for (int q = 0; q < qOrder; ++q)
553 // {
554
555 // quadraturePoints().emplace_back(sourceID, sinkID, q, qOrder, sfCoeffs, dofs);
556
557 segIDmap[std::make_pair(sourceID,sinkID)].first=k;
558 // segIDmap[std::make_pair(sourceID,sinkID)].second.insert(quadraturePoints().size() - 1);
559 // // segIDmap[std::pair(k,std::make_pair(sourceID,sinkID))].insert(quadraturePoints().size() - 1);
560 // }
561
562 }
563 else
564 {
565 const VectorDim &sourceP(nodes()[sinkID]);
566 const VectorDim &sinkP(nodes()[sourceID]);
567 const std::pair<int,int> sourceSink=std::make_pair(sinkID,sourceID);
568 // std::cout<<"Ewald2"<<std::endl;
569 // std::cout<<EwaldLength<<std::endl;
570
571 const std::pair<std::pair<int,int>,StressStraight<3>> temp=std::make_pair(sourceSink,StressStraight<3>(material, sourceP, sinkP, -Burgers, EwaldLength));
572 segments().insert(temp
573 //std::piecewise_construct,
574 //std::make_tuple(sinkID,sourceID),
575 //std::make_tuple(material, sourceP, sinkP, -Burgers)
576 );
577
578
579
580 // segments().emplace(std::piecewise_construct,
581 // std::make_tuple(sinkID,sourceID),
582 // std::make_tuple(material, sourceP, sinkP, -Burgers, EwaldLength)
583 // );
584
585 segIDmap[std::make_pair(sinkID,sourceID)].first=k;
586
587 }
588 //const std::pair<int,int> key=std::make_pair(std::min(sourceID,sinkID),std::max(sourceID,sinkID));
589
590
591 //segments().emplace_back(material, sourceP, sinkP, Burgers);
592
593 }
594 }
595 for (const auto& seg : segments())
596 {
597 const double chordLength(seg.second.length);
598 const int sourceID=seg.first.first;
599 const int sinkID=seg.first.second;
600 const VectorDim sourceP=seg.second.P0;
601 const VectorDim sinkP=seg.second.P1;
602 const int qOrder = QuadratureDynamicType::lowerOrder(quadPerLength * chordLength);
603 const MatrixNcoeffDim dofs((MatrixNcoeffDim() << sourceP.transpose(), sinkP.transpose()).finished());
604
605 for (int q = 0; q < qOrder; ++q)
606 {
607
608 quadraturePoints().emplace_back(sourceID, sinkID, q, qOrder, sfCoeffs, dofs);
609
610 //segIDmap[std::make_pair(sourceID,sinkID)].first=k;
611 segIDmap[std::make_pair(sourceID,sinkID)].second.insert(quadraturePoints().size() - 1);
612 //segIDmap[std::pair(k,std::make_pair(sinkID,sourceID))].insert(quadraturePoints().size() - 1);
613 }
614 }
615
616 std::cout << "segments().size()=" << segments().size() << std::endl;
617 std::cout << "quadraturePoints().size()=" << quadraturePoints().size() << std::endl;
618 }
619 else
620 {
621 std::cout << "rawBurgers.size()=" << rawBurgers.size() << std::endl;
622 std::cout << "cells.size()=" << cells.size() << std::endl;
623 throw std::runtime_error("rawBurgers.size() NOT EQUAL TO cells.size()");
624 }
625
626 }
627 else
628 {
629 std::cout<<"Cannot open "<<vtkFileName<<std::endl;
630 }
631
632 updateQuadraturePoints(vtkFilePrefix, externalStress, segIDmap);
633
634 }
635
636}
637#endif
const std::vector< DislocationQuadraturePoint< 3, 0 > > & quadraturePoints() const
TextFileParser perser
Definition VTKsegments.h:81
double latticeParameter() const
const PolycrystallineMaterialBase material
Definition VTKsegments.h:82
MatrixDim externalStress
Definition VTKsegments.h:86
const std::deque< VectorDim > & nodes() const
VTKsegments(const std::string &folderName)
const std::map< std::pair< int, int >, StressStraight< 3 > > & segments() const
const MatrixDim C2G
Definition VTKsegments.h:85
std::shared_ptr< StochasticForceGenerator > stochasticForceGenerator
Definition VTKsegments.h:87
void writeVTK(const std::string &vtkFilePrefix, std::map< std::pair< int, int >, std::pair< size_t, std::set< int > > > &segIDmap) const
void readVTK(const std::string &vtkFilePrefix)
const double quadPerLength
Definition VTKsegments.h:83
initial point of the source segment B
the magnitude of the R vector q
id z()
x
Definition int_R.m:12
line(ax, points, color=BLUE, dashed=False, z=4)
size_t InstanceCount< Derived >::count
static std::string magentaColor
static std::string defaultColor
double getEwaldLength(const std::vector< Eigen::Matrix< double, dim, 1 > > &periodicBasis, const double &EwaldLengthFactor)
Eigen::Matrix< double, 3, 1 > VectorDim
Definition pyMoDELib.cxx:66
static constexpr int factorial(int n)
Definition CTM.h:26
Eigen::MatrixXd matrix(const Form &form)
int j
REAL t0
newsubseg ss[0]
int k
int i
newbad key
int e
vertex temp