/usr/include/vtk-7.1/vtkAMRFlashReaderInternal.h is in libvtk7-dev 7.1.1+dfsg1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | /*=========================================================================
Program: Visualization Toolkit
Module: vtkAMRFlashReaderInternal.hpp
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
/**
* @class vtkAMRFlashReaderInternal
*
*
* Consists of the low-level Flash Reader used by the vtkAMRFlashReader.
*
* @sa
* vtkAMRFlashReader
*/
#ifndef vtkAMRFlashReaderInternal_h
#define vtkAMRFlashReaderInternal_h
#include <cassert>
#include <vector>
#include <map>
#include <cstring>
#include <string>
#include "vtkSetGet.h"
#include "vtkDataSet.h"
#include "vtkObject.h"
#include "vtkDataArray.h"
#include "vtkDoubleArray.h"
#include "vtkIntArray.h"
#include "vtkCellData.h"
#include "vtkByteSwap.h"
#define H5_USE_16_API
#include "vtk_hdf5.h"
//==============================================================================
// I N T E R N A L F L A S H R E A D E R
//==============================================================================
#define FLASH_READER_MAX_DIMS 3
#define FLASH_READER_LEAF_BLOCK 1
#define FLASH_READER_FLASH3_FFV8 8
#define FLASH_READER_FLASH3_FFV9 9
typedef struct tagFlashReaderIntegerScalar
{
char Name[20]; // name of the integer scalar
int Value; // value of the integer scalar
} FlashReaderIntegerScalar;
typedef struct tagFlashReaderDoubleScalar
{
char Name[20]; // name of the real scalar
double Value; // value of the real scalar
} FlashReaderDoubleScalar;
typedef struct tagFlashReaderSimulationParameters
{
int NumberOfBlocks; // number of all blocks
int NumberOfTimeSteps; // number of time steps
int NumberOfXDivisions; // number of divisions per block along x axis
int NumberOfYDivisions; // number of divisions per block along y axis
int NumberOfZDivisions; // number of divisions per block along z axis
double Time; // the time of this step
double TimeStep; // time interval
double RedShift;
} FlashReaderSimulationParameters;
typedef struct tagBlock
{
int Index; // Id of the block
int Level; // LOD level
int Type; // a leaf block?
int ParentId; // Id of the parent block
int ChildrenIds[8]; // Ids of the children blocks
int NeighborIds[6]; // Ids of the neighboring blocks
int ProcessorId; // Id of the processor
int MinGlobalDivisionIds[3]; // first (global) division index
int MaxGlobalDivisionIds[3]; // last (global) division index
double Center[3]; // center of the block
double MinBounds[3]; // lower left of the bounding box
double MaxBounds[3]; // upper right of the bounding box
} Block;
typedef struct tagFlashReaderSimulationInformation
{
int FileFormatVersion;
char SetupCall[400];
char FileCreationTime[80];
char FlashVersion[80];
char BuildData[80];
char BuildDirectory[80];
char build_machine[80];
char CFlags[400];
char FFlags[400];
char SetupTimeStamp[80];
char BuildTimeStamp[80];
} FlashReaderSimulationInformation;
static std::string GetSeparatedParticleName( const std::string & variable )
{
std::string sepaName = variable;
if ( sepaName.length() > 9 && sepaName.substr(0,9) == "particle_" )
{
sepaName = std::string( "Particles/" ) + sepaName.substr( 9 );
}
else
{
sepaName = std::string( "Particles/" ) + sepaName;
}
return sepaName;
}
// ----------------------------------------------------------------------------
// Class vtkFlashReaderInternal (begin)
// ----------------------------------------------------------------------------
class vtkFlashReaderInternal
{
public:
vtkFlashReaderInternal() { this->Init(); }
~vtkFlashReaderInternal() { this->Init(); }
int NumberOfBlocks; // number of ALL blocks
int NumberOfLevels; // number of levels
int FileFormatVersion; // version of file format
int NumberOfParticles; // number of particles
int NumberOfLeafBlocks; // number of leaf blocks
int NumberOfDimensions; // number of dimensions
int NumberOfProcessors; // number of processors
int HaveProcessorsInfo; // processor Ids available?
int BlockGridDimensions[3]; // number of grid points
int BlockCellDimensions[3]; // number of divisions
int NumberOfChildrenPerBlock; // number of children per block
int NumberOfNeighborsPerBlock; // number of neighbors per block
char * FileName; // Flash data file name
hid_t FileIndex; // file handle
double MinBounds[3]; // lower left of the bounding-box
double MaxBounds[3]; // upper right of the bounding box
FlashReaderSimulationParameters SimulationParameters; // CFD simulation
FlashReaderSimulationInformation SimulationInformation; // CFD simulation
// blocks
std::vector< Block > Blocks;
std::vector< int > LeafBlocks;
std::vector< std::string > AttributeNames;
// particles
std::string ParticleName;
std::vector< hid_t > ParticleAttributeTypes;
std::vector< std::string > ParticleAttributeNames;
std::map< std::string, int > ParticleAttributeNamesToIds;
int GetCycle();
double GetTime();
void Init();
void SetFileName( char * fileName ) { this->FileName = fileName; }
const char* GetParticleName(char* variableName)
{
static std::string particleName;
particleName = GetSeparatedParticleName(std::string(variableName));
return particleName.c_str();
}
void ReadMetaData();
void ReadProcessorIds();
void ReadDoubleScalars( hid_t fileIndx );
void ReadIntegerScalars( hid_t fileIndx );
void ReadVersionInformation( hid_t fileIndx );
void ReadSimulationParameters
( hid_t fileIndx, bool bTmCycle = false ); // time and cycle only
void GetBlockMinMaxGlobalDivisionIds();
void ReadBlockTypes();
void ReadBlockBounds();
void ReadBlockCenters();
void ReadBlockStructures();
void ReadRefinementLevels();
void ReadDataAttributeNames();
void ReadParticlesComponent
( hid_t dataIndx, const char * compName, double * dataBuff );
void ReadParticleAttributes();
void ReadParticleAttributesFLASH3();
void GetBlockAttribute( const char *atribute, int blockIdx,
vtkDataSet *pDataSet );
};
// ----------------------------------------------------------------------------
// Class vtkFlashReaderInternal ( end )
// ----------------------------------------------------------------------------
#endif /* vtkAMRFlashReaderInternal_h */
// VTK-HeaderTest-Exclude: vtkAMRFlashReaderInternal.h
|