foamVtkInternalWriter.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2017-2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 #include "foamVtkInternalWriter.H"
29 #include "globalIndex.H"
30 
31 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 
34 
35 
36 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
37 
38 void Foam::vtk::internalWriter::beginPiece()
39 {
40  // Basic sizes
41 
42  numberOfPoints_ = vtuCells_.nFieldPoints(); // With addPointCellLabels
43  numberOfCells_ = vtuCells_.nFieldCells(); // With decomposed cells
44 
45  if (parallel_)
46  {
47  reduce(numberOfPoints_, sumOp<label>());
48  reduce(numberOfCells_, sumOp<label>());
49  }
50 
51  // Nothing else to do for legacy
52  if (legacy()) return;
53 
55  << "nPoints=" << numberOfPoints_ << " nCells=" << numberOfCells_ << nl;
56 
57  if (format_)
58  {
59  format()
60  .tag
61  (
63  vtk::fileAttr::NUMBER_OF_POINTS, numberOfPoints_,
64  vtk::fileAttr::NUMBER_OF_CELLS, numberOfCells_
65  );
66  }
67 }
68 
69 
70 void Foam::vtk::internalWriter::writePoints()
71 {
72  if (format_)
73  {
74  if (legacy())
75  {
76  legacy::beginPoints(os_, numberOfPoints_);
77  }
78  else
79  {
80  const uint64_t payLoad =
81  vtk::sizeofData<float,3>(numberOfPoints_);
82 
83  format()
85  .beginDataArray<float,3>(vtk::dataArrayAttr::POINTS);
86 
87  format().writeSize(payLoad);
88  }
89  }
90 
91 
92  if (parallel_)
93  {
95  (
96  format_.ref(),
97  mesh_.points(),
98  mesh_.cellCentres(),
99  vtuCells_.addPointCellLabels()
100  );
101  }
102  else
103  {
105  (
106  format(),
107  mesh_.points(),
108  mesh_.cellCentres(),
109  vtuCells_.addPointCellLabels()
110  );
111  }
112 
113 
114  if (format_)
115  {
116  format().flush();
117  format().endDataArray();
118 
119  if (!legacy())
120  {
121  format()
122  .endTag(vtk::fileTag::POINTS);
123  }
124  }
125 }
126 
127 
128 void Foam::vtk::internalWriter::writeCellsLegacy(const label pointOffset)
129 {
130  const List<uint8_t>& cellTypes = vtuCells_.cellTypes();
131  const labelList& vertLabels = vtuCells_.vertLabels();
132 
133  label nCells = cellTypes.size();
134  label nVerts = vertLabels.size();
135 
136  if (parallel_)
137  {
138  reduce(nCells, sumOp<label>());
139  reduce(nVerts, sumOp<label>());
140  }
141 
142  if (nCells != numberOfCells_)
143  {
145  << "Expecting " << numberOfCells_
146  << " cells, but found " << nCells
147  << exit(FatalError);
148  }
149 
150 
151  // CELLS
152  {
153  if (format_)
154  {
155  os_ << nl
156  << "CELLS " << nCells << ' ' << nVerts << nl;
157  }
158 
159  if (parallel_)
160  {
162  (
163  format_.ref(),
165  (
166  vertLabels,
167  pointOffset
168  )
169  );
170  }
171  else
172  {
173  vtk::writeList(format(), vertLabels);
174  }
175 
176  if (format_)
177  {
178  format().flush();
179  }
180  }
181 
182 
183  // CELL_TYPES
184  {
185  if (format_)
186  {
187  os_ << nl
188  << "CELL_TYPES " << nCells << nl;
189  }
190 
191  if (parallel_)
192  {
193  vtk::writeListParallel(format_.ref(), cellTypes);
194  }
195  else
196  {
198  }
199 
200  if (format_)
201  {
202  format().flush();
203  }
204  }
205 }
206 
207 
208 void Foam::vtk::internalWriter::writeCellsConnectivity(const label pointOffset)
209 {
210  //
211  // 'connectivity'
212  //
213  {
214  const labelList& vertLabels = vtuCells_.vertLabels();
215  label nVerts = vertLabels.size();
216 
217  if (parallel_)
218  {
219  reduce(nVerts, sumOp<label>());
220  }
221 
222  if (format_)
223  {
224  const uint64_t payLoad = vtk::sizeofData<label>(nVerts);
225 
226  format().beginDataArray<label>(vtk::dataArrayAttr::CONNECTIVITY);
227  format().writeSize(payLoad);
228  }
229 
230  if (parallel_)
231  {
233  (
234  format_.ref(),
236  (
237  vertLabels,
238  pointOffset
239  )
240  );
241  }
242  else
243  {
244  vtk::writeList(format(), vertLabels);
245  }
246 
247  if (format_)
248  {
249  format().flush();
250  format().endDataArray();
251  }
252  }
253 
254 
255  //
256  // 'offsets' (connectivity offsets)
257  //
258  {
259  const labelList& vertOffsets = vtuCells_.vertOffsets();
260  label nOffs = vertOffsets.size();
261 
262  if (parallel_)
263  {
264  reduce(nOffs, sumOp<label>());
265  }
266 
267  if (format_)
268  {
269  const uint64_t payLoad =
270  vtk::sizeofData<label>(nOffs);
271 
272  format().beginDataArray<label>(vtk::dataArrayAttr::OFFSETS);
273  format().writeSize(payLoad);
274  }
275 
276  if (parallel_)
277  {
278  // processor-local connectivity offsets
279  const globalIndex procOffset
280  (
281  vertOffsets.empty() ? 0 : vertOffsets.last()
282  );
283 
284  vtk::writeListParallel(format_.ref(), vertOffsets, procOffset);
285  }
286  else
287  {
288  vtk::writeList(format(), vertOffsets);
289  }
290 
291  if (format_)
292  {
293  format().flush();
294  format().endDataArray();
295  }
296  }
297 
298 
299  //
300  // 'types' (cell types)
301  //
302  {
303  const List<uint8_t>& cellTypes = vtuCells_.cellTypes();
304  label nCells = cellTypes.size();
305 
306  if (parallel_)
307  {
308  reduce(nCells, sumOp<label>());
309  }
310 
311  if (nCells != numberOfCells_)
312  {
314  << "Expecting " << numberOfCells_
315  << " cells, but found " << nCells
316  << exit(FatalError);
317  }
318 
319  if (format_)
320  {
321  const uint64_t payLoad =
322  vtk::sizeofData<uint8_t>(nCells);
323 
324  format().beginDataArray<uint8_t>(vtk::dataArrayAttr::TYPES);
325  format().writeSize(payLoad);
326  }
327 
328  if (parallel_)
329  {
330  vtk::writeListParallel(format_.ref(), cellTypes);
331  }
332  else
333  {
335  }
336 
337  if (format_)
338  {
339  format().flush();
340  format().endDataArray();
341  }
342  }
343 }
344 
345 
346 void Foam::vtk::internalWriter::writeCellsFaces(const label pointOffset)
347 {
348  label nFaceLabels = vtuCells_.faceLabels().size();
349 
350  if (parallel_)
351  {
352  reduce(nFaceLabels, sumOp<label>());
353  }
354 
355  // Can quit now if there are NO face streams
356  if (!nFaceLabels)
357  {
358  return;
359  }
360 
361  // --------------------------------------------------
362 
363  //
364  // 'faces' (face streams)
365  //
366  const labelList& faceLabels = vtuCells_.faceLabels();
367 
368  {
369  // Already have nFaceLabels (above)
370 
371  if (format_)
372  {
373  const uint64_t payLoad =
374  vtk::sizeofData<label>(nFaceLabels);
375 
376  format().beginDataArray<label>(vtk::dataArrayAttr::FACES);
377  format().writeSize(payLoad);
378  }
379 
380 
381  if (parallel_)
382  {
384  (
385  format_.ref(),
387  (
388  faceLabels,
389  pointOffset
390  )
391  );
392  }
393  else
394  {
395  vtk::writeList(format(), faceLabels);
396  }
397 
398 
399  if (format_)
400  {
401  format().flush();
402  format().endDataArray();
403  }
404  }
405 
406  // 'faceoffsets' (face stream offsets)
407  // -1 to indicate that the cell is a primitive type that does not
408  // have a face stream
409 
410  // If the processor-local mesh has any polyhedrals, we have a list with
411  // the faceoffsets and we just need to renumber.
412  // If the processor-local mesh has NO polyhedrals (but others do), we
413  // need to generate a list of -1 for that processor.
414  //
415  // Result: A face offset value for each cell.
416  {
417  const labelList& faceOffsets = vtuCells_.faceOffsets();
418  const label nLocalCells = vtuCells_.cellTypes().size();
419 
420  label nCells = nLocalCells;
421 
422  if (parallel_)
423  {
424  reduce(nCells, sumOp<label>());
425  }
426 
427  if (format_)
428  {
429  const uint64_t payLoad =
430  vtk::sizeofData<label>(nCells);
431 
432  format().beginDataArray<label>(vtk::dataArrayAttr::FACEOFFSETS);
433  format().writeSize(payLoad);
434  }
435 
436 
437  if (parallel_)
438  {
439  const List<uint8_t>& cellTypes = vtuCells_.cellTypes();
440  const label nLocalCells = cellTypes.size();
441 
442  const globalIndex procOffset(faceLabels.size());
443 
444  labelList faceOffsetsRenumber;
445 
446  if (faceOffsets.size()) // Or check procOffset.localSize()
447  {
448  faceOffsetsRenumber =
450  (
451  faceOffsets,
452  procOffset.localStart()
453  );
454  }
455  else
456  {
457  faceOffsetsRenumber.resize(nLocalCells, -1);
458  }
459 
460  vtk::writeListParallel(format_.ref(), faceOffsetsRenumber);
461  }
462  else
463  {
464  vtk::writeList(format(), faceOffsets);
465  }
466 
467 
468  if (format_)
469  {
470  format().flush();
471  format().endDataArray();
472  }
473  }
474 }
475 
476 
477 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
478 
479 Foam::vtk::internalWriter::internalWriter
480 (
481  const fvMesh& mesh,
482  const vtk::vtuCells& cells,
483  const vtk::outputOptions opts
484 )
485 :
487  mesh_(mesh),
488  vtuCells_(cells),
489  numberOfPoints_(0),
490  numberOfCells_(0)
491 {
492  // We do not currently support append mode
493  opts_.append(false);
494 }
495 
496 
497 Foam::vtk::internalWriter::internalWriter
498 (
499  const fvMesh& mesh,
500  const vtk::vtuCells& cells,
501  const fileName& file,
502  bool parallel
503 )
504 :
506 {
507  open(file, parallel);
508 }
509 
510 
511 Foam::vtk::internalWriter::internalWriter
512 (
513  const fvMesh& mesh,
514  const vtk::vtuCells& cells,
515  const vtk::outputOptions opts,
516  const fileName& file,
517  bool parallel
518 )
519 :
520  internalWriter(mesh, cells, opts)
521 {
522  open(file, parallel);
523 }
524 
525 
526 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
527 
529 {
530  if (title.size())
531  {
532  return vtk::fileWriter::beginFile(title);
533  }
534 
535  // Provide default title
536 
538  << "case=" << mesh_.time().caseName()
539  << " region=" << mesh_.name()
540  << " time=" << mesh_.time().timeName()
541  << " index=" << mesh_.time().timeIndex() << endl;
542 
543 
544  if (legacy())
545  {
547  (
548  mesh_.time().globalCaseName()
549  );
550  }
551 
552 
553  // XML (inline)
554 
556  (
557  "case='" + mesh_.time().globalCaseName()
558  + "' region='" + mesh_.name()
559  + "' time='" + mesh_.time().timeName()
560  + "' index='" + Foam::name(mesh_.time().timeIndex())
561  + "'"
562  );
563 }
564 
565 
567 {
568  enter_Piece();
569 
570  beginPiece();
571 
572  writePoints();
573 
574  // Include addPointCellLabels for the point offsets
575  const label pointOffset =
576  (
577  parallel_ ? globalIndex(vtuCells_.nFieldPoints()).localStart() : 0
578  );
579 
580  if (legacy())
581  {
582  writeCellsLegacy(pointOffset);
583  return true;
584  }
585 
586  if (format_)
587  {
589  }
590 
591  writeCellsConnectivity(pointOffset);
592  writeCellsFaces(pointOffset);
593 
594  if (format_)
595  {
596  format().endTag(vtk::fileTag::CELLS);
597  }
598 
599  return true;
600 }
601 
602 
604 {
605  return enter_CellData(numberOfCells_, nFields);
606 }
607 
608 
610 {
611  return enter_PointData(numberOfPoints_, nFields);
612 }
613 
614 
616 {
617  if (isState(outputState::CELL_DATA))
618  {
619  ++nCellData_;
620  }
621  else
622  {
624  << "Bad writer state (" << stateNames[state_]
625  << ") - should be (" << stateNames[outputState::CELL_DATA]
626  << ") for cellID field" << nl << endl
627  << exit(FatalError);
628  }
629 
630  const labelList& cellMap = vtuCells_.cellMap();
631 
632  if (format_)
633  {
634  if (legacy())
635  {
636  vtk::legacy::intField<1>(format(), "cellID", numberOfCells_);
637  }
638  else
639  {
640  const uint64_t payLoad = vtk::sizeofData<label>(numberOfCells_);
641 
642  format().beginDataArray<label>("cellID");
643  format().writeSize(payLoad);
644  }
645  }
646 
647 
648  if (parallel_)
649  {
650  // With decomposed cells for the cell offsets
651  const globalIndex globalCellOffset(vtuCells_.nFieldCells());
652 
653  vtk::writeListParallel(format_.ref(), cellMap, globalCellOffset);
654  }
655  else
656  {
657  vtk::writeList(format(), cellMap);
658  }
659 
660  if (format_)
661  {
662  format().flush();
663  format().endDataArray();
664  }
665 }
666 
667 
669 {
670  if (!parallel_)
671  {
672  // Disabled in serial output (meaningless)
673  return false;
674  }
675 
676  if (isState(outputState::CELL_DATA))
677  {
678  ++nCellData_;
679  }
680  else
681  {
683  << "Bad writer state (" << stateNames[state_]
684  << ") - should be (" << stateNames[outputState::CELL_DATA]
685  << ") for procID field" << nl << endl
686  << exit(FatalError);
687  }
688 
689  const globalIndex procMaps(vtuCells_.nFieldCells());
690 
691  bool good = false;
692 
693  if (Pstream::master())
694  {
695  const label nCells = procMaps.size();
696 
697  if (format_)
698  {
699  if (legacy())
700  {
701  vtk::legacy::intField<1>(format(), "procID", nCells);
702  }
703  else
704  {
705  const uint64_t payLoad =
706  vtk::sizeofData<label>(nCells);
707 
708  format().beginDataArray<label>("procID");
709  format().writeSize(payLoad);
710  }
711  }
712 
713  // Per-processor ids
714  for (label proci=0; proci < Pstream::nProcs(); ++proci)
715  {
716  vtk::write(format(), proci, procMaps.localSize(proci));
717  }
718 
719  format().flush();
720  format().endDataArray();
721 
722  good = true;
723  }
724 
725  // MPI barrier
726  return returnReduce(good, orOp<bool>());
727 }
728 
729 
731 {
732  if (isState(outputState::POINT_DATA))
733  {
734  ++nPointData_;
735  }
736  else
737  {
739  << "Bad writer state (" << stateNames[state_]
740  << ") - should be (" << stateNames[outputState::POINT_DATA]
741  << ") for pointID field" << nl << endl
742  << exit(FatalError);
743  }
744 
745  if (format_)
746  {
747  if (legacy())
748  {
749  vtk::legacy::intField<1>(format(), "pointID", numberOfPoints_);
750  }
751  else
752  {
753  const uint64_t payLoad = vtk::sizeofData<label>(numberOfPoints_);
754 
755  format().beginDataArray<label>("pointID");
756  format().writeSize(payLoad);
757  }
758  }
759 
760 
761  // Point offset for regular mesh points (without decomposed)
762  const label pointOffset =
763  (
764  parallel_ ? globalIndex(vtuCells_.nPoints()).localStart() : 0
765  );
766 
767  // Cell offset for *regular* mesh cells (without decomposed)
768  const label cellOffset =
769  (
770  parallel_ ? globalIndex(vtuCells_.nCells()).localStart() : 0
771  );
772 
773 
774  labelList pointIds = identity(vtuCells_.nFieldPoints(), pointOffset);
775 
776  // The pointID for added points is the cellID, tag as a negative number
777  label pointi = vtuCells_.nPoints();
778  for (const label celli : vtuCells_.addPointCellLabels())
779  {
780  pointIds[pointi] = (-1 - celli - cellOffset);
781  ++pointi;
782  }
783 
784  if (parallel_)
785  {
786  vtk::writeListParallel(format_.ref(), pointIds);
787  }
788  else
789  {
790  vtk::writeList(format(), pointIds);
791  }
792 
793  if (format_)
794  {
795  format().flush();
796  format().endDataArray();
797  }
798 }
799 
800 
801 // ************************************************************************* //
Foam::vtk::outputOptions
Encapsulated combinations of output format options. This is primarily useful when defining the output...
Definition: foamVtkOutputOptions.H:59
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:74
Foam::vtk::writeListParallel
void writeListParallel(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
Definition: foamVtkOutput.C:126
Foam::vtk::fileWriter
Base class for VTK output writers that handle geometry and fields (eg, vtp, vtu data)....
Definition: foamVtkFileWriter.H:66
Foam::vtk::fileWriter::legacy
bool legacy() const
Commonly used query.
Definition: foamVtkFileWriterI.H:74
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::returnReduce
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
Definition: PstreamReduceOps.H:94
Foam::vtk::internalWriter::beginFile
virtual bool beginFile(std::string title="")
Write file header (non-collective)
Definition: foamVtkInternalWriter.C:528
Foam::vtk::dataArrayAttr::OFFSETS
"offsets"
internalWriter
autoPtr< vtk::internalWriter > internalWriter
Definition: convertProcessorPatches.H:60
globalIndex.H
Foam::UPstream::nProcs
static label nProcs(const label communicator=0)
Number of processes in parallel run.
Definition: UPstream.H:426
Foam::vtk::fileWriter::beginFile
virtual bool beginFile(std::string title="")
Write file header (non-collective)
Definition: foamVtkFileWriter.C:317
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:337
Foam::vtk::writeListsParallel
void writeListsParallel(vtk::formatter &fmt, const UList< Type > &values1, const UList< Type > &values2)
Write a list of values and another list of values.
Definition: foamVtkOutputTemplates.C:255
Foam::vtk::dataArrayAttr::FACES
"faces"
Foam::vtk::internalWriter::writeProcIDs
bool writeProcIDs()
Write processor ids as CellData. This is no-op in serial.
Definition: foamVtkInternalWriter.C:668
Foam::vtk::fileWriter::format_
autoPtr< vtk::formatter > format_
The VTK formatter in use (master process)
Definition: foamVtkFileWriter.H:110
Foam::vtk::vtuSizing::copyVertLabelsLegacy
static labelList copyVertLabelsLegacy(const labelUList &connectivity, const label globalPointOffset)
Copy vertex labels with a global point offset - legacy format.
Definition: foamVtuSizing.C:520
Foam::vtk::fileTag::CELLS
"Cells"
format
word format(conversionProperties.get< word >("format"))
Foam::vtk::vtuSizing::nFieldCells
label nFieldCells() const
Number of field cells = nCells + nAddCells.
Definition: foamVtuSizingI.H:92
Foam::reduce
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
Definition: PstreamReduceOps.H:51
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::vtk::internalWriter::writeCellIDs
void writeCellIDs()
Write cell ids as CellData.
Definition: foamVtkInternalWriter.C:615
Foam::vtk::internalWriter::beginCellData
virtual bool beginCellData(label nFields=0)
Begin CellData output section for specified number of fields.
Definition: foamVtkInternalWriter.C:603
DebugInFunction
#define DebugInFunction
Report an information message using Foam::Info.
Definition: messageStream.H:356
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::vtk::fileAttr::NUMBER_OF_POINTS
"NumberOfPoints"
Foam::vtk::writeList
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
Definition: foamVtkOutput.C:112
Foam::vtk::writeLists
void writeLists(vtk::formatter &fmt, const UList< Type > &values1, const UList< Type > &values2, const labelUList &addressing)
Write a list of values and a list of values via indirect addressing.
Definition: foamVtkOutputTemplates.C:113
Foam::vtk::legacy::beginPoints
void beginPoints(std::ostream &os, label nPoints)
Emit header for POINTS (with trailing newline).
Definition: foamVtkOutputI.H:113
Foam::List::resize
void resize(const label newSize)
Adjust allocated size of list.
Definition: ListI.H:139
Foam::vtk::fileAttr::NUMBER_OF_CELLS
"NumberOfCells"
Foam::vtk::fileWriter::parallel_
bool parallel_
Writing in parallel (via master)
Definition: foamVtkFileWriter.H:95
Foam::vtk::vtuSizing::nFieldPoints
label nFieldPoints() const
Number of field points = nPoints + nAddPoints.
Definition: foamVtuSizingI.H:98
Foam::FatalError
error FatalError
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::vtk::fileTag::POINTS
"Points"
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:84
Foam::vtk::internalWriter::writePointIDs
void writePointIDs()
Write point ids as PointData.
Definition: foamVtkInternalWriter.C:730
Foam::globalIndex
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
Definition: globalIndex.H:68
Foam::vtk::fileTag::POINT_DATA
"PointData"
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::UPstream::master
static bool master(const label communicator=0)
Am I the master process.
Definition: UPstream.H:438
Foam::vtk::dataArrayAttr::TYPES
"types"
Foam::vtk::fileTag::UNSTRUCTURED_GRID
"UnstructuredGrid"
Foam::vtk::vtuSizing::copyVertLabelsXml
static labelList copyVertLabelsXml(const labelUList &connectivity, const label globalPointOffset)
Copy vertex labels with a global point offset - XML format.
Definition: foamVtuSizing.C:603
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:355
cellTypes
const labelList & cellTypes
Definition: setCellMask.H:33
Foam::vtk::internalWriter::debug
static int debug
Debug information.
Definition: foamVtkInternalWriter.H:121
Foam::nl
constexpr char nl
Definition: Ostream.H:372
Foam::vtk::vtuSizing::copyFaceOffsetsXml
static labelList copyFaceOffsetsXml(const labelUList &faceOffsets, const label prevOffset)
Copy face offsets with an offset from previous - XML format.
Definition: foamVtuSizing.C:697
Foam::vtk::dataArrayAttr::FACEOFFSETS
"faceoffsets"
Foam::globalIndex::size
label size() const
Global sum of localSizes.
Definition: globalIndexI.H:88
Foam::vtk::formatter::tag
formatter & tag(const word &t, Args &&... args)
Write XML tag without any attributes. Combines openTag/closeTag.
Foam::List< label >
Foam::vtk::vtuSizing::copyFaceLabelsXml
static labelList copyFaceLabelsXml(const labelUList &faceLabels, const label globalPointOffset)
Copy faces stream labels with a global point offset - XML format.
Definition: foamVtuSizing.C:642
Foam::vtk::internalWriter::beginPointData
virtual bool beginPointData(label nFields=0)
Begin PointData for specified number of fields.
Definition: foamVtkInternalWriter.C:609
Foam::vtk::vtuCells
A deep-copy description of an OpenFOAM volume mesh in data structures suitable for VTK UnstructuredGr...
Definition: foamVtuCells.H:74
Foam::identity
labelList identity(const label len, label start=0)
Create identity map of the given length with (map[i] == i)
Definition: labelList.C:38
Foam::vtk::write
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Definition: foamVtkOutputTemplates.C:35
Foam::vtk::dataArrayAttr::CONNECTIVITY
"connectivity"
Foam::vtk::fileTag::CELL_DATA
"CellData"
Foam::vtk::fileTag::PIECE
"Piece"
foamVtkInternalWriter.H
Foam::vtk::fileWriter::format
vtk::formatter & format()
The VTK formatter in use.
Definition: foamVtkFileWriterI.H:36
cells
const cellShapeList & cells
Definition: gmvOutputHeader.H:3
Foam::orOp
Definition: ops.H:234
Foam::vtk::internalWriter::writeGeometry
virtual bool writeGeometry()
Write mesh topology.
Definition: foamVtkInternalWriter.C:566