Peano 4
Loading...
Searching...
No Matches
VTKBinaryFileWriter_CellWriter.cpp
Go to the documentation of this file.
3
4
6 _currentCellNumber(0),
7 _myWriter(writer),
8 _cellListEntries(0),
9 _cellOut(),
10 _cellTypeOut() {
13}
14
15
21
22
24 assertion( _currentCellNumber>=0 );
25 assertion( _cellListEntries>=0 );
26
27 _currentCellNumber++;
28 _cellListEntries += 2;
29
30 int tmp;
31 tmp = 1;
33 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
34 tmp = vertexIndex;
36 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
37
38 tmp = 1;
40 _cellTypeOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
41
42 return _currentCellNumber-1;
43}
44
45
47 assertion( _currentCellNumber>=0 );
48 assertion( _cellListEntries>=0 );
49
50 _currentCellNumber++;
51 _cellListEntries += 9;
52
53 int tmp;
54 tmp = 8;
56 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
57 for (int i=0; i<8; i++) {
58 for (int j=i+1; j<8; j++) assertion(vertexIndex[i] != vertexIndex[j]);
59 tmp = vertexIndex[i];
61 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
62 }
63
64 tmp = 11;
66 _cellTypeOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
67
68 return _currentCellNumber-1;
69}
70
71
73 assertion( _currentCellNumber>=0 );
74 assertion( _cellListEntries>=0 );
75
76 _currentCellNumber++;
77 _cellListEntries += 5;
78
79 int tmp;
80 tmp = 4;
82 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
83 for (int i=0; i<4; i++) {
84 for (int j=i+1; j<4; j++) assertion(vertexIndex[i] != vertexIndex[j]);
85 tmp = vertexIndex[i];
87 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
88 }
89
90 tmp = 8;
92 _cellTypeOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
93
94 return _currentCellNumber-1;
95}
96
97
99 assertion( _currentCellNumber>=0 );
100 assertion( _cellListEntries>=0 );
101
102 _currentCellNumber++;
103 _cellListEntries += 3;
104
105 int tmp;
106 tmp = 2;
108 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
109 for (int i=0; i<2; i++) {
110 tmp = vertexIndex[i];
112 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
113 }
114
115 tmp = 3;
117 _cellTypeOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
118
119 return _currentCellNumber-1;
120}
121
122
124 assertion( _currentCellNumber>=0 );
125 assertion( _cellListEntries>=0 );
126
127 _currentCellNumber++;
128 _cellListEntries += 4;
129
130 int tmp;
131 tmp = 3;
133 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
134 for (int i=0; i<3; i++) {
135 tmp = vertexIndex[i];
137 _cellOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
138 }
139
140 tmp = 5;
142 _cellTypeOut.write( reinterpret_cast<char*>(&tmp) , sizeof(tmp));
143
144 return _currentCellNumber-1;
145}
146
147
149 assertion( _myWriter._numberOfCells==0 );
150 assertion( _myWriter._numberOfCellEntries==0 );
151 assertionMsg( _myWriter.isOpen(), "Maybe you forgot to call close() on a data writer before you destroy your writer?" );
152
153 _myWriter._numberOfCells = _currentCellNumber;
154 _myWriter._numberOfCellEntries = _cellListEntries;
155
156 _myWriter._cellDescription << _cellOut.str();
157 _myWriter._cellTypeDescription << _cellTypeOut.str();
158
159 _currentCellNumber = -1;
160 _cellListEntries = -1;
161}
#define assertionMsg(expr, message)
#define assertion(expr)
And from this we can write down f$ nabla phi_i nabla phi_i dx but since we are constructing matrix let s investigate the f$ j
InType byteSwapForParaviewBinaryFiles(const InType inVal)
Conditional swap.
Definition ByteSwap.cpph:20