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-2021 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(); // Remove unneeded ".."
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  const word& regionDir =
284  (
286  );
287 
288  auto& meshProxy = meshSubsets_[regioni];
289  auto& vtuMeshCells = vtuMappings_[regioni];
290  ++regioni;
291 
292  const fvMesh& baseMesh = meshProxy.baseMesh();
293 
294  wordHashSet acceptField(baseMesh.names<void>(selectFields_));
295 
296  // Prune restart fields
297  acceptField.filterKeys
298  (
299  [](const word& k){ return k.ends_with("_0"); },
300  true // prune
301  );
302 
303  const label nVolFields =
304  (
305  (doInternal_ || doBoundary_)
306  ? baseMesh.count
307  (
309  acceptField
310  )
311  : 0
312  );
313 
314  // Undecided if we want to automatically support DimensionedFields
315  // or only on demand:
316  const label nDimFields = 0;
317  // (
318  // (doInternal_ || doBoundary_)
319  // ? baseMesh.count
320  // (
321  // stringListOps::foundOp<word>(fieldTypes::internal),
322  // acceptField
323  // )
324  // : 0
325  // );
326 
327 
328  // Setup for the vtm writer.
329  // For legacy format, the information added is simply ignored.
330 
332  (
333  outputDir_/regionDir/vtkName + timeDesc
334  );
335 
336  // Combined internal + boundary in a vtm file
338 
339  // Collect individual boundaries into a vtm file
341 
342  // Setup the internal writer
344 
345  // Interpolator for volume and dimensioned fields
347 
348  if (doInternal_)
349  {
350  if (interpolate_)
351  {
352  pInterp.reset(new volPointInterpolation(meshProxy.mesh()));
353  }
354 
355  if (vtuMeshCells.empty())
356  {
357  // Use the appropriate mesh (baseMesh or subMesh)
358  vtuMeshCells.reset(meshProxy.mesh());
359  }
360 
362  (
363  meshProxy.mesh(),
364  vtuMeshCells,
365  writeOpts_,
366  // Output name for internal
367  (
368  writeOpts_.legacy()
369  ? vtmOutputBase
370  : (vtmOutputBase / "internal")
371  ),
373  );
374 
375  Info<< " Internal : "
376  << time_.relativePath(internalWriter->output())
377  << endl;
378 
379  // No sub-block for internal
380  vtmWriter.append_vtu
381  (
382  "internal",
383  vtmOutputBase.name()/"internal"
384  );
385 
386  internalWriter->writeTimeValue(timeValue);
387  internalWriter->writeGeometry();
388  }
389 
390 
391  // Setup the patch writers
392 
393  const polyBoundaryMesh& patches = meshProxy.mesh().boundaryMesh();
394 
397 
399  if (doBoundary_)
400  {
401  patchIds = getSelectedPatches(patches);
402  }
403 
404  if (oneBoundary_ && patchIds.size())
405  {
407  (
408  meshProxy.mesh(),
409  patchIds,
410  writeOpts_,
411  // Output name for one patch: "boundary"
412  (
413  writeOpts_.legacy()
414  ? (outputDir_/regionDir/"boundary"/"boundary" + timeDesc)
415  : (vtmOutputBase / "boundary")
416  ),
418  );
419 
420  // No sub-block for one-patch
421  vtmWriter.append_vtp
422  (
423  "boundary",
424  vtmOutputBase.name()/"boundary"
425  );
426 
427  Info<< " Boundaries: "
428  << time_.relativePath(writer->output()) << nl;
429 
430 
431  writer->writeTimeValue(timeValue);
432  writer->writeGeometry();
433 
434  // Transfer writer to list for later use
435  patchWriters.resize(1);
436  patchWriters.set(0, writer);
437 
438  // Avoid patchInterpolation for each sub-patch
439  patchInterps.resize(1); // == nullptr
440  }
441  else if (patchIds.size())
442  {
443  patchWriters.resize(patchIds.size());
444  if (interpolate_)
445  {
446  patchInterps.resize(patchIds.size());
447  }
448 
449  label nPatchWriters = 0;
450  label nPatchInterps = 0;
451 
452  for (const label patchId : patchIds)
453  {
454  const polyPatch& pp = patches[patchId];
455 
457  (
458  meshProxy.mesh(),
459  labelList(one{}, pp.index()),
460  writeOpts_,
461  // Output name for patch: "boundary"/name
462  (
463  writeOpts_.legacy()
464  ?
465  (
466  outputDir_/regionDir/pp.name()
467  / (pp.name()) + timeDesc
468  )
469  : (vtmOutputBase / "boundary" / pp.name())
470  ),
472  );
473 
474  if (!nPatchWriters)
475  {
476  vtmWriter.beginBlock("boundary");
477  vtmBoundaries.beginBlock("boundary");
478  }
479 
480  vtmWriter.append_vtp
481  (
482  pp.name(),
483  vtmOutputBase.name()/"boundary"/pp.name()
484  );
485 
486  vtmBoundaries.append_vtp
487  (
488  pp.name(),
489  "boundary"/pp.name()
490  );
491 
492  Info<< " Boundary : "
493  << time_.relativePath(writer->output()) << nl;
494 
495  writer->writeTimeValue(timeValue);
496  writer->writeGeometry();
497 
498  // Transfer writer to list for later use
500 
501  if (patchInterps.size())
502  {
503  patchInterps.set
504  (
505  nPatchInterps++,
507  );
508  }
509  }
510 
511  if (nPatchWriters)
512  {
513  vtmWriter.endBlock("boundary");
514  vtmBoundaries.endBlock("boundary");
515  }
516 
517  patchWriters.resize(nPatchWriters);
518  patchInterps.resize(nPatchInterps);
519  }
520 
521  // CellData
522  {
523  if (internalWriter)
524  {
525  // Optionally with cellID and procID fields
526  internalWriter->beginCellData
527  (
528  (writeIds_ ? 1 + (internalWriter->parallel() ? 1 : 0) : 0)
530  );
531 
532  if (writeIds_)
533  {
534  internalWriter->writeCellIDs();
535  internalWriter->writeProcIDs(); // parallel only
536  }
537  }
538 
539  if (nVolFields)
540  {
542  {
543  // Optionally with patchID field
544  writer.beginCellData
545  (
546  (writeIds_ ? 1 : 0)
547  + nVolFields
548  );
549 
550  if (writeIds_)
551  {
552  writer.writePatchIDs();
553  }
554  }
555  }
556 
558  (
560  patchWriters,
561  meshProxy,
562  acceptField
563  );
564 
565  // writeAllDimFields
566  // (
567  // internalWriter,
568  // meshProxy,
569  // acceptField
570  // );
571 
572  // End CellData is implicit
573  }
574 
575 
576  // PointData
577  // - only construct pointMesh on request since it constructs
578  // edge addressing
579  if (interpolate_)
580  {
581  // Begin PointData
582  if (internalWriter)
583  {
584  internalWriter->beginPointData
585  (
587  );
588  }
589 
590  forAll(patchWriters, writeri)
591  {
592  const label nPatchFields =
593  (
594  writeri < patchInterps.size() && patchInterps.set(writeri)
595  ? nVolFields
596  : 0
597  );
598 
599  if (nPatchFields)
600  {
601  patchWriters[writeri].beginPointData(nPatchFields);
602  }
603  }
604 
606  (
609  meshProxy,
610  acceptField
611  );
612 
613  // writeAllDimFields
614  // (
615  // internalWriter, pInterp,
616  // meshProxy,
617  // acceptField
618  // );
619 
620  // writeAllPointFields
621  // (
622  // internalWriter,
623  // patchWriters,
624  // meshProxy,
625  // acceptField
626  // );
627 
628  // End PointData is implicit
629  }
630 
631 
632  // Finish writers
633  if (internalWriter)
634  {
635  internalWriter->close();
636  }
637 
639  {
640  writer.close();
641  }
642 
643  pInterp.clear();
644  patchWriters.clear();
645  patchInterps.clear();
646 
647 
648  // Collective output
649 
650  if (Pstream::master())
651  {
652  // Naming for vtm, file series etc.
654 
655  if (writeOpts_.legacy())
656  {
657  if (doInternal_)
658  {
659  // Add to file-series and emit as JSON
660 
662 
664 
665  vtk::seriesWriter& series = series_(seriesName);
666 
667  // First time?
668  // Load from file, verify against filesystem,
669  // prune time >= currentTime
670  if (series.empty())
671  {
672  series.load(seriesName, true, timeValue);
673  }
674 
675  series.append(timeValue, timeDesc);
676  series.write(seriesName);
677  }
678  }
679  else
680  {
681  if (vtmWriter.size())
682  {
683  // Emit ".vtm"
684 
685  outputName.ext(vtmWriter.ext());
686 
687  vtmWriter.setTime(timeValue);
688  vtmWriter.write(outputName);
689 
691 
692  vtk::seriesWriter& series = series_(seriesName);
693 
694  // First time?
695  // Load from file, verify against filesystem,
696  // prune time >= currentTime
697  if (series.empty())
698  {
699  series.load(seriesName, true, timeValue);
700  }
701 
702  series.append(timeValue, outputName);
703  series.write(seriesName);
704 
705  // Add to multi-region vtm
706  vtmMultiRegion.add(regionName, regionDir, vtmWriter);
707  }
708 
709  if (vtmBoundaries.size())
710  {
711  // Emit "boundary.vtm" with collection of boundaries
712 
713  // Naming for vtm
714  fileName outputName(vtmOutputBase / "boundary");
715  outputName.ext(vtmBoundaries.ext());
716 
717  vtmBoundaries.setTime(timeValue);
718  vtmBoundaries.write(outputName);
719  }
720  }
721  }
722  }
723 
724 
725  // Emit multi-region vtm
726  if (Pstream::master() && meshes_.size() > 1)
727  {
729  (
730  outputDir_/vtkName + "-regions" + timeDesc + ".vtm"
731  );
732 
733  vtmMultiRegion.setTime(timeValue);
734  vtmMultiRegion.write(outputName);
735 
737 
738  vtk::seriesWriter& series = series_(seriesName);
739 
740  // First time?
741  // Load from file, verify against filesystem,
742  // prune time >= currentTime
743  if (series.empty())
744  {
745  series.load(seriesName, true, timeValue);
746  }
747 
748  series.append(timeValue, outputName);
749  series.write(seriesName);
750  }
751 
752  return true;
753 }
754 
755 
757 {
758  meshSubsets_.clear();
759  vtuMappings_.clear();
760  meshes_.clear();
761 
762  return true;
763 }
764 
765 
766 // ************************************************************************* //
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:67
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:756
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:65
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:73
Foam::vtk::seriesWriter::base
static fileName base(const fileName &outputName, char sep='_')
Extract the base name for a file series.
Definition: foamVtkSeriesWriter.C:91
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:63
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:345
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::functionObjects::timeFunctionObject
Virtual base class for function objects with a reference to Time.
Definition: timeFunctionObject.H:56
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:457
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:369
Foam::fieldTypes::volume
const wordList volume
Standard volume field types (scalar, vector, tensor, etc)
vtmOutputBase
fileName vtmOutputBase(outputDir/regionDir/vtkName+timeDesc)
Foam::HashSet< word, Hash< word > >
foamVtmWriter.H
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
outputName
word outputName("finiteArea-edges.obj")
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 (stdout output on master, null elsewhere)
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
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:126
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
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:163
Foam::volScalarField
GeometricField< scalar, fvPatchField, volMesh > volScalarField
Definition: volFieldsFwd.H:57
Foam::functionObject::outputPrefix
static word outputPrefix
Directory prefix.
Definition: functionObject.H:376
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:366
areaFields.H
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:123
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:81
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:233
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchIdentifier::index
label index() const noexcept
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:147
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
Foam::IOstream::defaultPrecision
static unsigned int defaultPrecision() noexcept
Return the default precision.
Definition: IOstream.H:342
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:404
Foam::objectRegistry::names
wordList names() const
The names of all objects.
Definition: objectRegistry.C:147
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::UPstream::parRun
static bool & parRun() noexcept
Test if this a parallel run.
Definition: UPstream.H:433
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)
Foam::word::null
static const word null
An empty word.
Definition: word.H:80
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::wordHashSet
HashSet< word, Hash< word > > wordHashSet
A HashSet of words, uses string hasher.
Definition: HashSet.H:77
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
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::patchIdentifier::name
const word & name() const noexcept
The patch name.
Definition: patchIdentifier.H:135
Foam::volSphericalTensorField
GeometricField< sphericalTensor, fvPatchField, volMesh > volSphericalTensorField
Definition: volFieldsFwd.H:64
regionDir
const word & regionDir
Definition: findMeshDefinitionDict.H:34
Foam::objectRegistry::count
label count(const char *clsName) const
The number of objects of the given class name.
Definition: objectRegistry.C:140
Foam::volPointInterpolation
Interpolate from cell centres to points (vertices) using inverse distance weighting.
Definition: volPointInterpolation.H:59
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