36 #ifndef CMGUIWRITER_HPP_
37 #define CMGUIWRITER_HPP_
39 #include "AbstractTetrahedralMeshWriter.hpp"
40 #include "OutputFileHandler.hpp"
45 static const char CmguiNodeFileHeader3D[] =
" #Fields=1\n\
46 1) coordinates, coordinate, rectangular cartesian, #Components=3\n\
47 x. Value index= 1, #Derivatives= 0\n\
48 y. Value index= 2, #Derivatives= 0\n\
49 z. Value index= 3, #Derivatives= 0\n";
54 static const char CmguiNodeFileHeader2D[] =
" #Fields=1\n\
55 1) coordinates, coordinate, rectangular cartesian, #Components=2\n\
56 x. Value index= 1, #Derivatives= 0\n\
57 y. Value index= 2, #Derivatives= 0\n";
63 static const char CmguiNodeFileHeader1D[] =
" #Fields=1\n\
64 1) coordinates, coordinate, rectangular cartesian, #Components=1\n\
65 x. Value index= 1, #Derivatives= 0\n";
70 static const char CmguiElementFileHeader3D[] =
"Shape. Dimension=3, simplex(2;3)*simplex*simplex\n\
71 #Scale factor sets= 0\n\
77 static const char CmguiElementFileHeader3DQuadratic[] =
"Shape. Dimension=3, simplex(2;3)*simplex*simplex\n\
78 #Scale factor sets= 0\n\
85 static const char CmguiElementFileHeader2D[] =
"Shape. Dimension=2, simplex(2)*simplex\n\
86 #Scale factor sets= 0\n\
92 static const char CmguiElementFileHeader2DQuadratic[] =
"Shape. Dimension=2, simplex(2)*simplex\n\
93 #Scale factor sets= 0\n\
99 static const char CmguiElementFileHeader1D[] =
"Shape. Dimension=1, line\n\
100 #Scale factor sets= 0\n\
106 static const char CmguiElementFileHeader1DQuadratic[] =
"Shape. Dimension=1, line\n\
107 #Scale factor sets= 0\n\
114 static const char CmguiCoordinatesFileHeader3D[] =
" 1) coordinates, coordinate, rectangular cartesian, #Components=3\n\
115 x. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.\n\
119 Scale factor indices: 1\n\
122 Scale factor indices: 2\n\
125 Scale factor indices: 3\n\
128 Scale factor indices: 4\n\
129 y. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.\n\
133 Scale factor indices: 1\n\
136 Scale factor indices: 2\n\
139 Scale factor indices: 3\n\
142 Scale factor indices: 4\n\
143 z. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.\n\
147 Scale factor indices: 1\n\
150 Scale factor indices: 2\n\
153 Scale factor indices: 3\n\
156 Scale factor indices: 4\n";
162 static const char CmguiCoordinatesFileHeader3DQuadratic[] =
" 1) coordinates, coordinate, rectangular cartesian, #Components=3\n\
163 x. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.\n\
167 Scale factor indices: 1\n\
170 Scale factor indices: 2\n\
173 Scale factor indices: 3\n\
176 Scale factor indices: 4\n\
179 Scale factor indices: 5\n\
182 Scale factor indices: 6\n\
185 Scale factor indices: 7\n\
188 Scale factor indices: 8\n\
191 Scale factor indices: 9\n\
194 Scale factor indices: 10\n\
195 y. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.\n\
199 Scale factor indices: 1\n\
202 Scale factor indices: 2\n\
205 Scale factor indices: 3\n\
208 Scale factor indices: 4\n\
211 Scale factor indices: 5\n\
214 Scale factor indices: 6\n\
217 Scale factor indices: 7\n\
220 Scale factor indices: 8\n\
223 Scale factor indices: 9\n\
226 Scale factor indices: 10\n\
227 z. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.\n\
231 Scale factor indices: 1\n\
234 Scale factor indices: 2\n\
237 Scale factor indices: 3\n\
240 Scale factor indices: 4\n\
243 Scale factor indices: 5\n\
246 Scale factor indices: 6\n\
249 Scale factor indices: 7\n\
252 Scale factor indices: 8\n\
255 Scale factor indices: 9\n\
258 Scale factor indices: 10\n";
264 static const char CmguiCoordinatesFileHeader2D[] =
" 1) coordinates, coordinate, rectangular cartesian, #Components=2\n\
265 x. l.simplex(2)*l.simplex, no modify, standard node based.\n\
269 Scale factor indices: 1\n\
272 Scale factor indices: 2\n\
275 Scale factor indices: 3\n\
276 y. l.simplex(2)*l.simplex, no modify, standard node based.\n\
280 Scale factor indices: 1\n\
283 Scale factor indices: 2\n\
286 Scale factor indices: 3\n";
293 static const char CmguiCoordinatesFileHeader2DQuadratic[] =
" 1) coordinates, coordinate, rectangular cartesian, #Components=2\n\
294 x. q.simplex(2)*q.simplex, no modify, standard node based.\n\
298 Scale factor indices: 1\n\
301 Scale factor indices: 2\n\
304 Scale factor indices: 3\n\
307 Scale factor indices: 4\n\
310 Scale factor indices: 5\n\
313 Scale factor indices: 6\n\
314 y. q.simplex(2)*q.simplex, no modify, standard node based.\n\
318 Scale factor indices: 1\n\
321 Scale factor indices: 2\n\
324 Scale factor indices: 3\n\
327 Scale factor indices: 4\n\
330 Scale factor indices: 5\n\
333 Scale factor indices: 6\n";
341 static const char CmguiCoordinatesFileHeader1D[] =
" 1) coordinates, coordinate, rectangular cartesian, #Components=1\n\
342 x. l.Lagrange, no modify, standard node based.\n\
346 Scale factor indices: 1\n\
349 Scale factor indices: 2\n";
356 static const char CmguiCoordinatesFileHeader1DQuadratic[] =
" 1) coordinates, coordinate, rectangular cartesian, #Components=1\n\
357 x. q.Lagrange, no modify, standard node based.\n\
361 Scale factor indices: 1\n\
364 Scale factor indices: 2\n\
367 Scale factor indices: 3\n";
373 static const char CmguiAdditionalFieldHeader3D[] =
" field, rectangular cartesian, #Components=1\n\
374 x. l.simplex(2;3)*l.simplex*l.simplex, no modify, standard node based.\n\
378 Scale factor indices: 1\n\
381 Scale factor indices: 2\n\
384 Scale factor indices: 3\n\
387 Scale factor indices: 4\n";
395 static const char CmguiAdditionalFieldHeader3DQuadratic[] =
" field, rectangular cartesian, #Components=1\n\
396 x. q.simplex(2;3)*q.simplex*q.simplex, no modify, standard node based.\n\
400 Scale factor indices: 1\n\
403 Scale factor indices: 2\n\
406 Scale factor indices: 3\n\
409 Scale factor indices: 4\n\
412 Scale factor indices: 5\n\
415 Scale factor indices: 6\n\
418 Scale factor indices: 7\n\
421 Scale factor indices: 8\n\
424 Scale factor indices: 9\n\
427 Scale factor indices: 10\n";
433 static const char CmguiAdditionalFieldHeader2D[] =
" field, rectangular cartesian, #Components=1\n\
434 x. l.simplex(2)*l.simplex, no modify, standard node based.\n\
438 Scale factor indices: 1\n\
441 Scale factor indices: 2\n\
444 Scale factor indices: 3\n";
450 static const char CmguiAdditionalFieldHeader2DQuadratic[] =
" field, rectangular cartesian, #Components=1\n\
451 x. q.simplex(2)*q.simplex, no modify, standard node based.\n\
455 Scale factor indices: 1\n\
458 Scale factor indices: 2\n\
461 Scale factor indices: 3\n\
464 Scale factor indices: 4\n\
467 Scale factor indices: 5\n\
470 Scale factor indices: 6\n";
477 static const char CmguiAdditionalFieldHeader1D[] =
" field, rectangular cartesian, #Components=1\n\
478 x. l.Lagrange, no modify, standard node based.\n\
482 Scale factor indices: 1\n\
485 Scale factor indices: 2\n";
491 static const char CmguiAdditionalFieldHeader1DQuadratic[] =
" field, rectangular cartesian, #Components=1\n\
492 x. q.Lagrange, no modify, standard node based.\n\
496 Scale factor indices: 1\n\
499 Scale factor indices: 2\n\
502 Scale factor indices: 3\n";
516 template<
unsigned ELEMENT_DIM,
unsigned SPACE_DIM>
592 std::vector<boost::shared_ptr<std::ofstream> >
OpenElementFiles(
bool append =
false);
635 const std::string& rBaseName,
636 bool cleanDirectory=
true);
std::string mAdditionalFieldHeader
out_stream OpenNodeFile(bool append=false)
virtual ~CmguiMeshWriter()
void SetRegionNames(std::vector< std::string > &rRegionNames)
std::string mCoordinatesFileHeader
std::vector< boost::shared_ptr< std::ofstream > > OpenElementFiles(bool append=false)
void WriteElementsFileHeader(std::vector< boost::shared_ptr< std::ofstream > > &rElemFiles)
std::vector< std::string > mRegionNames
std::ios_base::openmode GetOpenMode(bool append)
std::string mElementFileHeader
unsigned mNumNodesPerElement
std::vector< unsigned > mReordering
void SetAdditionalFieldNames(std::vector< std::string > &rFieldNames)
std::vector< std::string > mAdditionalFieldNames
void AppendLocalDataToFiles()
CmguiMeshWriter(const std::string &rDirectory, const std::string &rBaseName, bool cleanDirectory=true)
void WriteNodeFileHeader(out_stream &rpNodeFile)
void CreateFilesWithHeaders()