foamToVTK.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Application
28  foamToVTK
29 
30 Group
31  grpPostProcessingUtilities
32 
33 Description
34  General OpenFOAM to VTK file writer.
35 
36  Other bits
37  - Handles volFields, pointFields, surfaceScalarField, surfaceVectorField
38  fields.
39  - Mesh topo changes.
40  - Output legacy or xml VTK format in ascii or binary.
41  - Single time step writing.
42  - Write subset only.
43  - Optional decomposition of cells.
44 
45 Usage
46  \b foamToVTK [OPTION]
47 
48  Options:
49  - \par -ascii
50  Write VTK data in ASCII format instead of binary.
51 
52  - \par -legacy
53  Write VTK data in legacy format instead of XML format
54 
55  - \par -fields <fields>
56  Specify single or multiple fields to write (all by default)
57  For example,
58  \verbatim
59  -fields T
60  -fields '(p T U \"alpha.*\")'
61  \endverbatim
62  The quoting is required to avoid shell expansions and to pass the
63  information as a single argument.
64 
65  - \par -surfaceFields
66  Write surfaceScalarFields (e.g., phi)
67 
68  - \par -cellSet <name>
69  - \par -cellZone <name>
70  Restrict conversion to either the cellSet or the cellZone.
71 
72  - \par -faceSet <name>
73  - \par -pointSet <name>
74  Restrict conversion to the faceSet or pointSet.
75 
76  - \par -faceZones zone or zone list
77  Specify single faceZone or or multiple faceZones (name or regex)
78  to write
79 
80  - \par -nearCellValue
81  Output cell value on patches instead of patch value itself
82 
83  - \par -no-boundary
84  Suppress output for all boundary patches
85 
86  - \par -no-internal
87  Suppress output for internal (volume) mesh
88 
89  - \par -no-lagrangian
90  Suppress writing Lagrangian positions and fields.
91 
92  - \par -no-point-data
93  Suppress conversion of pointFields. No interpolated PointData.
94 
95  - \par -with-ids
96  Additional mesh id fields (cellID, procID, patchID)
97 
98  - \par -with-point-ids
99  Additional pointID field for internal mesh
100 
101  - \par -poly-decomp
102  Decompose polyhedral cells into tets/pyramids
103 
104  - \par -one-boundary
105  Combine all patches into a single boundary file
106 
107  - \par -patches NAME | LIST
108  Specify single patch or multiple patches (name or regex) to write
109  For example,
110  \verbatim
111  -patches top
112  -patches '( front \".*back\" )'
113  \endverbatim
114 
115  - \par -excludePatches NAME | LIST
116  Exclude single or multiple patches (name or regex) from writing.
117  For example,
118  \verbatim
119  -excludePatches '( inlet_1 inlet_2 "proc.*")'
120  \endverbatim
121 
122 Note
123  The mesh subset is handled by fvMeshSubsetProxy. Slight inconsistency in
124  interpolation: on the internal field it interpolates the whole volField
125  to the whole-mesh pointField and then selects only those values it
126  needs for the subMesh (using the fvMeshSubset cellMap(), pointMap()
127  functions). For the patches however it uses the
128  fvMeshSubset.interpolate function to directly interpolate the
129  whole-mesh values onto the subset patch.
130 
131 \*---------------------------------------------------------------------------*/
132 
133 #include "fvCFD.H"
134 #include "pointMesh.H"
135 #include "emptyPolyPatch.H"
136 #include "volPointInterpolation.H"
137 #include "faceZoneMesh.H"
138 #include "areaFields.H"
139 #include "fvMeshSubsetProxy.H"
140 #include "faceSet.H"
141 #include "pointSet.H"
142 #include "HashOps.H"
143 #include "regionProperties.H"
144 #include "stringListOps.H"
145 
146 #include "Cloud.H"
147 #include "readFields.H"
148 #include "reportFields.H"
149 
150 #include "foamVtmWriter.H"
151 #include "foamVtkInternalWriter.H"
152 #include "foamVtkPatchWriter.H"
154 #include "foamVtkLagrangianWriter.H"
156 #include "foamVtkWriteTopoSet.H"
157 #include "foamVtkSeriesWriter.H"
158 
159 #include "writeAreaFields.H"
160 #include "writeDimFields.H"
161 #include "writeVolFields.H"
162 #include "writePointFields.H"
163 
164 #include "memInfo.H"
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 labelList getSelectedPatches
169 (
170  const polyBoundaryMesh& patches,
171  const wordRes& allow,
172  const wordRes& deny
173 )
174 {
175  // Name-based selection
176  labelList indices
177  (
179  (
180  patches,
181  allow,
182  deny,
183  nameOp<polyPatch>()
184  )
185  );
186 
187 
188  // Remove undesirable patches
189 
190  label count = 0;
191  for (const label patchi : indices)
192  {
193  const polyPatch& pp = patches[patchi];
194 
195  if (isType<emptyPolyPatch>(pp))
196  {
197  continue;
198  }
199  else if (Pstream::parRun() && bool(isA<processorPolyPatch>(pp)))
200  {
201  break; // No processor patches for parallel output
202  }
203 
204  indices[count] = patchi;
205  ++count;
206  }
207 
208  indices.resize(count);
209 
210  return indices;
211 }
212 
213 
214 //
215 // Process args for output options (-ascii, -legacy)
216 //
217 vtk::outputOptions getOutputOptions(const argList& args)
218 {
219  // Default is inline ASCII xml
220  vtk::outputOptions opts;
221 
222  if (args.found("legacy"))
223  {
224  opts.legacy(true);
225 
226  if (!args.found("ascii"))
227  {
228  if (sizeof(floatScalar) != 4 || sizeof(label) != 4)
229  {
230  opts.ascii(true);
231 
233  << "Using ASCII rather than legacy binary VTK format since "
234  << "floatScalar and/or label are not 4 bytes in size."
235  << nl << endl;
236  }
237  else
238  {
239  opts.ascii(false);
240  }
241  }
242  }
243  else
244  {
245  opts.ascii(args.found("ascii"));
246  }
247 
248  return opts;
249 }
250 
251 
252 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
253 
254 int main(int argc, char *argv[])
255 {
256  argList::addNote
257  (
258  "General OpenFOAM to VTK file writer"
259  );
260  timeSelector::addOptions();
261 
262  // Less frequently used - reduce some clutter
263  argList::setAdvanced("decomposeParDict");
264  argList::setAdvanced("noFunctionObjects");
265 
266  argList::addBoolOption
267  (
268  "ascii",
269  "Write in ASCII format instead of binary"
270  );
271  argList::addBoolOption
272  (
273  "legacy",
274  "Write legacy format instead of xml",
275  true // mark as an advanced option
276  );
277  argList::addBoolOption
278  (
279  "poly-decomp",
280  "Decompose polyhedral cells into tets/pyramids",
281  true // mark as an advanced option
282  );
283  argList::ignoreOptionCompat
284  (
285  {"xml", 1806}, // xml is now default, use -legacy to toggle
286  false // bool option, no argument
287  );
288  argList::ignoreOptionCompat
289  (
290  {"poly", 1806}, // poly is now default, use -poly-decomp to toggle
291  false // bool option, no argument
292  );
293 
294  argList::addOption
295  (
296  "cellSet",
297  "name",
298  "Convert mesh subset corresponding to specified cellSet",
299  true // mark as an advanced option
300  );
301  argList::addOption
302  (
303  "cellZone",
304  "name",
305  "Convert mesh subset corresponding to specified cellZone",
306  true // mark as an advanced option
307  );
308  argList::addOption
309  (
310  "faceSet",
311  "name",
312  "Convert specified faceSet only",
313  true // mark as an advanced option
314  );
315  argList::addOption
316  (
317  "pointSet",
318  "name",
319  "Convert specified pointSet only",
320  true // mark as an advanced option
321  );
322  argList::addOption
323  (
324  "faceZones",
325  "wordRes",
326  "Specify single or multiple faceZones to write\n"
327  "Eg, 'cells' or '( slice \"mfp-.*\" )'.",
328  true // mark as an advanced option
329  );
330 
331  argList::addOption
332  (
333  "fields",
334  "wordRes",
335  "Specify single or multiple fields to write (all by default)\n"
336  "Eg, 'T' or '(p T U \"alpha.*\")'"
337  );
338 
339  argList::addBoolOption
340  (
341  "processor-fields",
342  "Write field values on processor boundaries only",
343  true // mark as an advanced option
344  );
345  argList::addBoolOption
346  (
347  "surfaceFields",
348  "Write surfaceScalarFields (eg, phi)",
349  true // mark as an advanced option
350  );
351  argList::addBoolOption
352  (
353  "finiteAreaFields",
354  "Write finite area fields",
355  true // mark as an advanced option
356  );
357  argList::addBoolOption
358  (
359  "nearCellValue",
360  "Use cell value on patches instead of patch value itself",
361  true // mark as an advanced option
362  );
363  argList::addBoolOption
364  (
365  "no-boundary",
366  "Suppress output for boundary patches"
367  );
368  argList::addBoolOption
369  (
370  "no-internal",
371  "Suppress output for internal volume mesh"
372  );
373  argList::addBoolOption
374  (
375  "no-lagrangian", // noLagrangian
376  "Suppress writing lagrangian positions and fields"
377  );
378  argList::addOptionCompat("no-lagrangian", {"noLagrangian", 1806});
379 
380  argList::addBoolOption
381  (
382  "no-point-data", // noPointValues
383  "Suppress conversion of pointFields. No interpolated PointData."
384  );
385  argList::addOptionCompat("no-point-data", {"noPointValues", 1806});
386 
387  argList::addBoolOption
388  (
389  "with-ids",
390  "Additional mesh id fields (cellID, procID, patchID)",
391  true // mark as an advanced option
392  );
393 
394  argList::addBoolOption
395  (
396  "with-point-ids",
397  "Additional pointID field for internal mesh",
398  true // mark as an advanced option
399  );
400 
401  argList::addBoolOption
402  (
403  "one-boundary", // allPatches
404  "Combine all patches into a single file"
405  );
406  argList::addOptionCompat("one-boundary", {"allPatches", 1806});
407 
408  #include "addRegionOption.H"
409 
410  argList::addOption
411  (
412  "regions",
413  "wordRes",
414  "Operate on selected regions from regionProperties.\n"
415  "Eg, '( gas \"solid.*\" )'"
416  );
417  argList::addBoolOption
418  (
419  "allRegions",
420  "Operate on all regions in regionProperties"
421  );
422 
423  argList::addOption
424  (
425  "patches",
426  "wordRes",
427  "Specify single patch or multiple patches to write\n"
428  "Eg, 'top' or '( front \".*back\" )'"
429  );
430  argList::addOption
431  (
432  "excludePatches",
433  "wordRes",
434  "Exclude single or multiple patches from writing\n"
435  "Eg, 'outlet' or '( inlet \".*Wall\" )'",
436  true // mark as an advanced option
437  );
438  argList::ignoreOptionCompat
439  (
440  {"noFaceZones", 1806}, // faceZones are only enabled on demand
441  false // bool option, no argument
442  );
443  argList::ignoreOptionCompat
444  (
445  {"noLinks", 1806}, // ignore never make any links
446  false // bool option, no argument
447  );
448  argList::ignoreOptionCompat
449  (
450  {"useTimeName", 1806}, // ignore - works poorly with VTM formats
451  false // bool option, no argument
452  );
453  argList::addBoolOption
454  (
455  "overwrite",
456  "Remove any existing VTK output directory"
457  );
458  argList::addOption
459  (
460  "name",
461  "subdir",
462  "Directory name for VTK output (default: 'VTK')"
463  );
464 
465  #include "setRootCase.H"
466 
467  const bool decomposePoly = args.found("poly-decomp");
468  const bool doBoundary = !args.found("no-boundary");
469  const bool doInternal = !args.found("no-internal");
470  const bool doLagrangian = !args.found("no-lagrangian");
471  const bool doFiniteArea = args.found("finiteAreaFields");
472  const bool doSurfaceFields = args.found("surfaceFields");
473 
474  const bool oneBoundary = args.found("one-boundary") && doBoundary;
475  const bool nearCellValue = args.found("nearCellValue") && doBoundary;
476  const bool allRegions = args.found("allRegions");
477 
478  const vtk::outputOptions writeOpts = getOutputOptions(args);
479 
480  bool processorFieldsOnly = false;
481 
482  if (args.found("processor-fields"))
483  {
484  if (!Pstream::parRun())
485  {
486  Info<< "Ignoring processor patch writing in serial"
487  << nl << endl;
488  }
489  else if (writeOpts.legacy())
490  {
491  Info<< "Ignoring processor patch writing in legacy format"
492  << nl << endl;
493  }
494  else
495  {
496  processorFieldsOnly = true;
497 
498  Info<< "Writing processor patch fields only"
499  << nl << endl;
500  }
501  }
502 
503  if (nearCellValue)
504  {
505  Info<< "Using neighbouring cell value instead of patch value"
506  << nl << endl;
507  }
508 
509  const bool doPointValues = !args.found("no-point-data");
510  if (!doPointValues)
511  {
512  Info<< "Point fields and interpolated point data"
513  << " disabled with the '-no-point-data' option"
514  << nl;
515  }
516 
517  const bool withPointIds = args.found("with-point-ids");
518  if (withPointIds)
519  {
520  Info<< "Write point ids requested";
521 
522  if (!doPointValues)
523  {
524  Info<< ", but ignored due to the '-no-point-data' option";
525  }
526 
527  Info<< nl;
528  }
529 
530  const bool withMeshIds = args.found("with-ids");
531  if (withMeshIds)
532  {
533  Info<< "Writing mesh ids (cell, patch, proc) requested" << nl;
534  }
535 
536  wordRes includePatches, excludePatches;
537  if (doBoundary)
538  {
539  if (args.readListIfPresent<wordRe>("patches", includePatches))
540  {
541  Info<< "Including patches " << flatOutput(includePatches)
542  << nl << endl;
543  }
544  if (args.readListIfPresent<wordRe>("excludePatches", excludePatches))
545  {
546  Info<< "Excluding patches " << flatOutput(excludePatches)
547  << nl << endl;
548  }
549  }
550 
551  // Can be specified as empty (ie, no fields)
552  wordRes selectedFields;
553  const bool useFieldFilter =
554  args.readListIfPresent<wordRe>("fields", selectedFields);
555 
556  // Non-mandatory
557  const wordRes selectedFaceZones(args.getList<wordRe>("faceZones", false));
558 
559  #include "createTime.H"
560 
561  instantList timeDirs = timeSelector::select0(runTime, args);
562 
563  // Information for file series
564  HashTable<vtk::seriesWriter, fileName> vtkSeries;
565 
566  wordList regionNames;
567  wordRes selectRegions;
568  if (allRegions)
569  {
570  regionNames =
571  regionProperties(runTime, IOobject::READ_IF_PRESENT).names();
572 
573  if (regionNames.empty())
574  {
575  Info<< "Warning: "
576  << "No regionProperties - assuming default region"
577  << nl << endl;
578 
579  regionNames.resize(1);
580  regionNames.first() = fvMesh::defaultRegion;
581  }
582  else
583  {
584  Info<< "Using all regions in regionProperties" << nl
585  << " "<< flatOutput(regionNames) << nl;
586  }
587  }
588  else if (args.readListIfPresent<wordRe>("regions", selectRegions))
589  {
590  if (selectRegions.empty())
591  {
592  regionNames.resize(1);
593  regionNames.first() = fvMesh::defaultRegion;
594  }
595  else if
596  (
597  selectRegions.size() == 1 && selectRegions.first().isLiteral()
598  )
599  {
600  // Identical to -region NAME
601  regionNames.resize(1);
602  regionNames.first() = selectRegions.first();
603  }
604  else
605  {
606  regionNames =
607  regionProperties(runTime, IOobject::READ_IF_PRESENT).names();
608 
609  if (regionNames.empty())
610  {
611  Info<< "Warning: "
612  << "No regionProperties - assuming default region"
613  << nl << endl;
614 
615  regionNames.resize(1);
616  regionNames.first() = fvMesh::defaultRegion;
617  }
618  else
619  {
620  inplaceSubsetStrings(selectRegions, regionNames);
621 
622  if (regionNames.empty())
623  {
624  Info<< "No matching regions ... stopping" << nl << endl;
625  return 1;
626  }
627 
628  Info<< "Using matching regions: "
629  << flatOutput(regionNames) << nl;
630  }
631  }
632  }
633  else
634  {
635  regionNames.resize(1);
636  regionNames.first() =
637  args.getOrDefault<word>("region", fvMesh::defaultRegion);
638  }
639 
640 
641  // Names for sets and zones
642  word cellSelectionName;
643  word faceSetName;
644  word pointSetName;
645 
646  fvMeshSubsetProxy::subsetType cellSubsetType = fvMeshSubsetProxy::NONE;
647 
648  string vtkName = args.globalCaseName();
649 
650  if (regionNames.size() == 1)
651  {
652  if (args.readIfPresent("cellSet", cellSelectionName))
653  {
654  vtkName = cellSelectionName;
655  cellSubsetType = fvMeshSubsetProxy::SET;
656 
657  Info<< "Converting cellSet " << cellSelectionName
658  << " only. New outside faces as \"oldInternalFaces\"."
659  << nl;
660  }
661  else if (args.readIfPresent("cellZone", cellSelectionName))
662  {
663  vtkName = cellSelectionName;
664  cellSubsetType = fvMeshSubsetProxy::ZONE;
665 
666  Info<< "Converting cellZone " << cellSelectionName
667  << " only. New outside faces as \"oldInternalFaces\"."
668  << nl;
669  }
670 
671  args.readIfPresent("faceSet", faceSetName);
672  args.readIfPresent("pointSet", pointSetName);
673  }
674  else
675  {
676  for
677  (
678  const word& opt
679  : { "cellSet", "cellZone", "faceSet", "pointSet" }
680  )
681  {
682  if (args.found(opt))
683  {
684  Info<< "Ignoring -" << opt << " for multi-regions" << nl;
685  }
686  }
687  }
688 
689 
690  cpuTime timer;
691  memInfo mem;
692  Info<< "Initial memory " << mem.update().size() << " kB" << endl;
693 
694  #include "createMeshes.H"
695 
696  // Directory management
697 
698  // Sub-directory for output
699  const word vtkDirName = args.getOrDefault<word>("name", "VTK");
700 
701  const fileName outputDir(args.globalPath()/vtkDirName);
702 
703  if (Pstream::master())
704  {
705  // Overwrite or create the VTK/regionName directories.
706  // For the default region, this is simply "VTK/"
707 
708  fileName regionDir;
709  for (const word& regionName : regionNames)
710  {
711  if (regionName != polyMesh::defaultRegion)
712  {
713  regionDir = outputDir / regionName;
714  }
715  else
716  {
717  regionDir = outputDir;
718  }
719 
720  if (args.found("overwrite") && isDir(regionDir))
721  {
722  Info<< "Removing old directory "
723  << args.relativePath(regionDir)
724  << nl << endl;
725  rmDir(regionDir);
726  }
727  mkDir(regionDir);
728  }
729  }
730 
731 
732  // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
733 
734  forAll(timeDirs, timei)
735  {
736  runTime.setTime(timeDirs[timei], timei);
737 
738  const word timeDesc = "_" + Foam::name(runTime.timeIndex());
739  const scalar timeValue = runTime.value();
740 
741  Info<< "Time: " << runTime.timeName() << endl;
742 
743 
744  // Accumulate information for multi-region VTM
745  vtk::vtmWriter vtmMultiRegion;
746 
747  // vtmMultiRegion.set(vtkDir/vtkName + timeDesc)
748 
749  forAll(regionNames, regioni)
750  {
751  const word& regionName = regionNames[regioni];
752 
753  fileName regionPrefix;
754  if (regionName != polyMesh::defaultRegion)
755  {
756  regionPrefix = regionName;
757  }
758 
759  auto& meshProxy = meshProxies[regioni];
760  auto& vtuMeshCells = vtuMappings[regioni];
761 
762  // polyMesh::readUpdateState meshState = mesh.readUpdate();
763 
764  // Check for new polyMesh/ and update mesh, fvMeshSubset
765  // and cell decomposition.
766  polyMesh::readUpdateState meshState =
767  meshProxy.readUpdate();
768 
769  const fvMesh& mesh = meshProxy.mesh();
770 
771  if
772  (
773  meshState == polyMesh::TOPO_CHANGE
774  || meshState == polyMesh::TOPO_PATCH_CHANGE
775  )
776  {
777  // Trigger change for vtk cells too
778  vtuMeshCells.clear();
779  }
780 
781  // Write topoSets before attempting anything else
782  {
783  #include "convertTopoSet.H"
784  if (wroteTopoSet)
785  {
786  continue;
787  }
788  }
789 
790  // Search for list of objects for this time
791  IOobjectList objects(meshProxy.baseMesh(), runTime.timeName());
792 
793  if (useFieldFilter)
794  {
795  objects.filterObjects(selectedFields);
796  }
797 
798  // Prune restart fields
799  objects.prune_0();
800 
801  if (!doPointValues)
802  {
803  // Prune point fields if disabled
804  objects.filterClasses
805  (
806  [](const word& clsName)
807  {
808  return fieldTypes::point.found(clsName);
809  },
810  true // prune
811  );
812  }
813 
814  if (processorFieldsOnly)
815  {
816  // Processor-patches only and continue
817  #include "convertProcessorPatches.H"
818  continue;
819  }
820 
821  // Volume, internal, point fields
822  #include "convertVolumeFields.H"
823 
824  // Surface fields
825  #include "convertSurfaceFields.H"
826 
827  // Finite-area mesh and fields - need not exist
828  #include "convertAreaFields.H"
829 
830  // Write lagrangian data
831  #include "convertLagrangian.H"
832  }
833 
834  // Emit multi-region vtm
835  if (Pstream::master() && regionNames.size() > 1)
836  {
837  fileName outputName
838  (
839  outputDir/vtkName + "-regions" + timeDesc + ".vtm"
840  );
841 
842  vtmMultiRegion.setTime(timeValue);
843  vtmMultiRegion.write(outputName);
844 
845  fileName seriesName(vtk::seriesWriter::base(outputName));
846 
847  vtk::seriesWriter& series = vtkSeries(seriesName);
848 
849  // First time?
850  // Load from file, verify against filesystem,
851  // prune time >= currentTime
852  if (series.empty())
853  {
854  series.load(seriesName, true, timeValue);
855  }
856 
857  series.append(timeValue, outputName);
858  series.write(seriesName);
859  }
860 
861  Info<< "Wrote in "
862  << timer.cpuTimeIncrement() << " s, "
863  << mem.update().size() << " kB" << endl;
864  }
865 
866 
867  Info<< "\nEnd: "
868  << timer.elapsedCpuTime() << " s, "
869  << mem.update().peak() << " kB (peak)\n" << endl;
870 
871  return 0;
872 }
873 
874 
875 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:71
runTime
engineTime & runTime
Definition: createEngineTime.H:13
vtmWriter
vtk::vtmWriter vtmWriter
Definition: convertVolumeFields.H:72
regionProperties.H
Foam::argList::getOrDefault
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Definition: argListI.H:280
reportFields.H
Foam::floatScalar
float floatScalar
A typedef for float.
Definition: scalarFwd.H:45
Cloud.H
Foam::inplaceSubsetStrings
void inplaceSubsetStrings(const regExp &matcher, StringListType &input, const bool invert=false)
Inplace extract elements of StringList when regular expression matches.
Definition: stringListOps.H:252
Foam::argList::readListIfPresent
bool readListIfPresent(const word &optName, List< T > &list) const
Definition: argListI.H:367
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:350
writeAreaFields.H
Read finite-area fields from disk and write with vtk::surfaceMeshWriter.
Foam::instantList
List< instant > instantList
List of instants.
Definition: instantList.H:44
Foam::argList::readIfPresent
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:296
foamVtmWriter.H
foamVtkLagrangianWriter.H
convertProcessorPatches.H
Code chunk for converting volume fields on processor boundaries, included by foamToVTK.
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:59
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::cpuTime
cpuTimeCxx cpuTime
Selection of preferred clock mechanism for the elapsed cpu time.
Definition: cpuTimeFwd.H:41
Foam::Info
messageStream Info
Information stream (uses stdout - output is on the master only)
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
convertTopoSet.H
Code chunk for converting face and point sets - included by foamToVTK.
faceSet.H
addRegionOption.H
vtuMappings
PtrList< vtk::vtuCells > vtuMappings(regionNames.size())
convertSurfaceFields.H
Code chunk for post-processing surface fields to VTK PolyData.
Foam::stringListOps::findMatching
labelList findMatching(const StringListType &input, const wordRes &allow, const wordRes &deny=wordRes(), AccessOp aop=noOp())
Return ids for items with matching names.
foamVtkSeriesWriter.H
areaFields.H
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
faceZoneMesh.H
Foam::faceZoneMesh.
Foam::flatOutput
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:217
fvMeshSubsetProxy.H
foamVtkSurfaceFieldWriter.H
emptyPolyPatch.H
foamVtkPatchWriter.H
volPointInterpolation.H
setRootCase.H
Foam::nl
constexpr char nl
Definition: Ostream.H:385
Foam::rmDir
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
Definition: MSwindows.C:1018
Foam::BitOps::count
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Definition: BitOps.H:77
convertAreaFields.H
Code chunk for converting finite-area - included by foamToVTK.
wroteTopoSet
bool wroteTopoSet
Definition: convertTopoSet.H:32
Foam::argList::globalPath
fileName globalPath() const
Return the full path to the global case.
Definition: argListI.H:87
createTime.H
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::argList::getList
List< T > getList(const label index) const
Get a List of values from the argument at index.
foamVtkInternalWriter.H
fvCFD.H
stringListOps.H
Operations on lists of strings.
meshProxies
PtrList< fvMeshSubsetProxy > meshProxies(regionNames.size())
foamVtkWriteTopoSet.H
Write topoSet in VTK format.
foamVtkSurfaceMeshWriter.H
Foam::point
vector point
Point is a vector.
Definition: point.H:43
args
Foam::argList args(argc, argv)
Foam::mkDir
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
Definition: MSwindows.C:507
WarningInFunction
#define WarningInFunction
Report a warning using Foam::Warning.
Definition: messageStream.H:303
Foam::argList::globalCaseName
const fileName & globalCaseName() const
Return global case name.
Definition: argListI.H:75
Foam::argList::relativePath
fileName relativePath(const fileName &input, const bool caseTag=false) const
Definition: argListI.H:94
pointMesh.H
HashOps.H
Foam::isDir
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Definition: MSwindows.C:643
Foam::argList::found
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:151
pointSet.H