12 #ifndef __OUTPUT4VTK_HEADER__
13 #define __OUTPUT4VTK_HEADER__
30 const string VTK_HEADER =
"# vtk DataFile Version 3.0";
31 const string VTK_ASCII =
"ASCII";
32 const string VTK_DATASET =
"DATASET";
33 const string VTK_UNSTRUCTURED_GRID =
"UNSTRUCTURED_GRID";
34 const string VTK_POINTS =
"POINTS";
35 const string VTK_CELLS =
"CELLS";
36 const string VTK_CELL_TYPES =
"CELL_TYPES";
37 const string VTK_CELL_DATA =
"CELL_DATA";
38 const string VTK_POINT_DATA =
"POINT_DATA";
39 const VTK_USI VTK_MAX_TITLE_LENGTH = 256;
40 const string VTK_LOOKUP_TABLE =
"LOOKUP_TABLE";
41 const string VTK_DEFAULT =
"default";
42 const string VTK_SCALARS =
"SCALARS";
45 const VTK_USI VTK_HEXAHEDRON = 12;
46 const VTK_USI VTK_POLY_LINE = 4;
48 const string VTK_FLOAT =
"float";
49 const string VTK_UNSIGNED_INT =
"unsigned_int";
56 void Init(
const string& myFile,
57 const string& shortInfo,
58 const string& myCodeWay,
59 const string& girdType,
62 void OutputPOINTS(
const string& myFile,
63 const vector<OCPpolyhedron>& myHexGrid,
64 const vector<OCPpolyhedron>& myHexWell,
65 const string& dataType)
const;
66 void OutputCELLS(
const string& myFile,
67 const vector<OCPpolyhedron>& myHexGrid,
68 const vector<OCPpolyhedron>& myHexWell)
const;
69 void OutputCELL_TYPES(
const string& myFile,
70 const vector<OCPpolyhedron>& myHex,
71 const vector<OCPpolyhedron>& myHexWell)
const;
73 void OutputCELL_DATA_SCALARS(
const string& myFile,
74 const string& dataName,
75 const string& dataType,
78 const vector<GB_Pair>& gbPair,
79 const bool& useActive,
80 const T* wellVal)
const;
81 void BeginCellData()
const { cellData =
true; };
84 mutable bool cellData{
false};
91 void Output4Vtk::OutputCELL_DATA_SCALARS(
const string& myFile,
92 const string& dataName,
93 const string& dataType,
96 const vector<GB_Pair>& gbPair,
97 const bool& useActive,
98 const T* wellVal)
const
101 myVtk.open(myFile, ios::app);
102 if (!myVtk.is_open()) {
103 OCP_ABORT(
"Can not open file: " + myFile);
106 ios::sync_with_stdio(
false);
110 myVtk << VTK_CELL_DATA <<
" " << numCell <<
"\n";
114 myVtk << VTK_SCALARS <<
" " << dataName <<
" " << dataType <<
" " << 1 <<
"\n";
115 myVtk << VTK_LOOKUP_TABLE <<
" " << VTK_DEFAULT <<
"\n";
119 for (VTK_USI n = 0; n < numGrid; n++) {
120 if (gbPair[n].IsAct()) {
121 myVtk << gridVal[gbPair[n].GetId() * gap] <<
"\n";
127 for (VTK_USI n = 0; n < numGrid; n++) {
128 myVtk << gridVal[n * gap] <<
"\n";
133 for (
USI w = 0; w < numWell; w++) {
134 myVtk << wellVal[w] <<
"\n";
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
float OCP_SIN
Single precision.
unsigned int OCP_USI
Long unsigned integer.
unsigned long long OCP_ULL
Long long unsigned integer.
#define OCP_ABORT(msg)
Abort if critical error happens.