OpenLB 1.8.1
Loading...
Searching...
No Matches
vtiReader.hh
Go to the documentation of this file.
1/* This file is part of the OpenLB library
2 *
3 * Copyright (C) 2015 Mathias J. Krause, Benjamin Förster
4 * E-mail contact: info@openlb.net
5 * The most recent release of OpenLB can be downloaded at
6 * <http://www.openlb.net/>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program; if not, write to the Free
20 * Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301, USA.
22*/
23
24
25#ifndef VTI_READER_HH
26#define VTI_READER_HH
27
28#include <stdlib.h>
29#include <iostream>
30#include <fstream>
31#include <sstream>
32#include <iomanip>
33#include <math.h>
34#include <cassert>
35
36#include "geometry/cuboid.h"
37#include "vtiReader.h"
39
40namespace olb {
41
42/* ------------------ BaseVTIreader -----------------*/
43
44template<typename T>
45BaseVTIreader<T>::BaseVTIreader( const std::string& fileName, int dim,
46 std::string dataName, const std::string class_name, DataType type)
47 : clout(class_name), _dim(dim), _comps(0), _origin(_dim, 0), _extent(_dim, 0),
48 _delta(0), _xmlReader(fileName), _nCuboids(0), _type(type)
49{
50 // Read WholeExtent (2 * _dim ints) from XML File and calculate _extent
51 std::vector<int> wholeExtend = readExtent(&_xmlReader["ImageData"], "WholeExtent");
52 _extent = getNbNodes(wholeExtend);
53
54 // Read _delta
55 std::stringstream stream_val_1(_xmlReader["ImageData"].getAttribute("Spacing"));
56 T delta1;
57 T delta2;
58 T delta3;
59 stream_val_1 >> delta1;
60 stream_val_1 >> delta2;
61 stream_val_1 >> delta3;
62 T eps = std::numeric_limits<T>::epsilon();
63 if( std::fabs(delta1 - delta2) > eps || std::fabs(delta1 - delta3) > eps ) {
64 clout << " Error: The lattice has to be homogenous" << std::endl;
65 exit(1);
66 }
67 _delta = delta1;
68
69 // Read _origin
70 std::stringstream stream_val_2(_xmlReader["ImageData"].getAttribute("Origin"));
71 for (auto& origin_i : _origin) {
72 stream_val_2 >> origin_i;
73 }
74
76 for ( auto& pieceReader : _xmlReader["ImageData"] ) {
77 if (pieceReader->getName() == "Piece") {
78 if ( _nCuboids == 0 ) {
79 if (_type == PointData) {
80 for (auto& dataArrayReader : (*pieceReader)["PointData"]) {
81 if (dataArrayReader->getAttribute("Name") == dataName && dataArrayReader->getName() == "DataArray") {
82 _comps = this->getNbComps(*dataArrayReader);
83 }
84 }
85 } else {
86 for (auto& dataArrayReader : (*pieceReader)["CellData"]) {
87 if (dataArrayReader->getAttribute("Name") == dataName && dataArrayReader->getName() == "DataArray") {
88 _comps = this->getNbComps(*dataArrayReader);
89 }
90 }
91 }
92 }
93 _nCuboids++;
94 }
95 }
96}
97
98template<typename T>
100{
101 clout << "Information on VTIreader Data:" << std::endl;
102 clout << "Origin: ";
103 for (auto& origin_i : _origin) {
104 clout << origin_i << " ";
105 }
106 clout << std::endl;
107
108 clout << "Extend: ";
109 for (auto& extend_i : _extent) {
110 clout << extend_i << " ";
111 }
112 clout << std::endl;
113
114 clout << "Spacing: " << _delta << std::endl;
115}
116
117template<typename T>
118std::vector<int> BaseVTIreader<T>::readExtent(const XMLreader* reader, std::string extAttrName)
119{
120 // An extent is in the form of four (or six) integers "x0 x1 y0 y1 z0 z1"
121 // each representing a node number
122 std::stringstream extstr(reader->getAttribute(extAttrName));
123 std::vector<int> extents;
124 int tmp;
125 for (int i = 0; i < 2 * _dim; ++i) {
126 extstr >> tmp;
127 extents.push_back(tmp);
128 }
129 return extents;
130}
131
132template<typename T>
133std::vector<int> BaseVTIreader<T>::getNbNodes(std::vector<int>& extents)
134{
135 // Convert 4D (or 6D) extents vector into 2D (3D) extent vector
136 std::vector<int> nNodes;
137 for ( int i = 0; i < _dim; i++ ) {
138 if (_type == PointData) nNodes.push_back(extents[2 * i + 1 ] - extents[2 * i ] + 1);
139 else nNodes.push_back(extents[2 * i + 1] - extents[2 * i]);
140 }
141 return nNodes;
142}
143
144template<typename T>
146{
147 // read the NumberOfComponents-Attribute (VTI standard) and return as integer
148 int comps = std::atoi((tagReader.getAttribute("NumberOfComponents")).c_str());
149 if (comps == 0) {
150 clout << "Warning: NumberOfComponents zero or not given!" << std::endl;
151 clout << "Example: <DataArray Name='physVelocity' NumberOfComponents='3'" << std::endl;
152 clout << "Setting to default of NumberOfComponents='1'" << std::endl;
153 comps = 1;
154 }
155 return comps;
156}
157
158template<typename T>
160 size_t result = 1;
161 for(int i = 0; i < _dim; i++) {
162 result *= _extent[i];
163 }
164 return result * _comps;
165}
166
167
168/* -------------------- BaseVTIreader3D --------------------- */
169
170template<typename T, typename BaseType>
171BaseVTIreader3D<T,BaseType>::BaseVTIreader3D( const std::string& fileName, std::string dataName,
172 const std::string class_name, const DataType type)
173 : BaseVTIreader<T>(fileName, 3, dataName, class_name, type)
174{
175}
176
177template<typename T, typename BaseType>
179{
180 if (pieceReader->getName() == "Piece") {
181 std::vector<int> extents = this->readExtent(pieceReader, "Extent");
182 std::vector<int> extent = this->getNbNodes(extents);
183 // int extents[i] is node number => multiply with _delta to get coordinate
184 cuboid.init(extents[0] * this->_delta,
185 extents[2] * this->_delta,
186 extents[4] * this->_delta,
187 this->_delta,
188 //Why is this 0, 1, 2 and not 1, 3, 5?
189 extent[0],
190 extent[1],
191 extent[2]);
192 }
193}
194
195template<typename T, typename BaseType>
196void BaseVTIreader3D<T, BaseType>::readAsciiData(std::stringstream& stream_val, BlockData<3, T, BaseType>& blockData)
197{
198 // Careful: respect ordering in VTI File
199 for (int iz = 0; iz < blockData.getNz(); iz++) {
200 for (int iy = 0; iy < blockData.getNy(); iy++) {
201 for (int ix = 0; ix < blockData.getNx(); ix++) {
202 for (unsigned iSize=0; iSize < blockData.getSize(); iSize++) {
203
204 //Throws an exception, when the input stream has reached it's end, but the blockData is not completely initialized
205 if(stream_val.eof()) {
206 this->clout << " Error: End of input has been reached, but there is still data to be written" << std::endl;
207 exit(1);
208 }
209 //Test if the vertex is inside of the physical extent
210 if (blockData.isInside({ix, iy, iz})) {
211 BaseType tmp;
212 stream_val >> tmp;
213 // write tmp into blockData
214 blockData.get({ix, iy, iz}, iSize) = tmp;
215 } else {
216 this->clout << "Found point outside of the block structure" << std::endl;
217 blockData.get({ix, iy, iz}, iSize) = 0;
218 }
219 }
220 }
221 }
222 }
223 //Test if string stream is empty
224 if (!stream_val.eof()) {
225 this->clout << " Error: There are still values left in the value stream but the Block Data is already filled" << std::endl;
226 exit(1);
227 }
228}
229
230template<typename T, typename BaseType>
231void BaseVTIreader3D<T, BaseType>::readBinaryData(std::stringstream& stream_val, BlockData<3, T, BaseType>& blockData,
232 size_t str_length)
233{
234 Base64Decoder<BaseType> decoder(stream_val, str_length);
235 size_t totalDataValues = this->computeTotalDataValues();
236 std::vector<BaseType> values(totalDataValues);
237 decoder.decode(values.data(), totalDataValues);
238
239 size_t value_idx = 0;
240 for (int iz = 0; iz < blockData.getNz(); iz++) {
241 for (int iy = 0; iy < blockData.getNy(); iy++) {
242 for (int ix = 0; ix < blockData.getNx(); ix++) {
243 for (unsigned iSize=0; iSize < blockData.getSize(); iSize++) {
244 //Throws an exception, when the input stream has reached it's end, but the blockData is not completely initialized
245 if(value_idx >= totalDataValues) {
246 this->clout << " Error: End of input has been reached, but there is still data to be written" << std::endl;
247 exit(1);
248 }
249 //Test if the vertex is inside of the physical extent
250 if (blockData.isInside({ix, iy, iz})) {
251 // this->clout << "got value: " << values[value_idx] << std::endl;
252 blockData.get({ix, iy, iz}, iSize) = values[value_idx];
253 } else {
254 this->clout << "Found point outside of the block structure" << std::endl;
255 blockData.get({ix, iy, iz}, iSize) = 0;
256 }
257 value_idx++;
258 }
259 }
260 }
261 }
262 //Test if string stream is empty
263 if (value_idx < totalDataValues) {
264 this->clout << " Error: There are still values left in the value stream but the Block Data is already filled" << std::endl;
265 exit(1);
266 }
267}
268
269template<typename T, typename BaseType>
271 const XMLreader& pieceTagReader, const std::string dataName)
272{
273
274 std::string arrayType = (this->_type == PointData) ? "PointData" : "CellData";
275
276 // Iterate through all <DataArray> tags and take the one with the given Name attribute
277 bool attributeFound = false;
278 for (auto & dataArrayReader : pieceTagReader[arrayType]) {
279 if (dataArrayReader->getAttribute("Name") == dataName && dataArrayReader->getName() == "DataArray") {
280 attributeFound = true;
281 std::string data_str;
282 if (dataArrayReader->read(data_str)) {
283 std::stringstream stream_val(data_str);
284 if (dataArrayReader->getAttribute("format") == "binary") {
285 this->clout << "Reading binary data" << std::endl;
286 readBinaryData(stream_val, blockData, data_str.length());
287 } else if (dataArrayReader->getAttribute("format") == "ascii") {
288 this->clout << "Reading ASCII data" << std::endl;
289 readAsciiData(stream_val, blockData);
290 } else {
291 this->clout << "Warning: The file format has to be either 'ascii' or 'binary', but it is '" << dataArrayReader->getAttribute("format") << "'."<< std::endl;
292 }
293 }
294 return true;
295 }
296 }
297 if(!attributeFound) {
298 this->clout << "Could not find attribute with the given Name: '" << dataName << "'" << std::endl;
299 }
300 return false;
301}
302
303/* ---------------- BlockVTIreader3D -------------------*/
304
305template<typename T,typename BaseType>
306BlockVTIreader3D<T,BaseType>::BlockVTIreader3D(const std::string& fileName, const std::string& dataName, const DataType type)
307 : BaseVTIreader3D<T,BaseType>(fileName, dataName, "BlockVTIreader3D", type),
308 _cuboid(this->_origin, this->_delta, this->_extent),
309 _blockData(_cuboid, 0, this->_comps)
310{
311 size_t pieceTagCounter = 0;
312 for (XMLreader* child : this->_xmlReader["ImageData"]) {
313 if(child->getName() == "Piece") {
314 pieceTagCounter++;
315 }
316 }
317 if(pieceTagCounter == 0) {
318 this->clout << " Error: No piece tag could be found in " << fileName << std::endl;
319 exit(1);
320 }
321 if(pieceTagCounter > 1) {
322 this->clout << "Found several piece tags, only reads the first one" << std::endl;
323 }
324 // Only read the first <Piece> tag in the XML file
325 this->readBlockData(_blockData, this->_xmlReader["ImageData"]["Piece"], dataName);
326}
327
328
329template<typename T,typename BaseType>
334
335template<typename T,typename BaseType>
340
341
342/* --------------- SuperVTIreader3D ---------------------*/
343
344template<typename T,typename BaseType>
346{
347 delete _loadBalancer;
348 delete _cGeometry;
349 delete _superData;
350}
351
352template<typename T,typename BaseType>
353SuperVTIreader3D<T,BaseType>::SuperVTIreader3D(const std::string& fName, const std::string dName )
354 : BaseVTIreader3D<T,BaseType>(fName, dName, "SuperVTIreader3D")
355{
356 this->clout << "Start reading \"" << fName << "\"... "
357 << "(" << this->_nCuboids << " cuboids)" << std::endl;
358
359 // Create CuboidDecomposition
360 _cGeometry = new CuboidDecomposition3D<T> (this->_origin, this->_delta, this->_extent);
361
362 this->clout << "* Reading Cuboid Geometry..." << std::endl;
363
364 // Fill CuboidDecomposition
365 readCuboidDecomposition();
366
367 _cGeometry->printExtended();
368
369 // Create LoadBalancer
370 _loadBalancer = new HeuristicLoadBalancer<T> (*_cGeometry);
371
372 // Create SuperData (allocation of the data, this->_size is already known!)
373 _superData = new SuperData<3,T,BaseType> ( *_cGeometry, *_loadBalancer, 2, this->_size);
374
375 this->clout << "* Reading BlockData..." << std::endl;
376
377 // Fill data objects
378 readSuperData(dName);
379
380 this->clout << "VTI Reader finished." << std::endl;
381}
382
383template<typename T,typename BaseType>
385{
386 //_cGeometry->clearCuboids();
387 for ( auto& piece : this->_xmlReader["ImageData"] ) {
388 if (piece->getName() == "Piece") {
389 std::vector<int> extents = this->readExtent(piece, "Extent");
390 std::vector<int> extent = this->getNbNodes(extents);
391 // int extent[i] is node number => multiply with _delta to get coordinate
392 Cuboid3D<T> cuboid(extents[0] * this->_delta,
393 extents[2] * this->_delta,
394 extents[4] * this->_delta,
395 this->_delta,
396 extent[0],
397 extent[1],
398 extent[2]);
399 _cGeometry->add(cuboid);
400 }
401 }
402}
403
404template<typename T,typename BaseType>
405void SuperVTIreader3D<T,BaseType>::readSuperData(const std::string dName)
406{
407 int counter = 0;
408 // Iterate over all <Piece> tags
409 for (auto & piece : this->_xmlReader["ImageData"]) {
410 if (piece->getName() == "Piece") {
411 this->readBlockData(_superData->getBlock(counter), *piece, dName);
412 counter++;
413 }
414 }
415}
416
417template<typename T,typename BaseType>
422
423template<typename T,typename BaseType>
428
429template<typename T,typename BaseType>
434
435
436/* -------------------- BaseVTIreader2D --------------------- */
437
438template<typename T, typename BaseType>
439BaseVTIreader2D<T,BaseType>::BaseVTIreader2D( const std::string& fileName, std::string dataName,
440 const std::string class_name, const DataType type)
441 : BaseVTIreader<T>(fileName, 2, dataName, class_name, type)
442{
443}
444
445template<typename T, typename BaseType>
447{
448 if (pieceReader->getName() == "Piece") {
449 std::vector<int> extents = this->readExtent(pieceReader, "Extent");
450 std::vector<int> extent = this->getNbNodes(extents);
451 // int extents[i] is node number => multiply with _delta to get coordinate
452 cuboid.init(extents[0] * this->_delta,
453 extents[2] * this->_delta,
454 this->_delta,
455 extent[0],
456 extent[1]);
457 }
458}
459
460template<typename T, typename BaseType>
461void BaseVTIreader2D<T, BaseType>::readAsciiData(std::stringstream& stream_val, BlockData<2, T, BaseType>& blockData)
462{
463 // Careful: respect ordering in VTI File
464 for (int iy = 0; iy < blockData.getNy(); iy++) {
465 for (int ix = 0; ix < blockData.getNx(); ix++) {
466 for (unsigned iSize=0; iSize < blockData.getSize(); iSize++) {
467
468 //Throws an exception when the input stream has reached its end, but the blockData is not completely initialized
469 if(stream_val.eof()) {
470 this->clout << " Error: End of input has been reached, but there is still data to be written" << std::endl;
471 exit(1);
472 }
473 //Test if the vertex is inside of the physical extent
474 if (blockData.isInside({ix, iy})) {
475 BaseType tmp;
476 stream_val >> tmp;
477 // write tmp into blockData
478 blockData.get({ix, iy}, iSize) = tmp;
479 } else {
480 this->clout << "Found point outside of the block structure" << std::endl;
481 blockData.get({ix, iy}, iSize) = 0;
482 }
483 }
484 }
485 }
486 //Test if string stream is empty
487 if (!stream_val.eof()) {
488 this->clout << " Error: There are still values left in the value stream but the Block Data is already filled" << std::endl;
489 exit(1);
490 }
491}
492
493template<typename T, typename BaseType>
494void BaseVTIreader2D<T, BaseType>::readBinaryData(std::stringstream& stream_val, BlockData<2, T, BaseType>& blockData, size_t str_length)
495{
496 // Print the contents of stream_val to the console
497 // this->clout << "stream_val contents:\n" << stream_val.str() << std::endl;
498
499 Base64Decoder<BaseType> decoder(stream_val, str_length);
500 // stream_val is correct
501 size_t totalDataValues = this->computeTotalDataValues();
502 std::vector<BaseType> values(totalDataValues);
503 decoder.decode(values.data(), totalDataValues);
504
505 size_t value_idx = 0;
506 for (int iy = 0; iy < blockData.getNy(); iy++) {
507 for (int ix = 0; ix < blockData.getNx(); ix++) {
508 for (unsigned iSize=0; iSize < blockData.getSize(); iSize++) {
509 //Throws an exception when the input stream has reached its end, but the blockData is not completely initialized
510 if(value_idx >= totalDataValues) {
511 this->clout << " Error: End of input has been reached, but there is still data to be written" << std::endl;
512 exit(1);
513 }
514 //Test if the vertex is inside of the physical extent
515 if (blockData.isInside({ix, iy})) {
516 // values[value_ids] are decoded wrongly
517 // this->clout << values[value_idx] << std::endl;
518 blockData.get({ix, iy}, iSize) = values[value_idx];
519 } else {
520 this->clout << "Found point outside of the block structure" << std::endl;
521 blockData.get({ix, iy}, iSize) = 0;
522 }
523 value_idx++;
524 }
525 }
526 }
527 //Test if string stream is empty
528 if (value_idx < totalDataValues) {
529 this->clout << " Error: There are still values left in the value stream but the Block Data is already filled" << std::endl;
530 exit(1);
531 }
532}
533
534template<typename T, typename BaseType>
535bool BaseVTIreader2D<T,BaseType>::readBlockData(BlockData<2,T,BaseType>& blockData, const XMLreader& pieceTagReader, const std::string dataName)
536{
537 std::string arrayType = (this->_type == PointData) ? "PointData" : "CellData";
538
539 // Iterate through all <DataArray> tags and take the one with the given Name attribute
540 bool attributeFound = false;
541 for (auto & dataArrayReader : pieceTagReader[arrayType]) {
542 if (dataArrayReader->getAttribute("Name") == dataName && dataArrayReader->getName() == "DataArray") {
543 attributeFound = true;
544 std::string data_str;
545 if (dataArrayReader->read(data_str)) {
546 std::stringstream stream_val(data_str);
547 if (dataArrayReader->getAttribute("format") == "binary") {
548 // this->clout << "Reading binary data" << std::endl;
549 readBinaryData(stream_val, blockData, data_str.length());
550 } else if (dataArrayReader->getAttribute("format") == "ascii") {
551 // this->clout << "Reading ASCII data" << std::endl;
552 readAsciiData(stream_val, blockData);
553 } else {
554 this->clout << "Warning: The file format has to be either 'ascii' or 'binary', but it is '" << dataArrayReader->getAttribute("format") << "'."<< std::endl;
555 }
556 }
557 return true;
558 }
559 }
560 if(!attributeFound) {
561 this->clout << "Could not find attribute with the given Name: '" << dataName << "'" << std::endl;
562 }
563 return false;
564}
565
566/* ---------------- BlockVTIreader2D -------------------*/
567
568template<typename T,typename BaseType>
569BlockVTIreader2D<T,BaseType>::BlockVTIreader2D(const std::string& fileName, const std::string& dataName, const DataType type)
570 : BaseVTIreader2D<T,BaseType>(fileName, dataName, "BlockVTIreader2D", type),
571 _cuboid(this->_origin, this->_delta, this->_extent),
572 _blockData(_cuboid, 0, this->_comps)
573{
574 size_t pieceTagCounter = 0;
575 for (XMLreader* child : this->_xmlReader["ImageData"]) {
576 if(child->getName() == "Piece") {
577 pieceTagCounter++;
578 }
579 }
580 if(pieceTagCounter == 0) {
581 this->clout << " Error: No piece tag could be found in " << fileName << std::endl;
582 exit(1);
583 }
584 if(pieceTagCounter > 1) {
585 this->clout << "Found several piece tags, only reads the first one" << std::endl;
586 }
587 // Only read the first <Piece> tag in the XML file
588 this->readBlockData(_blockData, this->_xmlReader["ImageData"]["Piece"], dataName);
589}
590
591template<typename T,typename BaseType>
596
597template<typename T,typename BaseType>
602
603}
604#endif
BaseVTIreader2D(const std::string &fileName, std::string dataName, const std::string class_name="BaseVTIreader2D", const DataType type=PointData)
Definition vtiReader.hh:439
bool readBlockData(BlockData< 2, T, BaseType > &blockData, const XMLreader &pieceTagReader, const std::string dataName)
Reads from DataArray and fills blockData.
Definition vtiReader.hh:535
void readCuboid(Cuboid2D< T > &cuboid, XMLreader *pieceReader)
Reads cuboid from piece node.
Definition vtiReader.hh:446
void readCuboid(Cuboid3D< T > &cuboid, XMLreader *pieceReader)
Reads cuboid from piece node.
Definition vtiReader.hh:178
bool readBlockData(BlockData< 3, T, BaseType > &blockData, const XMLreader &pieceTagReader, const std::string dataName)
Reads from DataArray and fills blockData.
Definition vtiReader.hh:270
BaseVTIreader3D(const std::string &fileName, std::string dataName, const std::string class_name="BaseVTIreader3D", const DataType type=PointData)
Definition vtiReader.hh:171
std::vector< int > getNbNodes(std::vector< int > &extents)
Converts 4D (or 6D) extents vector into 2D (3D) nb_nodes vector.
Definition vtiReader.hh:133
std::vector< T > _origin
Definition vtiReader.h:99
BaseVTIreader(const std::string &fName, int dim, std::string dName, const std::string class_name="BaseVTIreader", const DataType type=PointData)
Definition vtiReader.hh:45
OstreamManager clout
Definition vtiReader.h:93
size_t computeTotalDataValues()
Computes the total amount of data values Number of components * number of cells/point.
Definition vtiReader.hh:159
std::vector< int > readExtent(const XMLreader *reader, std::string extAttrName)
Reads Extent from extAttrName from XML Tag and returns as vector.
Definition vtiReader.hh:118
int getNbComps(const XMLreader &tagReader)
Reads size from XML tag (attribute "NumberOfComponents") Reads the number of components from the XML ...
Definition vtiReader.hh:145
std::vector< int > _extent
Definition vtiReader.h:101
XMLreader _xmlReader
Definition vtiReader.h:103
unsigned getSize() const
Definition blockData.hh:118
U & get(std::size_t iCell, int iD=0)
Definition blockData.hh:94
int getNy() const
Read only access to block height.
int getNx() const
Read only access to block width.
int getNz() const
Read only access to block height.
bool isInside(LatticeR< D > latticeR) const
Return whether location is valid.
BlockData< 2, T, BaseType > _blockData
Definition vtiReader.h:238
Cuboid2D< T > & getCuboid()
Definition vtiReader.hh:598
BlockData< 2, T, BaseType > & getBlockData()
Definition vtiReader.hh:592
BlockVTIreader2D(const std::string &fileName, const std::string &dataName, const DataType type=PointData)
Definition vtiReader.hh:569
Cuboid3D< T > & getCuboid()
Definition vtiReader.hh:336
BlockData< 3, T, BaseType > _blockData
Definition vtiReader.h:151
BlockVTIreader3D(const std::string &fileName, const std::string &dataName, const DataType type=PointData)
Definition vtiReader.hh:306
BlockData< 3, T, BaseType > & getBlockData()
Definition vtiReader.hh:330
Constructs a load balancer from a given cuboid geometry using a heurist.
Base class for all LoadBalancer.
Definition vtiWriter.h:42
~SuperVTIreader3D() override
Definition vtiReader.hh:345
CuboidDecomposition3D< T > & getCuboidDecomposition()
Definition vtiReader.hh:424
LoadBalancer< T > & getLoadBalancer()
Definition vtiReader.hh:430
SuperData< 3, T, BaseType > & getSuperData()
Definition vtiReader.hh:418
SuperVTIreader3D(const std::string &fName, const std::string dName)
Definition vtiReader.hh:353
std::string getAttribute(const std::string &aName) const
Definition xmlReader.h:471
std::string getName() const
return the name of the element
Definition xmlReader.h:332
void exit(int exitcode)
Definition singleton.h:177
Top level namespace for all of OpenLB.
CuboidDecomposition< T, 3 > CuboidDecomposition3D
typename util::BaseTypeHelper< T >::type BaseType
Definition baseType.h:59
DataType
Definition vtiReader.h:80
@ PointData
Definition vtiReader.h:81
The VTI reader is able to read from VTI files and create and fill corresponding data structures.