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-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Application
28 foamToVTK
29
30Group
31 grpPostProcessingUtilities
32
33Description
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
45Usage
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 -exclude-patches NAME | LIST
116 Exclude single or multiple patches (name or regex) from writing.
117 For example,
118 \verbatim
119 -exclude-patches '( inlet_1 inlet_2 "proc.*")'
120 \endverbatim
121
122Note
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"
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"
152#include "foamVtkPatchWriter.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#include "writeSurfaceFields.H"
164
165#include "memInfo.H"
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169labelList getSelectedPatches
170(
171 const polyBoundaryMesh& patches,
172 const autoPtr<wordRes::filter>& patchSelector
173)
174{
175 labelList indices;
176
177 if (patchSelector && !patchSelector().empty())
178 {
179 // Name-based selection
180 indices =
181 (
182 stringListOps::findMatching
183 (
184 patches,
185 patchSelector(),
186 nameOp<polyPatch>()
187 )
188 );
189 }
190 else
191 {
192 indices = identity(patches.size());
193 }
194
195 // Remove undesirable patches
196
197 label count = 0;
198 for (const label patchi : indices)
199 {
200 const polyPatch& pp = patches[patchi];
201
202 if (isType<emptyPolyPatch>(pp))
203 {
204 continue;
205 }
206 else if (Pstream::parRun() && bool(isA<processorPolyPatch>(pp)))
207 {
208 break; // No processor patches for parallel output
209 }
210
211 indices[count] = patchi;
212 ++count;
213 }
214
215 indices.resize(count);
216
217 return indices;
218}
219
220
221//
222// Process args for output options (-ascii, -legacy)
223//
224vtk::outputOptions getOutputOptions(const argList& args)
225{
226 // Default is inline ASCII xml
227 vtk::outputOptions opts;
228
229 if (args.found("legacy"))
230 {
231 opts.legacy(true);
232
233 if (!args.found("ascii"))
234 {
235 if (sizeof(floatScalar) != 4 || sizeof(label) != 4)
236 {
237 opts.ascii(true);
238
240 << "Using ASCII rather than legacy binary VTK format since "
241 << "floatScalar and/or label are not 4 bytes in size."
242 << nl << endl;
243 }
244 else
245 {
246 opts.ascii(false);
247 }
248 }
249 }
250 else
251 {
252 opts.ascii(args.found("ascii"));
253 }
254
255 return opts;
256}
257
258
259// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
260
261int main(int argc, char *argv[])
262{
263 argList::addNote
264 (
265 "General OpenFOAM to VTK file writer"
266 );
267 timeSelector::addOptions();
268
269 // Less frequently used - reduce some clutter
270 argList::setAdvanced("decomposeParDict");
271 argList::setAdvanced("noFunctionObjects");
272
273 argList::addVerboseOption("Additional verbosity");
274
275 argList::addBoolOption
276 (
277 "ascii",
278 "Write in ASCII format instead of binary"
279 );
280 argList::addBoolOption
281 (
282 "legacy",
283 "Write legacy format instead of xml",
284 true // mark as an advanced option
285 );
286 argList::addBoolOption
287 (
288 "poly-decomp",
289 "Decompose polyhedral cells into tets/pyramids",
290 true // mark as an advanced option
291 );
292 argList::ignoreOptionCompat
293 (
294 {"xml", 1806}, // xml is now default, use -legacy to toggle
295 false // bool option, no argument
296 );
297 argList::ignoreOptionCompat
298 (
299 {"poly", 1806}, // poly is now default, use -poly-decomp to toggle
300 false // bool option, no argument
301 );
302
303 argList::addOption
304 (
305 "cellSet",
306 "name",
307 "Convert mesh subset corresponding to specified cellSet",
308 true // mark as an advanced option
309 );
310 argList::addOption
311 (
312 "cellZone",
313 "name",
314 "Convert mesh subset corresponding to specified cellZone",
315 true // mark as an advanced option
316 );
317 argList::addOption
318 (
319 "faceSet",
320 "name",
321 "Convert specified faceSet only",
322 true // mark as an advanced option
323 );
324 argList::addOption
325 (
326 "pointSet",
327 "name",
328 "Convert specified pointSet only",
329 true // mark as an advanced option
330 );
331 argList::addOption
332 (
333 "faceZones",
334 "wordRes",
335 "Specify single or multiple faceZones to write\n"
336 "Eg, 'cells' or '( slice \"mfp-.*\" )'.",
337 true // mark as an advanced option
338 );
339 argList::addOption
340 (
341 "fields",
342 "wordRes",
343 "Specify single or multiple fields to write (all by default)\n"
344 "Eg, 'T' or '(p T U \"alpha.*\")'"
345 );
346 argList::addOption
347 (
348 "exclude-fields",
349 "wordRes",
350 "Exclude single or multiple fields",
351 true // mark as an advanced option
352 );
353 argList::addBoolOption
354 (
355 "no-fields",
356 "Suppress conversion of fields"
357 );
358
359 argList::addBoolOption
360 (
361 "processor-fields",
362 "Write field values on processor boundaries only",
363 true // mark as an advanced option
364 );
365 argList::addBoolOption
366 (
367 "surfaceFields",
368 "Write surfaceScalarFields (eg, phi)",
369 true // mark as an advanced option
370 );
371 argList::addBoolOption
372 (
373 "no-finite-area",
374 "Suppress output of finite-area mesh/fields",
375 true // mark as an advanced option
376 );
377 argList::ignoreOptionCompat
378 (
379 {"finite-area", 2112}, // use -no-finite-area to disable
380 false // bool option, no argument
381 );
382 argList::ignoreOptionCompat
383 (
384 {"finiteAreaFields", 2012}, // use -no-finite-area to disable
385 false // bool option, no argument
386 );
387
388 argList::addBoolOption
389 (
390 "nearCellValue",
391 "Use cell value on patches instead of patch value itself",
392 true // mark as an advanced option
393 );
394 argList::addBoolOption
395 (
396 "no-boundary",
397 "Suppress output for boundary patches"
398 );
399 argList::addBoolOption
400 (
401 "no-internal",
402 "Suppress output for internal volume mesh"
403 );
404 argList::addBoolOption
405 (
406 "no-lagrangian", // noLagrangian
407 "Suppress writing lagrangian positions and fields"
408 );
409 argList::addOptionCompat("no-lagrangian", {"noLagrangian", 1806});
410
411 argList::addBoolOption
412 (
413 "no-point-data", // noPointValues
414 "Suppress conversion of pointFields. No interpolated PointData."
415 );
416 argList::addOptionCompat("no-point-data", {"noPointValues", 1806});
417
418 argList::addBoolOption
419 (
420 "with-ids",
421 "Additional mesh id fields (cellID, procID, patchID)",
422 true // mark as an advanced option
423 );
424
425 argList::addBoolOption
426 (
427 "with-point-ids",
428 "Additional pointID field for internal mesh",
429 true // mark as an advanced option
430 );
431
432 argList::addBoolOption
433 (
434 "one-boundary", // allPatches
435 "Combine all patches into a single file"
436 );
437 argList::addOptionCompat("one-boundary", {"allPatches", 1806});
438
439 #include "addAllRegionOptions.H"
440
441 argList::addOption
442 (
443 "patches",
444 "wordRes",
445 "Specify single patch or multiple patches to write\n"
446 "Eg, 'top' or '( front \".*back\" )'"
447 );
448 argList::addOption
449 (
450 "exclude-patches",
451 "wordRes",
452 "Exclude single or multiple patches from writing\n"
453 "Eg, 'outlet' or '( inlet \".*Wall\" )'",
454 true // mark as an advanced option
455 );
456 argList::addOptionCompat("exclude-patches", {"excludePatches", 2112});
457
458 argList::ignoreOptionCompat
459 (
460 {"noFaceZones", 1806}, // faceZones are only enabled on demand
461 false // bool option, no argument
462 );
463 argList::ignoreOptionCompat
464 (
465 {"noLinks", 1806}, // ignore never make any links
466 false // bool option, no argument
467 );
468 argList::ignoreOptionCompat
469 (
470 {"useTimeName", 1806}, // ignore - works poorly with VTM formats
471 false // bool option, no argument
472 );
473 argList::addBoolOption
474 (
475 "overwrite",
476 "Remove any existing VTK output directory"
477 );
478 argList::addOption
479 (
480 "name",
481 "subdir",
482 "Directory name for VTK output (default: 'VTK')"
483 );
484
485 #include "setRootCase.H"
486
488 const bool decomposePoly = args.found("poly-decomp");
489 const bool doBoundary = !args.found("no-boundary");
490 const bool doInternal = !args.found("no-internal");
491 const bool doLagrangian = !args.found("no-lagrangian");
492 const bool doFiniteArea = !args.found("no-finite-area");
493 const bool doSurfaceFields = args.found("surfaceFields");
494 const bool oneBoundary = args.found("one-boundary") && doBoundary;
495 const bool nearCellValue = args.found("nearCellValue") && doBoundary;
496
497 const vtk::outputOptions writeOpts = getOutputOptions(args);
498
499 bool processorFieldsOnly = false;
500
501 if (args.found("processor-fields"))
502 {
503 if (!Pstream::parRun())
504 {
505 Info<< "Ignoring processor patch writing in serial"
506 << nl << endl;
507 }
508 else if (writeOpts.legacy())
509 {
510 Info<< "Ignoring processor patch writing in legacy format"
511 << nl << endl;
512 }
513 else
514 {
515 processorFieldsOnly = true;
516
517 Info<< "Writing processor patch fields only"
518 << nl << endl;
519 }
520 }
521
522 if (nearCellValue)
523 {
524 Info<< "Using neighbouring cell value instead of patch value"
525 << nl << endl;
526 }
527
528 bool doPointValues = !args.found("no-point-data");
529 if (!doPointValues)
530 {
531 Info<< "Point fields and interpolated point data"
532 << " disabled with the '-no-point-data' option"
533 << nl;
534 }
535
536 const bool withPointIds = args.found("with-point-ids");
537 if (withPointIds)
538 {
539 Info<< "Write point ids requested";
540
541 if (!doPointValues)
542 {
543 Info<< ", but ignored due to the '-no-point-data' option";
544 }
545
546 Info<< nl;
547 }
548
549 const bool withMeshIds = args.found("with-ids");
550 if (withMeshIds)
551 {
552 Info<< "Writing mesh ids (cell, patch, proc) requested" << nl;
553 }
554
555 // Patch selection/deselection
556 wordRes includedPatches, excludedPatches;
557 autoPtr<wordRes::filter> patchSelector(nullptr);
558 if (doBoundary)
559 {
560 bool resetFilter = false;
561 if (args.readListIfPresent<wordRe>("patches", includedPatches))
562 {
563 resetFilter = true;
564 Info<< "Including patches "
565 << flatOutput(includedPatches) << nl << endl;
566 }
567 if (args.readListIfPresent<wordRe>("exclude-patches", excludedPatches))
568 {
569 resetFilter = true;
570 Info<< "Excluding patches "
571 << flatOutput(excludedPatches) << nl << endl;
572 }
573
574 if (resetFilter)
575 {
576 patchSelector =
577 autoPtr<wordRes::filter>::New(includedPatches, excludedPatches);
578 }
579 }
580
581 // Field selection/deselection
582 wordRes includedFields, excludedFields;
583 autoPtr<wordRes::filter> fieldSelector(nullptr);
584 bool doConvertFields = !args.found("no-fields");
585 if (doConvertFields)
586 {
587 bool resetFilter = false;
588 if (args.readListIfPresent<wordRe>("fields", includedFields))
589 {
590 Info<< "Including fields "
591 << flatOutput(includedFields) << nl << endl;
592
593 resetFilter = !includedFields.empty();
594
595 if (includedFields.empty())
596 {
597 // Compat: Can be specified as empty (ie, no fields)
598 // Same as "block everything"
599
600 doConvertFields = false;
601 Info<< "Field conversion disabled by '-fields ()' option" << nl
602 << "Should use -no-fields instead" << endl;
603 }
604 }
605 if (args.readListIfPresent<wordRe>("exclude-fields", excludedFields))
606 {
607 resetFilter = true;
608 Info<< "Excluding fields "
609 << flatOutput(excludedFields) << nl << endl;
610 }
611
612 if (resetFilter && doConvertFields)
613 {
614 fieldSelector =
615 autoPtr<wordRes::filter>::New(includedFields, excludedFields);
616 }
617 }
618 else if (doConvertFields)
619 {
620 Info<< "Field conversion disabled with the '-no-fields' option" << nl;
621 }
622
623
624 // Non-mandatory
625 const wordRes selectedFaceZones(args.getList<wordRe>("faceZones", false));
626
627 #include "createTime.H"
628
629 instantList timeDirs = timeSelector::select0(runTime, args);
630
631 // Information for file series
632 HashTable<vtk::seriesWriter, fileName> vtkSeries;
633
634 // Handle -allRegions, -regions, -region
635 #include "getAllRegionOptions.H"
636
637 // Names for sets and zones
638 word cellSelectionName;
639 word faceSetName;
640 word pointSetName;
641
642 fvMeshSubsetProxy::subsetType cellSubsetType = fvMeshSubsetProxy::NONE;
643
644 string vtkName = args.globalCaseName();
645
646 if (regionNames.size() == 1)
647 {
648 if (args.readIfPresent("cellSet", cellSelectionName))
649 {
650 vtkName = cellSelectionName;
651 cellSubsetType = fvMeshSubsetProxy::SET;
652
653 Info<< "Converting cellSet " << cellSelectionName
654 << " only. New outside faces as \"oldInternalFaces\"."
655 << nl;
656 }
657 else if (args.readIfPresent("cellZone", cellSelectionName))
658 {
659 vtkName = cellSelectionName;
660 cellSubsetType = fvMeshSubsetProxy::ZONE;
661
662 Info<< "Converting cellZone " << cellSelectionName
663 << " only. New outside faces as \"oldInternalFaces\"."
664 << nl;
665 }
666
667 args.readIfPresent("faceSet", faceSetName);
668 args.readIfPresent("pointSet", pointSetName);
669 }
670 else
671 {
672 for
673 (
674 const char * const opt
675 : { "cellSet", "cellZone", "faceSet", "pointSet" }
676 )
677 {
678 if (args.found(opt))
679 {
680 Info<< "Ignoring -" << opt << " for multi-regions" << nl;
681 }
682 }
683 }
684
685 // ------------------------------------------------------------------------
686 // Directory management
687
688 // Sub-directory for output
689 const word vtkDirName = args.getOrDefault<word>("name", "VTK");
690
691 const fileName outputDir(args.globalPath()/vtkDirName);
692
693 if (Pstream::master())
694 {
695 // Overwrite or create the VTK/regionName directories.
696 // For the default region, this is simply "VTK/"
697
698 for (const word& regionName : regionNames)
699 {
700 fileName regionOutDir(outputDir/polyMesh::regionName(regionName));
701
702 if (args.found("overwrite") && Foam::isDir(regionOutDir))
703 {
704 Info<< "Removing old directory "
705 << args.relativePath(regionOutDir)
706 << nl << endl;
707 Foam::rmDir(regionOutDir);
708 }
709 Foam::mkDir(regionOutDir);
710 }
711 }
712
713 // ------------------------------------------------------------------------
714
715 cpuTime timer;
716 memInfo mem;
717 Info<< "Initial memory " << mem.update().size() << " kB" << endl;
718
719 #include "createNamedMeshes.H"
720 #include "createMeshAccounting.H"
721
722 Info<< "VTK mesh topology: "
723 << timer.cpuTimeIncrement() << " s, "
724 << mem.update().size() << " kB" << endl;
725
726
727 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
728
729 forAll(timeDirs, timei)
730 {
731 runTime.setTime(timeDirs[timei], timei);
732
733 const word timeDesc = "_" + Foam::name(runTime.timeIndex());
734 const scalar timeValue = runTime.value();
735
736 Info<< "Time: " << runTime.timeName() << endl;
737
738
739 // Accumulate information for multi-region VTM
740 vtk::vtmWriter vtmMultiRegion;
741
742 // vtmMultiRegion.set(vtkDir/vtkName + timeDesc)
743
744 forAll(regionNames, regioni)
745 {
746 const word& regionName = regionNames[regioni];
747 const word& regionDir = polyMesh::regionName(regionName);
748
749 if (regionNames.size() > 1)
750 {
751 Info<< "region = " << regionName << nl;
752 }
753
754 auto& meshProxy = meshProxies[regioni];
755 auto& vtuMeshCells = vtuMappings[regioni];
756
757 // polyMesh::readUpdateState meshState = mesh.readUpdate();
758
759 // Check for new polyMesh/ and update mesh, fvMeshSubset
760 // and cell decomposition.
761 polyMesh::readUpdateState meshState =
762 meshProxy.readUpdate();
763
764 const fvMesh& mesh = meshProxy.mesh();
765
766 if
767 (
768 meshState == polyMesh::TOPO_CHANGE
769 || meshState == polyMesh::TOPO_PATCH_CHANGE
770 )
771 {
772 // Trigger change for vtk cells too
773 vtuMeshCells.clear();
774 }
775
776 // Write topoSets before attempting anything else
777 {
778 #include "convertTopoSet.H"
779 if (wroteTopoSet)
780 {
781 continue;
782 }
783 }
784
785 IOobjectList objects(0);
786
787 if (doConvertFields)
788 {
789 // List of objects for this time
790 objects =
791 IOobjectList(meshProxy.baseMesh(), runTime.timeName());
792
793 if (fieldSelector && !fieldSelector().empty())
794 {
795 objects.filterObjects(fieldSelector());
796 }
797
798 // Remove "*_0" 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
815 if (processorFieldsOnly)
816 {
817 // Processor-patches only and continue
819 continue;
820 }
821
822 // Volume, internal, point fields
823 #include "convertVolumeFields.H"
824
825 // Surface fields
826 #include "convertSurfaceFields.H"
827
828 // Finite-area mesh and fields - need not exist
829 #include "convertAreaFields.H"
830
831 // Write lagrangian data
832 #include "convertLagrangian.H"
833 }
834
835 // Emit multi-region vtm
836 if (Pstream::master() && regionNames.size() > 1)
837 {
838 fileName outputName
839 (
840 outputDir/vtkName + "-regions" + timeDesc + ".vtm"
841 );
842
843 vtmMultiRegion.setTime(timeValue);
844 vtmMultiRegion.write(outputName);
845
846 fileName seriesName(vtk::seriesWriter::base(outputName));
847
848 vtk::seriesWriter& series = vtkSeries(seriesName);
849
850 // First time?
851 // Load from file, verify against filesystem,
852 // prune time >= currentTime
853 if (series.empty())
854 {
855 series.load(seriesName, true, timeValue);
856 }
857
858 series.append(timeValue, outputName);
859 series.write(seriesName);
860 }
861
862 Info<< "Wrote in "
863 << timer.cpuTimeIncrement() << " s, "
864 << mem.update().size() << " kB" << endl;
865 }
866
867
868 Info<< "\nEnd: "
869 << timer.elapsedCpuTime() << " s, "
870 << mem.update().peak() << " kB (peak)\n" << endl;
871
872 return 0;
873}
874
875
876// ************************************************************************* //
fileName relativePath(const fileName &input, const bool caseTag=false) const
Definition: argListI.H:94
bool readListIfPresent(const word &optName, List< T > &list) const
Definition: argListI.H:394
bool found(const word &optName) const
Return true if the named option is found.
Definition: argListI.H:178
bool readIfPresent(const word &optName, T &val) const
Read a value from the named option if present.
Definition: argListI.H:323
const fileName & globalCaseName() const noexcept
Return global case name.
Definition: argListI.H:75
List< T > getList(const label index) const
Get a List of values from the argument at index.
T getOrDefault(const word &optName, const T &deflt) const
Get a value from the named option if present, or return default.
Definition: argListI.H:307
fileName globalPath() const
Return the full path to the global case.
Definition: argListI.H:87
Code chunk for converting volume fields on processor boundaries, included by foamToVTK.
const polyBoundaryMesh & patches
Code chunk for post-processing surface fields to VTK PolyData.
Code chunk for converting face and point sets - included by foamToVTK.
bool wroteTopoSet
dynamicFvMesh & mesh
engineTime & runTime
Foam::word regionName(Foam::polyMesh::defaultRegion)
Required Variables.
word outputName("finiteArea-edges.obj")
Foam::faceZoneMesh.
const word & regionDir
PtrList< fvMeshSubsetProxy > meshProxies(meshes.size())
PtrList< vtk::vtuCells > vtuMappings(meshes.size())
Write topoSet in VTK format.
wordList regionNames
#define WarningInFunction
Report a warning using Foam::Warning.
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
Definition: BitOps.H:78
labelList identity(const label len, label start=0)
Return an identity map of the given length with (map[i] == i)
Definition: labelList.C:38
List< label > labelList
A List of labels.
Definition: List.H:66
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:515
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
bool rmDir(const fileName &directory, const bool silent=false)
Remove a directory and its contents (optionally silencing warnings)
Definition: MSwindows.C:1036
List< instant > instantList
List of instants.
Definition: instantList.H:47
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
Definition: FlatOutput.H:215
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
Definition: MSwindows.C:651
cpuTimeCxx cpuTime
Selection of preferred clock mechanism for the elapsed cpu time.
Definition: cpuTimeFwd.H:43
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
Operations on lists of strings.
Write surface fields from volume mesh.