vtkWrite.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-2020 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 "vtkWrite.H"
29 #include "dictionary.H"
30 #include "Time.H"
31 #include "areaFields.H"
32 #include "stringListOps.H"
33 #include "foamVtkInternalWriter.H"
34 #include "foamVtkPatchWriter.H"
35 #include "foamVtkSeriesWriter.H"
36 #include "foamVtmWriter.H"
38 
39 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 namespace functionObjects
44 {
45  defineTypeNameAndDebug(vtkWrite, 0);
46  addToRunTimeSelectionTable(functionObject, vtkWrite, dictionary);
47 }
48 }
49 
50 
51 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
52 
53 Foam::label Foam::functionObjects::vtkWrite::writeAllVolFields
54 (
55  autoPtr<vtk::internalWriter>& internalWriter,
56  UPtrList<vtk::patchWriter>& patchWriters,
57  const fvMeshSubset& proxy,
58  const wordHashSet& acceptField
59 ) const
60 {
61  #undef vtkWrite_WRITE_FIELD
62  #define vtkWrite_WRITE_FIELD(FieldType) \
63  writeVolFields<FieldType> \
64  ( \
65  internalWriter, \
66  patchWriters, \
67  proxy, \
68  acceptField \
69  )
70 
71 
72  label count = 0;
78 
79  #undef vtkWrite_WRITE_FIELD
80  return count;
81 }
82 
83 
84 Foam::label Foam::functionObjects::vtkWrite::writeAllVolFields
85 (
86  autoPtr<vtk::internalWriter>& internalWriter,
87  const autoPtr<volPointInterpolation>& pInterp,
88 
89  UPtrList<vtk::patchWriter>& patchWriters,
90  const UPtrList<PrimitivePatchInterpolation<primitivePatch>>& patchInterps,
91  const fvMeshSubset& proxy,
92  const wordHashSet& acceptField
93 ) const
94 {
95  #undef vtkWrite_WRITE_FIELD
96  #define vtkWrite_WRITE_FIELD(FieldType) \
97  writeVolFields<FieldType> \
98  ( \
99  internalWriter, pInterp, \
100  patchWriters, patchInterps, \
101  proxy, \
102  acceptField \
103  )
104 
105 
106  label count = 0;
112 
113  #undef vtkWrite_WRITE_FIELD
114  return count;
115 }
116 
117 
118 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
119 
120 Foam::functionObjects::vtkWrite::vtkWrite
121 (
122  const word& name,
123  const Time& runTime,
124  const dictionary& dict
125 )
126 :
128  outputDir_(),
129  printf_(),
130  writeOpts_(vtk::formatType::INLINE_BASE64),
131  verbose_(true),
132  doInternal_(true),
133  doBoundary_(true),
134  oneBoundary_(false),
135  interpolate_(false),
136  decompose_(false),
137  writeIds_(false),
138  meshState_(polyMesh::TOPO_CHANGE),
139  selectRegions_(),
140  selectPatches_(),
141  selectFields_(),
142  selection_(),
143  meshes_(),
144  meshSubsets_(),
145  vtuMappings_(),
146  series_()
147 {
148  // May still want this? (OCT-2018)
149  // if (postProcess)
150  // {
151  // // Disable for post-process mode.
152  // // Emit as FatalError for the try/catch in the caller.
153  // FatalError
154  // << type() << " disabled in post-process mode"
155  // << exit(FatalError);
156  // }
157 
158  read(dict);
159 }
160 
161 
162 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
163 
165 {
167 
168  readSelection(dict);
169 
170  // We probably cannot trust old information after a reread
171  series_.clear();
172 
173  // verbose_ = dict.getOrDefault("verbose", true);
174  doInternal_ = dict.getOrDefault("internal", true);
175  doBoundary_ = dict.getOrDefault("boundary", true);
176  oneBoundary_ = dict.getOrDefault("single", false);
177  interpolate_ = dict.getOrDefault("interpolate", false);
178 
179  //
180  // Writer options - default is xml base64
181  //
182  writeOpts_ = vtk::formatType::INLINE_BASE64;
183 
184  writeOpts_.ascii
185  (
188  );
189 
190  writeOpts_.legacy(dict.getOrDefault("legacy", false));
191 
192  writeOpts_.precision
193  (
194  dict.getOrDefault("precision", IOstream::defaultPrecision())
195  );
196 
197  // Info<< type() << " " << name() << " output-format: "
198  // << writeOpts_.description() << nl;
199 
200  const int padWidth = dict.getOrDefault<int>("width", 8);
201 
202  // Appropriate printf format - Enforce min/max sanity limits
203  if (padWidth < 1 || padWidth > 31)
204  {
205  printf_.clear();
206  }
207  else
208  {
209  printf_ = "%0" + std::to_string(padWidth) + "d";
210  }
211 
212  //
213  // Other options
214  //
215 
216  decompose_ = dict.getOrDefault("decompose", false);
217  writeIds_ = dict.getOrDefault("writeIds", false);
218 
219 
220  // Output directory
221 
222  outputDir_.clear();
223  dict.readIfPresent("directory", outputDir_);
224 
225  if (outputDir_.size())
226  {
227  // User-defined output directory
228  outputDir_.expand();
229  if (!outputDir_.isAbsolute())
230  {
231  outputDir_ = time_.globalPath()/outputDir_;
232  }
233  }
234  else
235  {
236  // Standard postProcessing/ naming
237  outputDir_ = time_.globalPath()/functionObject::outputPrefix/name();
238  }
239  outputDir_.clean();
240 
241  return true;
242 }
243 
244 
246 {
247  return true;
248 }
249 
250 
252 {
253  // const word timeDesc =
254  // useTimeName ? time_.timeName() : Foam::name(time_.timeIndex());
255 
256  const word timeDesc = "_" +
257  (
258  printf_.empty()
259  ? Foam::name(time_.timeIndex())
260  : word::printf(printf_, time_.timeIndex())
261  );
262 
263  const scalar timeValue = time_.value();
264 
265  update();
266 
267  if (meshes_.empty() || (!doInternal_ && !doBoundary_))
268  {
269  // Skip
270  return true;
271  }
272 
273 
274  fileName vtkName = time_.globalCaseName();
275 
276  vtk::vtmWriter vtmMultiRegion;
277 
278  Info<< name() << " output Time: " << time_.timeName() << nl;
279 
280  label regioni = 0;
281  for (const word& regionName : meshes_.sortedToc())
282  {
283  fileName regionPrefix;
285  {
286  regionPrefix = regionName;
287  }
288 
289  auto& meshProxy = meshSubsets_[regioni];
290  auto& vtuMeshCells = vtuMappings_[regioni];
291  ++regioni;
292 
293  const fvMesh& baseMesh = meshProxy.baseMesh();
294 
295  wordHashSet acceptField(baseMesh.names<void>(selectFields_));
296 
297  // Prune restart fields
298  acceptField.filterKeys
299  (
300  [](const word& k){ return k.ends_with("_0"); },
301  true // prune
302  );
303 
304  const label nVolFields =
305  (
306  (doInternal_ || doBoundary_)
307  ? baseMesh.count
308  (
310  acceptField
311  )
312  : 0
313  );
314 
315  // Undecided if we want to automatically support DimensionedFields
316  // or only on demand:
317  const label nDimFields = 0;
318  // (
319  // (doInternal_ || doBoundary_)
320  // ? baseMesh.count
321  // (
322  // stringListOps::foundOp<word>(fieldTypes::internal),
323  // acceptField
324  // )
325  // : 0
326  // );
327 
328 
329  // Setup for the vtm writer.
330  // For legacy format, the information added is simply ignored.
331 
333  (
334  outputDir_/regionPrefix/vtkName + timeDesc
335  );
336 
337  // Combined internal + boundary in a vtm file
339 
340  // Collect individual boundaries into a vtm file
342 
343  // Setup the internal writer
345 
346  // Interpolator for volume and dimensioned fields
348 
349  if (doInternal_)
350  {
351  if (interpolate_)
352  {
353  pInterp.reset(new volPointInterpolation(meshProxy.mesh()));
354  }
355 
356  if (vtuMeshCells.empty())
357  {
358  // Use the appropriate mesh (baseMesh or subMesh)
359  vtuMeshCells.reset(meshProxy.mesh());
360  }
361 
363  (
364  meshProxy.mesh(),
365  vtuMeshCells,
366  writeOpts_,
367  // Output name for internal
368  (
369  writeOpts_.legacy()
370  ? vtmOutputBase
371  : (vtmOutputBase / "internal")
372  ),
374  );
375 
376  Info<< " Internal : "
377  << time_.relativePath(internalWriter->output())
378  << endl;
379 
380  // No sub-block for internal
381  vtmWriter.append_vtu
382  (
383  "internal",
384  vtmOutputBase.name()/"internal"
385  );
386 
387  internalWriter->writeTimeValue(timeValue);
388  internalWriter->writeGeometry();
389  }
390 
391 
392  // Setup the patch writers
393 
394  const polyBoundaryMesh& patches = meshProxy.mesh().boundaryMesh();
395 
398 
400  if (doBoundary_)
401  {
402  patchIds = getSelectedPatches(patches);
403  }
404 
405  if (oneBoundary_ && patchIds.size())
406  {
408  (
409  meshProxy.mesh(),
410  patchIds,
411  writeOpts_,
412  // Output name for one patch: "boundary"
413  (
414  writeOpts_.legacy()
415  ? (outputDir_/regionPrefix/"boundary"/"boundary" + timeDesc)
416  : (vtmOutputBase / "boundary")
417  ),
419  );
420 
421  // No sub-block for one-patch
422  vtmWriter.append_vtp
423  (
424  "boundary",
425  vtmOutputBase.name()/"boundary"
426  );
427 
428  Info<< " Boundaries: "
429  << time_.relativePath(writer->output()) << nl;
430 
431 
432  writer->writeTimeValue(timeValue);
433  writer->writeGeometry();
434 
435  // Transfer writer to list for later use
436  patchWriters.resize(1);
437  patchWriters.set(0, writer);
438 
439  // Avoid patchInterpolation for each sub-patch
440  patchInterps.resize(1); // == nullptr
441  }
442  else if (patchIds.size())
443  {
444  patchWriters.resize(patchIds.size());
445  if (interpolate_)
446  {
447  patchInterps.resize(patchIds.size());
448  }
449 
450  label nPatchWriters = 0;
451  label nPatchInterps = 0;
452 
453  for (const label patchId : patchIds)
454  {
455  const polyPatch& pp = patches[patchId];
456 
458  (
459  meshProxy.mesh(),
460  labelList(one{}, pp.index()),
461  writeOpts_,
462  // Output name for patch: "boundary"/name
463  (
464  writeOpts_.legacy()
465  ?
466  (
467  outputDir_/regionPrefix/pp.name()
468  / (pp.name()) + timeDesc
469  )
470  : (vtmOutputBase / "boundary" / pp.name())
471  ),
473  );
474 
475  if (!nPatchWriters)
476  {
477  vtmWriter.beginBlock("boundary");
478  vtmBoundaries.beginBlock("boundary");
479  }
480 
481  vtmWriter.append_vtp
482  (
483  pp.name(),
484  vtmOutputBase.name()/"boundary"/pp.name()
485  );
486 
487  vtmBoundaries.append_vtp
488  (
489  pp.name(),
490  "boundary"/pp.name()
491  );
492 
493  Info<< " Boundary : "
494  << time_.relativePath(writer->output()) << nl;
495 
496  writer->writeTimeValue(timeValue);
497  writer->writeGeometry();
498 
499  // Transfer writer to list for later use
501 
502  if (patchInterps.size())
503  {
504  patchInterps.set
505  (
506  nPatchInterps++,
508  );
509  }
510  }
511 
512  if (nPatchWriters)
513  {
514  vtmWriter.endBlock("boundary");
515  vtmBoundaries.endBlock("boundary");
516  }
517 
518  patchWriters.resize(nPatchWriters);
519  patchInterps.resize(nPatchInterps);
520  }
521 
522  // CellData
523  {
524  if (internalWriter)
525  {
526  // Optionally with cellID and procID fields
527  internalWriter->beginCellData
528  (
529  (writeIds_ ? 1 + (internalWriter->parallel() ? 1 : 0) : 0)
531  );
532 
533  if (writeIds_)
534  {
535  internalWriter->writeCellIDs();
536  internalWriter->writeProcIDs(); // parallel only
537  }
538  }
539 
540  if (nVolFields)
541  {
543  {
544  // Optionally with patchID field
545  writer.beginCellData
546  (
547  (writeIds_ ? 1 : 0)
548  + nVolFields
549  );
550 
551  if (writeIds_)
552  {
553  writer.writePatchIDs();
554  }
555  }
556  }
557 
559  (
561  patchWriters,
562  meshProxy,
563  acceptField
564  );
565 
566  // writeAllDimFields
567  // (
568  // internalWriter,
569  // meshProxy,
570  // acceptField
571  // );
572 
573  // End CellData is implicit
574  }
575 
576 
577  // PointData
578  // - only construct pointMesh on request since it constructs
579  // edge addressing
580  if (interpolate_)
581  {
582  // Begin PointData
583  if (internalWriter)
584  {
585  internalWriter->beginPointData
586  (
588  );
589  }
590 
591  forAll(patchWriters, writeri)
592  {
593  const label nPatchFields =
594  (
595  writeri < patchInterps.size() && patchInterps.set(writeri)
596  ? nVolFields
597  : 0
598  );
599 
600  if (nPatchFields)
601  {
602  patchWriters[writeri].beginPointData(nPatchFields);
603  }
604  }
605 
607  (
610  meshProxy,
611  acceptField
612  );
613 
614  // writeAllDimFields
615  // (
616  // internalWriter, pInterp,
617  // meshProxy,
618  // acceptField
619  // );
620 
621  // writeAllPointFields
622  // (
623  // internalWriter,
624  // patchWriters,
625  // meshProxy,
626  // acceptField
627  // );
628 
629  // End PointData is implicit
630  }
631 
632 
633  // Finish writers
634  if (internalWriter)
635  {
636  internalWriter->close();
637  }
638 
640  {
641  writer.close();
642  }
643 
644  pInterp.clear();
645  patchWriters.clear();
646  patchInterps.clear();
647 
648 
649  // Collective output
650 
651  if (Pstream::master())
652  {
653  // Naming for vtm, file series etc.
654  fileName outputName(vtmOutputBase);
655 
656  if (writeOpts_.legacy())
657  {
658  if (doInternal_)
659  {
660  // Add to file-series and emit as JSON
661 
662  outputName.ext(vtk::legacy::fileExtension);
663 
664  fileName seriesName(vtk::seriesWriter::base(outputName));
665 
666  vtk::seriesWriter& series = series_(seriesName);
667 
668  // First time?
669  // Load from file, verify against filesystem,
670  // prune time >= currentTime
671  if (series.empty())
672  {
673  series.load(seriesName, true, timeValue);
674  }
675 
676  series.append(timeValue, timeDesc);
677  series.write(seriesName);
678  }
679  }
680  else
681  {
682  if (vtmWriter.size())
683  {
684  // Emit ".vtm"
685 
686  outputName.ext(vtmWriter.ext());
687 
688  vtmWriter.setTime(timeValue);
689  vtmWriter.write(outputName);
690 
691  fileName seriesName(vtk::seriesWriter::base(outputName));
692 
693  vtk::seriesWriter& series = series_(seriesName);
694 
695  // First time?
696  // Load from file, verify against filesystem,
697  // prune time >= currentTime
698  if (series.empty())
699  {
700  series.load(seriesName, true, timeValue);
701  }
702 
703  series.append(timeValue, outputName);
704  series.write(seriesName);
705 
706  // Add to multi-region vtm
707  vtmMultiRegion.add(regionName, regionPrefix, vtmWriter);
708  }
709 
710  if (vtmBoundaries.size())
711  {
712  // Emit "boundary.vtm" with collection of boundaries
713 
714  // Naming for vtm
715  fileName outputName(vtmOutputBase / "boundary");
716  outputName.ext(vtmBoundaries.ext());
717 
718  vtmBoundaries.setTime(timeValue);
719  vtmBoundaries.write(outputName);
720  }
721  }
722  }
723  }
724 
725 
726  // Emit multi-region vtm
727  if (Pstream::master() && meshes_.size() > 1)
728  {
729  fileName outputName
730  (
731  outputDir_/vtkName + "-regions" + timeDesc + ".vtm"
732  );
733 
734  vtmMultiRegion.setTime(timeValue);
735  vtmMultiRegion.write(outputName);
736 
737  fileName seriesName(vtk::seriesWriter::base(outputName));
738 
739  vtk::seriesWriter& series = series_(seriesName);
740 
741  // First time?
742  // Load from file, verify against filesystem,
743  // prune time >= currentTime
744  if (series.empty())
745  {
746  series.load(seriesName, true, timeValue);
747  }
748 
749  series.append(timeValue, outputName);
750  series.write(seriesName);
751  }
752 
753  return true;
754 }
755 
756 
758 {
759  meshSubsets_.clear();
760  vtuMappings_.clear();
761  meshes_.clear();
762 
763  return true;
764 }
765 
766 
767 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::vtk::vtmWriter::setTime
void setTime(scalar timeValue)
Define "TimeValue" for FieldData (name as per Catalyst output)
Definition: foamVtmWriter.C:375
Foam::volTensorField
GeometricField< tensor, fvPatchField, volMesh > volTensorField
Definition: volFieldsFwd.H:66
Foam::vtk::vtmWriter::add
void add(const word &blockName, const vtmWriter &other)
Definition: foamVtmWriter.C:572
vtmWriter
vtk::vtmWriter vtmWriter
Definition: convertVolumeFields.H:72
Foam::functionObjects::vtkWrite::end
virtual bool end()
On end - cleanup internal allocations.
Definition: vtkWrite.C:757
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::functionObjects::vtkWrite::execute
virtual bool execute()
Execute - does nothing.
Definition: vtkWrite.C:245
vtkWrite_WRITE_FIELD
#define vtkWrite_WRITE_FIELD(FieldType)
vtkWrite.H
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::vtk::seriesWriter::base
static fileName base(const fileName &outputName, char sep='_')
Extract the base name for a file series.
Definition: foamVtkSeriesWriter.C:94
Foam::vtk::legacy::fileExtension
const word fileExtension
Legacy file extension ("vtk")
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:62
Foam::polyMesh::defaultRegion
static word defaultRegion
Return the default region name.
Definition: polyMesh.H:318
update
mesh update()
Foam::stringListOps::foundOp
Functor to determine if a string is exists in a list of strings.
Definition: stringListOps.H:335
Foam::functionObjects::vtkWrite::read
virtual bool read(const dictionary &dict)
Read the vtkWrite specification.
Definition: vtkWrite.C:164
internalWriter
autoPtr< vtk::internalWriter > internalWriter
Definition: convertProcessorPatches.H:60
Foam::read
bool read(const char *buf, int32_t &val)
Same as readInt32.
Definition: int32.H:108
Foam::UPstream::parRun
static bool & parRun()
Test if this a parallel run, or allow modify access.
Definition: UPstream.H:434
Foam::functionObjects::timeFunctionObject
Virtual base class for function objects with a reference to Time.
Definition: timeFunctionObject.H:56
vtmOutputBase
fileName vtmOutputBase(outputDir/regionPrefix/vtkName+timeDesc)
vtmBoundaries
vtk::vtmWriter vtmBoundaries
Definition: convertVolumeFields.H:75
Foam::one
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
Definition: one.H:61
Foam::UPstream::master
static bool master(const label communicator=worldComm)
Am I the master process.
Definition: UPstream.H:458
patchWriters
PtrList< vtk::patchWriter > patchWriters
Definition: convertProcessorPatches.H:63
Foam::functionObjects::vtkWrite::write
virtual bool write()
Write fields.
Definition: vtkWrite.C:251
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
Foam::fieldTypes::volume
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
Foam::HashSet< word >
foamVtmWriter.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
patchIds
labelList patchIds
Definition: convertProcessorPatches.H:67
Foam::volSymmTensorField
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Definition: volFieldsFwd.H:65
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::vtk::vtmWriter::write
label write(const fileName &file)
Definition: foamVtmWriter.C:581
Foam::writeAllVolFields
label writeAllVolFields(ensightCase &ensCase, const ensightMesh &ensMesh, const IOobjectList &objects, const bool nearCellValue=false)
Definition: writeVolFields.H:133
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
Foam::polyMesh::TOPO_CHANGE
Definition: polyMesh.H:94
Foam::functionObject::read
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
Definition: functionObject.C:137
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:352
foamVtkSeriesWriter.H
Foam::vtk::seriesWriter::load
label load(const fileName &seriesName, const bool checkFiles=false, const scalar restartTime=ROOTVGREAT)
Clear contents and reload by parsing the specified file.
Definition: foamVtkSeriesWriter.C:369
areaFields.H
Foam::HashTable::filterKeys
label filterKeys(const UnaryPredicate &pred, const bool pruning=false)
Generalized means to filter table entries based on their keys.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam::vtk::formatType::INLINE_BASE64
XML inline base64, base64Formatter.
Foam::writer
Base class for graphics format writing. Entry points are.
Definition: writer.H:80
Foam::vtk::seriesWriter
Provides a means of accumulating and generating VTK file series.
Definition: foamVtkSeriesWriter.H:75
Foam::vtk::seriesWriter::write
static void write(const fileName &base, const UList< instant > &series, const char sep='_')
Write file series (JSON format) to disk, for specified instances.
Definition: foamVtkSeriesWriter.C:236
Foam::fileName::ext
word ext() const
Return file name extension (part after last .)
Definition: fileNameI.H:228
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:83
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
nDimFields
const label nDimFields
Definition: convertVolumeFields.H:44
foamVtkPatchWriter.H
Foam::vtk::patchWriter
Write OpenFOAM patches and patch fields in VTP or legacy vtk format.
Definition: foamVtkPatchWriter.H:68
Foam::volVectorField
GeometricField< vector, fvPatchField, volMesh > volVectorField
Definition: volFieldsFwd.H:62
Time.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::vtk::vtmWriter
Provides a means of accumulating file entries for generating a vtkMultiBlockDataSet (....
Definition: foamVtmWriter.H:91
Foam::IOstreamOption::BINARY
"binary"
Definition: IOstreamOption.H:73
nPatchWriters
label nPatchWriters
Definition: convertProcessorPatches.H:85
Foam::IOstreamOption::ASCII
"ascii" (normal default)
Definition: IOstreamOption.H:72
Foam::PrimitivePatchInterpolation
Interpolation class within a primitive patch. Allows interpolation from points to faces and vice vers...
Definition: PrimitivePatchInterpolation.H:53
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::IOstream::defaultPrecision
static unsigned int defaultPrecision()
Return the default precision.
Definition: IOstream.H:333
Foam::objectRegistry::names
wordList names() const
The names of all objects.
Definition: objectRegistry.C:164
Foam::functionObjects::addToRunTimeSelectionTable
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
Foam::BitOps::count
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Definition: BitOps.H:77
Foam::IOstreamOption::formatEnum
static streamFormat formatEnum(const word &formatName, const streamFormat deflt=streamFormat::ASCII)
Definition: IOstreamOption.C:53
Foam::List< label >
Foam::vtk::seriesWriter::empty
bool empty() const noexcept
True if there are no data sets.
Definition: foamVtkSeriesWriterI.H:30
k
label k
Boltzmann constant.
Definition: LISASMDCalcMethod2.H:41
dictionary.H
Foam::functionObjects::defineTypeNameAndDebug
defineTypeNameAndDebug(ObukhovLength, 0)
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::wordHashSet
HashSet< word > wordHashSet
A HashSet with word keys.
Definition: HashSet.H:406
Foam::word::printf
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
foamVtkInternalWriter.H
stringListOps.H
Operations on lists of strings.
Foam::vtk::seriesWriter::append
bool append(const fileNameInstant &inst)
Append the specified file instant.
Definition: foamVtkSeriesWriterI.H:49
patchId
label patchId(-1)
Foam::volSphericalTensorField
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
Definition: volFieldsFwd.H:64
Foam::objectRegistry::count
label count(const char *clsName) const
The number of objects of the given class name.
Definition: objectRegistry.C:157
Foam::patchIdentifier::name
const word & name() const
The patch name.
Definition: patchIdentifier.H:134
Foam::volPointInterpolation
Interpolate from cell centres to points (vertices) using inverse distance weighting.
Definition: volPointInterpolation.H:59
Foam::patchIdentifier::index
label index() const
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:158
patchInterps
PtrList< PrimitivePatchInterpolation< primitivePatch > > patchInterps
Definition: convertVolumeFields.H:130
nVolFields
const label nVolFields
Definition: convertProcessorPatches.H:39
pInterp
autoPtr< volPointInterpolation > pInterp
Definition: convertVolumeFields.H:81