Loading...
Searching...
No Matches
VTKUnstructured.cpp
1/*---------------------------------------------------------------------------*\
2 *
3 * bitpit
4 *
5 * Copyright (C) 2015-2021 OPTIMAD engineering Srl
6 *
7 * -------------------------------------------------------------------------
8 * License
9 * This file is part of bitpit.
10 *
11 * bitpit is free software: you can redistribute it and/or modify it
12 * under the terms of the GNU Lesser General Public License v3 (LGPL)
13 * as published by the Free Software Foundation.
14 *
15 * bitpit is distributed in the hope that it will be useful, but WITHOUT
16 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
18 * License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with bitpit. If not, see <http://www.gnu.org/licenses/>.
22 *
23\*---------------------------------------------------------------------------*/
24
25#include "VTK.hpp"
26
27#include "logger.hpp"
28
29namespace bitpit{
30
36
46
52
53 m_nCells = n ;
54
55}
56
62
63 m_connectivity = connectivity ;
64
65}
66
73void VTKUnstructuredGrid::HomogeneousInfoStreamer::flushData( std::fstream &str, const std::string &name, VTKFormat format){
74
75 assert( m_type != VTKElementType::UNDEFINED ) ;
76
77 VTKDataType connectivityDataType = m_connectivity->getDataType();
78
79 if(name == "types" ){
80 uint8_t type = (uint8_t) m_type ;
81 for( uint64_t i=0; i<m_nCells; ++i){
82 flushValue(str, format, type );
83 }
84
85 } else if(name == "offsets" ){
86 uint8_t n = vtk::getElementNodeCount(m_type) ;
87 if (connectivityDataType == VTKDataType::Int64 || connectivityDataType == VTKDataType::UInt64) {
88 uint64_t offset(0) ;
89 for( uint64_t i=0; i<m_nCells; ++i){
90 offset += n ;
91 flushValue(str, format, offset );
92 }
93 } else if (connectivityDataType == VTKDataType::Int32 || connectivityDataType == VTKDataType::UInt32) {
94 uint32_t offset(0) ;
95 for( uint64_t i=0; i<m_nCells; ++i){
96 offset += n ;
97 flushValue(str, format, offset );
98 }
99 } else if (connectivityDataType == VTKDataType::Int16 || connectivityDataType == VTKDataType::UInt16) {
100 uint16_t offset(0) ;
101 for( uint64_t i=0; i<m_nCells; ++i){
102 offset += n ;
103 flushValue(str, format, offset );
104 }
105 } else if (connectivityDataType == VTKDataType::Int8 || connectivityDataType == VTKDataType::UInt8) {
106 uint8_t offset(0) ;
107 for( uint64_t i=0; i<m_nCells; ++i){
108 offset += n ;
109 flushValue(str, format, offset );
110 }
111 }
112
113 }
114
115}
116
126
134
135 m_fh.setAppendix(getExtension());
136
137 int nGeomFields = 6;
138
139 m_geometry.resize(nGeomFields);
140
141 m_geometry[getFieldGeomId(VTKUnstructuredField::POINTS)] = VTKField("Points") ;
142 m_geometry[getFieldGeomId(VTKUnstructuredField::OFFSETS)] = VTKField("offsets") ;
143 m_geometry[getFieldGeomId(VTKUnstructuredField::TYPES)] = VTKField("types") ;
144 m_geometry[getFieldGeomId(VTKUnstructuredField::CONNECTIVITY)] = VTKField("connectivity") ;
145 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_STREAMS)] = VTKField("faces") ;
146 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_OFFSETS)] = VTKField("faceoffsets") ;
147
148 for( auto & field : m_geometry ){
149 field.setLocation( VTKLocation::CELL ) ;
150 field.setFieldType( VTKFieldType::SCALAR ) ;
151 field.setDataType( VTKDataType::Int32 ) ;
152 field.setCodification(m_geomCodex);
153 }
154
155 m_geometry[getFieldGeomId(VTKUnstructuredField::POINTS)].setLocation( VTKLocation::POINT ) ;
156 m_geometry[getFieldGeomId(VTKUnstructuredField::POINTS)].setFieldType( VTKFieldType::VECTOR ) ;
157 m_geometry[getFieldGeomId(VTKUnstructuredField::POINTS)].setDataType( VTKDataType::Float64 ) ;
158
159 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_STREAMS)].disable();
160 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_OFFSETS)].disable();
161
164
165 setElementType(elementType);
166
167}
168
176VTKUnstructuredGrid::VTKUnstructuredGrid( const std::string &dir, const std::string &name, VTKElementType elementType ):VTKUnstructuredGrid( elementType ){
177
178 setNames( dir, name ) ;
179
180}
181
188
189 // Set element type
190 m_elementType = elementType ;
191
192 // Set homogeneous info streamer properties
194 if ( m_elementType == VTKElementType::UNDEFINED ) {
195 m_homogeneousInfoStreamer.setConnectivityField( nullptr );
196 m_homogeneousInfoStreamer.setCellCount( 0 );
197 } else {
198 m_homogeneousInfoStreamer.setConnectivityField( &(m_geometry[getFieldGeomId(VTKUnstructuredField::CONNECTIVITY)]) );
199 m_homogeneousInfoStreamer.setCellCount( m_cells );
200 }
201
202 // Early return if the grid is not made homogeously of one element type
203 if ( m_elementType == VTKElementType::UNDEFINED ) {
204 return;
205 }
206
207 // Types
208 int types_gid = getFieldGeomId(VTKUnstructuredField::TYPES);
209 m_geometry[types_gid].setDataType( VTKDataType::UInt8) ;
210 m_geometry[types_gid].setStreamer(m_homogeneousInfoStreamer) ;
211
212 // Offsets
213 if ( m_elementType != VTKElementType::POLYGON && m_elementType != VTKElementType::POLYHEDRON) {
214 int offsets_gid = getFieldGeomId(VTKUnstructuredField::OFFSETS);
215 m_geometry[offsets_gid].setStreamer(m_homogeneousInfoStreamer) ;
216 }
217
218}
219
236void VTKUnstructuredGrid::setDimensions( uint64_t ncells, uint64_t npoints, uint64_t nconn, uint64_t nfacestream ){
237
238 // Grid size
239 m_points = npoints ;
240
241 m_cells = ncells ;
242 if ( m_elementType != VTKElementType::UNDEFINED ) {
243 m_homogeneousInfoStreamer.setCellCount( ncells );
244 }
245
246 // Connectivity
247 bool unevenConnectivity = false;
248 unevenConnectivity |= ( m_elementType == VTKElementType::UNDEFINED ) ;
249 unevenConnectivity |= ( m_elementType == VTKElementType::POLYGON ) ;
250 unevenConnectivity |= ( m_elementType == VTKElementType::POLYHEDRON ) ;
251
252 if ( unevenConnectivity ) {
253 m_nConnectivityEntries = nconn ;
254 } else {
256 }
257
258 assert( (m_cells != 0 && m_nConnectivityEntries != 0) || (m_cells == 0 && m_nConnectivityEntries == 0) );
259
260 // Face stream
261 bool faceSteamEnabled = false;
262 faceSteamEnabled |= ( m_elementType == VTKElementType::POLYGON ) ;
263 faceSteamEnabled |= ( m_elementType == VTKElementType::POLYHEDRON ) ;
264 faceSteamEnabled |= ( m_elementType == VTKElementType::UNDEFINED && nfacestream > 0 ) ;
265
266 if ( faceSteamEnabled ) {
267 m_nFaceStreamEntries = nfacestream ;
268
269 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_STREAMS)].enable();
270 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_OFFSETS)].enable();
271 } else {
273
274 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_STREAMS)].disable();
275 m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_OFFSETS)].disable();
276 }
277
278}
279
286
287 int index = getFieldGeomId(fieldEnum) ;
288 VTKField& field = m_geometry[index] ;
289
290 field.setStreamer( *streamer ) ;
291
292}
293
299
300 uint64_t nconn(0) ;
301
302 std::fstream str ;
303 std::fstream::pos_type position_appended;
304 std::string line;
305 char c_ ;
306 uint32_t nbytes32 ;
307 uint64_t nbytes64 ;
308
309 // Geometry id of the connectivity
310 int connectivity_gid = getFieldGeomId(VTKUnstructuredField::CONNECTIVITY);
311 if(connectivity_gid < 0) return nconn;
312
313 if(!m_geometry[connectivity_gid].hasAllMetaData() || !m_geometry[connectivity_gid].isEnabled()){
314 throw std::runtime_error("VTKUnstructuredGrid::readConnectivityEntries. Connectivity field is missing meta information or disabled");
315 }
316
317 if( m_geometry[connectivity_gid].getCodification() == VTKFormat::APPENDED ){
318 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary ) ;
319 //Go to the initial position of the appended section
320 while( getline(str, line) && (! bitpit::utils::string::keywordInString( line, "<AppendedData")) ){}
321 str >> c_;
322 while( c_ != '_') str >> c_;
323 position_appended = str.tellg();
324 str.close();
325 }
326
327 //Open in binary for read
328 if( m_geometry[connectivity_gid].getCodification() == VTKFormat::APPENDED ){
329 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary);
330 str.seekg( position_appended) ;
331 str.seekg( m_geometry[connectivity_gid].getOffset(), std::ios::cur) ;
332
333 int dataSize = VTKTypes::sizeOfType( m_geometry[connectivity_gid].getDataType() ) ;
334 assert(dataSize > 0) ;
335
336 if( m_headerType== "UInt32") {
337 genericIO::absorbBINARY( str, nbytes32 ) ;
338 nconn = nbytes32 / dataSize ;
339 }
340
341 if( m_headerType== "UInt64") {
342 genericIO::absorbBINARY( str, nbytes64 ) ;
343 nconn = nbytes64 / dataSize ;
344 }
345 str.close();
346 }
347
348
349
350 //Open in ascii for read
351 if( m_geometry[connectivity_gid].getCodification() == VTKFormat::ASCII ){
352 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary);
353 str.seekg( m_geometry[connectivity_gid].getPosition() ) ;
354
355 std::string line ;
356 std::vector<uint64_t> temp;
357
358 nconn = 0 ;
359
360 getline( str, line) ;
361 while( ! bitpit::utils::string::keywordInString(line,"/DataArray") ) {
362 temp.clear() ;
364 nconn += temp.size() ;
365 getline( str, line) ;
366 }
367
368 str.close();
369 }
370
371 return nconn ;
372
373}
374
380 uint64_t nface(0) ;
381 std::fstream str ;
382 std::fstream::pos_type position_appended;
383 std::string line;
384 char c_ ;
385 uint32_t nbytes32 ;
386 uint64_t nbytes64 ;
387
388 // Geometry id of the facestream
389 int facestream_gid = getFieldGeomId(VTKUnstructuredField::FACE_STREAMS);
390 if(facestream_gid < 0 ) return nface;
391 if(!m_geometry[facestream_gid].hasAllMetaData() || !m_geometry[facestream_gid].isEnabled()) return nface;
392
393 if( m_geometry[facestream_gid].getCodification() == VTKFormat::APPENDED ){
394 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary ) ;
395 //Go to the initial position of the appended section
396 while( getline(str, line) && (! bitpit::utils::string::keywordInString( line, "<AppendedData")) ){}
397 str >> c_;
398 while( c_ != '_') str >> c_;
399 position_appended = str.tellg();
400 str.close();
401 }
402
403 //Open in binary for read
404 if( m_geometry[facestream_gid].getCodification() == VTKFormat::APPENDED ){
405 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary);
406 str.seekg( position_appended) ;
407 str.seekg( m_geometry[facestream_gid].getOffset(), std::ios::cur) ;
408
409 int dataSize = VTKTypes::sizeOfType( m_geometry[facestream_gid].getDataType() ) ;
410 assert(dataSize > 0) ;
411
412 if( m_headerType== "UInt32") {
413 genericIO::absorbBINARY( str, nbytes32 ) ;
414 nface = nbytes32 / dataSize ;
415 }
416
417 if( m_headerType== "UInt64") {
418 genericIO::absorbBINARY( str, nbytes64 ) ;
419 nface = nbytes64 / dataSize ;
420 }
421 }
422
423 //Open in ASCII for read
424 if( m_geometry[facestream_gid].getCodification() == VTKFormat::ASCII ){
425 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary );
426 str.seekg( m_geometry[facestream_gid].getPosition() ) ;
427
428 std::string line ;
429 std::vector<uint64_t> temp;
430
431 nface = 0 ;
432
433 getline( str, line) ;
434 while( ! bitpit::utils::string::keywordInString(line,"/DataArray") ) {
435 temp.clear() ;
437 nface += temp.size() ;
438 getline( str, line) ;
439 }
440
441 str.close();
442 }
443
444 return nface ;
445}
446
451
452 std::fstream str ;
453
454 //Since we are writing only ASCII information (without retrieving stream
455 //position with seekg/tellg) it is safe to open it in text/ASCII mode.
456 str.open( m_fh.getPath( ), std::ios::out ) ;
457 if (!str.is_open()) {
458 throw std::runtime_error("Cannot create file \"" + m_fh.getName() + "\"" + " inside the directory \"" + m_fh.getDirectory() + "\"");
459 }
460
461 //Writing XML header
462 str << "<?xml version=\"1.0\"?>" << std::endl;
463
464 //Writing Piece Information
465 str << "<VTKFile type=\"UnstructuredGrid\" version=\"1.0\" byte_order=\"LittleEndian\" header_type=\"" << m_headerType << "\">" << std::endl;
466 str << " <UnstructuredGrid>" << std::endl;;
467 str << " <Piece NumberOfPoints=\"" << m_points << "\" NumberOfCells=\"" << m_cells << "\">" << std::endl;
468
469 //Header for Data
470 writeDataHeader( str, false );
471
472 //Wring Geometry Information
473 str << " <Points>" << std::endl ;;
474 writeDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::POINTS)] ) ;
475 str << " </Points>" << std::endl;
476
477 str << " <Cells>" << std::endl ;;
478 writeDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::OFFSETS)] ) ;
479 writeDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::TYPES)] ) ;
480 writeDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::CONNECTIVITY)] ) ;
482 writeDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_STREAMS)] ) ;
483 writeDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_OFFSETS)] ) ;
484 }
485 str << " </Cells>" << std::endl;
486
487 //Closing Piece
488 str << " </Piece>" << std::endl;
489 str << " </UnstructuredGrid>" << std::endl;
490
491 //Appended Section
492 if (isAppendedActive()) {
493 str << " <AppendedData encoding=\"raw\">" << std::endl;
494 str << "_" << std::endl;
495 }
496
497 // Closing XML
498 str << "</VTKFile>" << std::endl;
499
500 str.close() ;
501
502}
503
510void VTKUnstructuredGrid::writeCollection( const std::string &outputName, const std::string &collectionName ) const {
511
512 // Only one process in a parallel output should write the collection
513 if (m_procs <= 1 || m_rank != 0) {
514 return;
515 }
516
517 // Create file handler
518 FileHandler fhp = createCollectionHandler(collectionName) ;
519
520 // Initialize outout stream
521 std::fstream str ;
522 str.open( fhp.getPath( ), std::ios::out ) ;
523 if (!str.is_open()) {
524 throw std::runtime_error("Cannot create file \"" + fhp.getName() + "\"" + " inside the directory \"" + fhp.getDirectory() + "\"");
525 }
526
527 //Writing XML header
528 str << "<?xml version=\"1.0\"?>" << std::endl;
529
530 //Writing Piece Information
531 str << "<VTKFile type=\"PUnstructuredGrid\" version=\"0.1\" byte_order=\"LittleEndian\">" << std::endl;
532 str << " <PUnstructuredGrid GhostLevel=\"0\">" << std::endl;;
533
534 //Header for Data
535 writeDataHeader( str, true );
536
537 //Wring Geometry Information
538 str << " <PPoints>" << std::endl;
539 writePDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::POINTS)] ) ;
540 str << " </PPoints>" << std::endl;
541
542 str << " <PCells>" << std::endl;
543 writePDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::OFFSETS)] ) ;
544 writePDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::TYPES)] ) ;
545 writePDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::CONNECTIVITY)] ) ;
547 writePDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_STREAMS)] ) ;
548 writePDataArray( str, m_geometry[getFieldGeomId(VTKUnstructuredField::FACE_OFFSETS)] ) ;
549 }
550 str << " </PCells>" << std::endl;
551
552 FileHandler fho(m_fh) ;
553 fho.setSeries(false) ;
554 fho.setDirectory(".") ;
555 fho.setName(outputName) ;
556 for( int i=0; i<m_procs; i++){
557 fho.setBlock(i) ;
558 str << " <Piece Source=\"" << fho.getPath() << "\"/>" << std::endl;
559 }
560
561 str << " </PUnstructuredGrid>" << std::endl;
562 str << "</VTKFile>" << std::endl;
563
564 str.close() ;
565
566
567}
568
574
575 std::fstream str;
576 std::string line, temp;
577
578 std::fstream::pos_type position;
579
580 //Although we are not explicit calling seekg/tellg on the stream, we still
581 //need to open the file in binary mode because this mode is needed by the
582 //for reading data array information.
583 str.open( m_fh.getPath( ), std::ios::in | std::ios::binary ) ;
584
585 getline( str, line);
586 while( ! bitpit::utils::string::keywordInString( line, "<VTKFile")){
587 getline(str, line);
588 }
589
590 if( bitpit::utils::string::getAfterKeyword( line, "header_type", '\"', temp) ){
591 setHeaderType( temp) ;
592 }
593
594 while( ! bitpit::utils::string::keywordInString( line, "<Piece")){
595 getline(str, line);
596 }
597
598 bitpit::utils::string::getAfterKeyword( line, "NumberOfPoints", '\"', temp) ;
600
601 bitpit::utils::string::getAfterKeyword( line, "NumberOfCells", '\"', temp) ;
603
604
605 position = str.tellg() ;
606 readDataHeader( str ) ;
607
608 // Read metadata information
609 for( auto &field : m_geometry ){
610 str.seekg( position) ;
611 if( ! readDataArray( str, field ) ) {
612#if BITPIT_ENABLE_DEBUG
613 log::cout() <<"Geometry field " << field.getName() << " not found, it will be disabled" << std::endl ;
614#endif
615 field.disable();
616 }
617 }
618
619
620 str.close() ;
621
622 if( m_elementType == VTKElementType::UNDEFINED) {
624 } else {
625 // Metadata information read form file may not match the information
626 // set in our own streamer. If the grid is homogeneous, we need to
627 // reset all metadata that can't be overwritten.
629
630 // Set the dimension of the grid
632 }
633
634
635}
636
642
643 return calcFieldEntries( m_geometry[getFieldGeomId(VTKUnstructuredField::CONNECTIVITY)] ) ;
644}
645
651uint64_t VTKUnstructuredGrid::calcFieldSize( const VTKField &field ) const {
652
653 uint64_t bytes = calcFieldEntries(field) ;
654 bytes *= VTKTypes::sizeOfType( field.getDataType() ) ;
655
656 return bytes ;
657
658}
659
665uint64_t VTKUnstructuredGrid::calcFieldEntries( const VTKField &field ) const {
666
667 uint64_t entries(0) ;
668 const std::string &name = field.getName() ;
669
670 if( name == "Points" ){
671 entries = m_points * VTKField::getComponentCount(VTKFieldType::VECTOR) ;
672
673 } else if( name == "offsets" ){
674 entries = m_cells ;
675
676 } else if( name == "types" ){
677 entries = m_cells ;
678
679 } else if( name == "connectivity"){
680 entries = m_nConnectivityEntries ;
681
682 } else if( name == "faces"){
683 entries = m_nFaceStreamEntries ;
684
685 } else if( name == "faceoffsets"){
686 entries = m_cells ;
687
688 } else{
689
690 VTKLocation location( field.getLocation() ) ;
691 assert( location != VTKLocation::UNDEFINED) ;
692
693 if( location == VTKLocation::CELL ){
694 entries = m_cells ;
695
696 } else if( location == VTKLocation::POINT ){
697 entries = m_points ;
698
699 }
700
701 entries *= field.getComponentCount() ;
702
703 }
704
705 return entries ;
706
707}
708
715
716 uint8_t comp ;
717 const std::string &name = field.getName() ;
718
719 if( name == "Points" ){
720 comp = VTKField::getComponentCount(VTKFieldType::VECTOR) ;
721
722 } else if( name == "offsets" ){
723 comp = 1 ;
724
725 } else if( name == "types" ){
726 comp = 1 ;
727
728 } else if( name == "connectivity" ){
729 if( m_elementType != VTKElementType::UNDEFINED){
731
732 } else {
733 comp = 1;
734
735 }
736
737 } else if( name == "faces" ){
738 comp = 1 ;
739
740 } else if( name == "faceoffsets" ){
741 comp = 1 ;
742
743 } else{
744 comp = field.getComponentCount();
745
746 }
747
748 return comp ;
749
750}
751
757int VTKUnstructuredGrid::getFieldGeomId( VTKUnstructuredField field ) const {
758
759 return static_cast<std::underlying_type<VTKElementType>::type>(field) ;
760}
761
768 return "vtu";
769}
770
771}
Creates file names and checks status.
std::string getPath() const
const std::string & getDirectory() const
void setDirectory(const std::string &d_)
void setName(const std::string &n_)
const std::string & getName() const
void setBlock(int b_)
void setSeries(bool s_)
std::string getName() const
Definition logger.cpp:851
The base class to be used to derive VTK streamers form.
Definition VTK.hpp:209
VTKField handles geometry and data field information for the VTK format.
Definition VTK.hpp:247
const std::string & getName() const
Definition VTKField.cpp:167
VTKLocation getLocation() const
Definition VTKField.cpp:200
unsigned getComponentCount() const
Definition VTKField.cpp:183
void setStreamer(VTKBaseStreamer &)
Definition VTKField.cpp:145
static unsigned getComponentCount(VTKFieldType fieldType)
Definition VTKField.cpp:40
VTKDataType getDataType() const
Definition VTKField.cpp:192
static uint8_t sizeOfType(VTKDataType type)
Definition VTKTypes.cpp:67
void setConnectivityField(const VTKField *connectivity)
uint8_t calcFieldComponents(const VTKField &) const override
HomogeneousInfoStreamer m_homogeneousInfoStreamer
Definition VTK.hpp:454
uint64_t calcConnectivityEntries() const
std::string getExtension() const override
uint64_t m_nConnectivityEntries
Definition VTK.hpp:451
uint64_t calcFieldSize(const VTKField &) const override
uint64_t m_nFaceStreamEntries
Definition VTK.hpp:452
void setElementType(VTKElementType)
void writeMetaInformation() const override
void setDimensions(uint64_t, uint64_t, uint64_t nconn=0, uint64_t nfacestream=0)
VTKUnstructuredGrid(VTKElementType elementType=VTKElementType::UNDEFINED)
VTKElementType m_elementType
Definition VTK.hpp:453
uint64_t calcFieldEntries(const VTKField &) const override
void setGeomData(VTKUnstructuredField, std::vector< T > &)
Definition VTK.tpp:94
uint16_t m_rank
Definition VTK.hpp:305
uint64_t m_cells
Definition VTK.hpp:303
std::vector< VTKField > m_geometry
Definition VTK.hpp:309
void readDataHeader(std::fstream &)
Definition VTK.cpp:1370
void setNames(const std::string &, const std::string &)
Definition VTK.cpp:108
FileHandler m_fh
Definition VTK.hpp:301
void setHeaderType(const std::string &)
Definition VTK.cpp:83
std::string m_headerType
Definition VTK.hpp:307
bool readDataArray(std::fstream &, VTKField &) const
Definition VTK.cpp:1468
void writeCollection() const
Definition VTK.cpp:789
void writePDataArray(std::fstream &, const VTKField &) const
Definition VTK.cpp:1224
uint16_t m_procs
Definition VTK.hpp:304
void writeDataHeader(std::fstream &, bool parallel=false) const
Definition VTK.cpp:1146
bool isAppendedActive() const
Definition VTK.cpp:603
void writeDataArray(std::fstream &, const VTKField &) const
Definition VTK.cpp:1212
FileHandler createCollectionHandler(const std::string &collectionName) const
Definition VTK.cpp:934
uint64_t m_points
Definition VTK.hpp:302
VTKFormat m_geomCodex
Definition VTK.hpp:310
VTKFormat
Definition VTK.hpp:92
VTKElementType
Definition VTK.hpp:112
VTKDataType
Definition VTK.hpp:74
VTKLocation
Definition VTK.hpp:102
VTKUnstructuredField
Definition VTK.hpp:137
bool keywordInString(const std::string &line, const std::string &key)
void convertString(const std::string &input, T &output)
bool getAfterKeyword(const std::string &line, const std::string &key, char del, std::string &result)
void absorbBINARY(std::fstream &str, data_T &data)
Logger & cout(log::Level defaultSeverity, log::Visibility defaultVisibility)
Definition logger.cpp:1714
uint8_t getElementNodeCount(VTKElementType)
Definition VTKUtils.cpp:35