diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwclean similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwclean diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwmake b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwmake rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/files b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/files similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/files rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/files diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/options b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/options similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/options rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/options diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/UEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/UEqn.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/UEqn.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/UEqn.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/createFields.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/createFields.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/eEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/eEqn.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/interCondensatingEvaporatingFoam.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/interCondensatingEvaporatingFoam.C rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/pEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/pEqn.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/pEqn.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/pEqn.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H similarity index 100% rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index 2bc5d377de..3fff5e4915 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -63,7 +63,7 @@ Foam::dragModels::Ergun::~Ergun() Foam::tmp Foam::dragModels::Ergun::CdRe() const { return - (4/3) + (4.0/3.0) *( 150 *max diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index ca378985ea..cb318e5d07 100644 --- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -68,7 +68,7 @@ Foam::tmp Foam::dragModels::Gibilaro::CdRe() const ); return - (4/3) + (4.0/3.0) *(17.3/alpha2 + 0.336*pair_.Re()) *max(pair_.continuous(), pair_.continuous().residualAlpha()) *pow(alpha2, -2.8); diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C index 2bc5d377de..3fff5e4915 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C @@ -63,7 +63,7 @@ Foam::dragModels::Ergun::~Ergun() Foam::tmp Foam::dragModels::Ergun::CdRe() const { return - (4/3) + (4.0/3.0) *( 150 *max diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C index ca378985ea..cb318e5d07 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C @@ -68,7 +68,7 @@ Foam::tmp Foam::dragModels::Gibilaro::CdRe() const ); return - (4/3) + (4.0/3.0) *(17.3/alpha2 + 0.336*pair_.Re()) *max(pair_.continuous(), pair_.continuous().residualAlpha()) *pow(alpha2, -2.8); diff --git a/applications/test/dictionary/testDict b/applications/test/dictionary/testDict index a128a0b2e7..736f426305 100644 --- a/applications/test/dictionary/testDict +++ b/applications/test/dictionary/testDict @@ -64,7 +64,8 @@ boundaryField inlet_4 { $inactive } inlet_5 "a primitiveEntry is squashed by a directory entry"; inlet_5 { $inactive } - inlet_6 { $.inactive } // Test scoping + inlet_6a { $...inactive } // Relative scoping - fairly horrible to use + inlet_6b { $^inactive } // Absolute scoping inlet_7 { ${inactive}} // Test variable expansion inlet_8 { $inactive } ${key} { $inactive } diff --git a/applications/test/faces/Test-faces.C b/applications/test/faces/Test-faces.C index 823f33e3e1..280cdf7006 100644 --- a/applications/test/faces/Test-faces.C +++ b/applications/test/faces/Test-faces.C @@ -52,7 +52,7 @@ int main(int argc, char *argv[]) Info<< "face:" << f1 << nl; // expect these to fail - FatalError.throwExceptions(); + const bool throwingError = FatalError.throwExceptions(); try { labelledTri l1{ 1, 2, 3, 10, 24 }; @@ -63,7 +63,7 @@ int main(int argc, char *argv[]) WarningInFunction << "Caught FatalError " << err << nl << endl; } - FatalError.dontThrowExceptions(); + FatalError.throwExceptions(throwingError); labelledTri l2{ 1, 2, 3 }; Info<< "labelled:" << l2 << nl; diff --git a/applications/test/fieldMapping/pipe1D/system/blockMeshDict b/applications/test/fieldMapping/pipe1D/system/blockMeshDict index 455cdb1f9b..f5e65a7dfd 100644 --- a/applications/test/fieldMapping/pipe1D/system/blockMeshDict +++ b/applications/test/fieldMapping/pipe1D/system/blockMeshDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 1; +scale 1; vertices ( diff --git a/applications/test/hexRef8/block/system/blockMeshDict b/applications/test/hexRef8/block/system/blockMeshDict index 594ef61bd1..931f6899a1 100644 --- a/applications/test/hexRef8/block/system/blockMeshDict +++ b/applications/test/hexRef8/block/system/blockMeshDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 1; +scale 1; vertices ( diff --git a/applications/test/io/Test-io.C b/applications/test/io/Test-io.C index aeef9468ec..40f503a4ee 100644 --- a/applications/test/io/Test-io.C +++ b/applications/test/io/Test-io.C @@ -40,7 +40,8 @@ using namespace Foam; int main(void) { string st("sfdsf sdfs23df sdf32f . sdfsdff23/2sf32"); - Info<< word(string::validate(st)) << "END" << endl; + Info<<"string: " << st << nl; + Info<<"word: \"" << string::validate(st) << "\"" << endl; string st1("1234567"); diff --git a/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict b/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict index 3118c894d8..6b7e69ca49 100644 --- a/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict +++ b/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 0.1; +scale 0.1; vertices ( diff --git a/applications/test/parallelOverset/heatTransfer/system/blockMeshDict b/applications/test/parallelOverset/heatTransfer/system/blockMeshDict index d04d518b0a..7d3c759df3 100644 --- a/applications/test/parallelOverset/heatTransfer/system/blockMeshDict +++ b/applications/test/parallelOverset/heatTransfer/system/blockMeshDict @@ -15,7 +15,7 @@ FoamFile // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 1; +scale 1; vertices ( diff --git a/applications/test/patchRegion/cavity_pinched/system/blockMeshDict b/applications/test/patchRegion/cavity_pinched/system/blockMeshDict index 5f58428dd6..6c09069cce 100644 --- a/applications/test/patchRegion/cavity_pinched/system/blockMeshDict +++ b/applications/test/patchRegion/cavity_pinched/system/blockMeshDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 0.1; +scale 0.1; vertices ( diff --git a/applications/test/string/Test-string.C b/applications/test/string/Test-string.C index 208e1c297f..7975620442 100644 --- a/applications/test/string/Test-string.C +++ b/applications/test/string/Test-string.C @@ -83,7 +83,8 @@ int main(int argc, char *argv[]) Info<<"camel-case => " << (word("camel") & "case") << nl; for (const auto& s : { " text with \"spaces'", "08/15 value" }) { - Info<<"validated \"" << s << "\" => " << word::validated(s) << nl; + Info<<"validated \"" << s << "\" => " + << word::validate(s, true) << nl; } Info<< nl; diff --git a/applications/test/stringSplit/Make/files b/applications/test/stringSplit/Make/files new file mode 100644 index 0000000000..06bdafe1b2 --- /dev/null +++ b/applications/test/stringSplit/Make/files @@ -0,0 +1,3 @@ +Test-stringSplit.C + +EXE = $(FOAM_USER_APPBIN)/Test-stringSplit diff --git a/applications/test/stringSplit/Make/options b/applications/test/stringSplit/Make/options new file mode 100644 index 0000000000..e69de29bb2 diff --git a/applications/test/stringSplit/Test-stringSplit.C b/applications/test/stringSplit/Test-stringSplit.C new file mode 100644 index 0000000000..9b1208c252 --- /dev/null +++ b/applications/test/stringSplit/Test-stringSplit.C @@ -0,0 +1,81 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Application + Test-stringSplit + +Description + Test string splitting + +\*---------------------------------------------------------------------------*/ + +#include "argList.H" +#include "fileName.H" +#include "stringOps.H" + +using namespace Foam; + +template +void printSplitting(const String& str, const char delimiter) +{ + auto split = stringOps::split(str, delimiter); + + Info<< "string {" << str.size() << " chars} = " << str << nl + << split.size() << " elements {" << split.length() << " chars}" + << nl; + + unsigned i = 0; + for (const auto s : split) + { + Info<< "[" << i++ << "] {" << s.length() << " chars} = " + << s.str() << nl; + } +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// Main program: + +int main(int argc, char *argv[]) +{ + argList::noBanner(); + argList::noParallel(); + + argList args(argc, argv, false, true); + + if (args.size() <= 1 && args.options().empty()) + { + args.printUsage(); + } + + for (label argi=1; argi < args.size(); ++argi) + { + printSplitting(args[argi], '/'); + } + + Info<< "\nEnd\n" << endl; + return 0; +} + + +// ************************************************************************* // diff --git a/applications/test/volField/cavity/system/blockMeshDict b/applications/test/volField/cavity/system/blockMeshDict index cb67af8ad1..69ed9d5201 100644 --- a/applications/test/volField/cavity/system/blockMeshDict +++ b/applications/test/volField/cavity/system/blockMeshDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -convertToMeters 0.1; +scale 0.1; vertices ( diff --git a/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C b/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C index 52377df339..3c971ad743 100644 --- a/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C +++ b/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C @@ -45,7 +45,8 @@ Usage List some information about the geometry - \par -name \ - Provide alternative base name for export. Default is meshExport. + Provide alternative base name for export. + Default is meshExport. - \par -noBaffles Remove any baffles by merging the faces. @@ -57,7 +58,8 @@ Usage Use numbered patch/zone (not names) directly from ccm ids. - \par -remap \ - use specified remapping dictionary instead of constant/remapping + Use specified remapping dictionary instead of + constant/remapping - \par -scale \ Specify an alternative geometry scaling factor. @@ -92,7 +94,8 @@ int main(int argc, char *argv[]) ( "Reads CCM files as written by PROSTAR/STARCCM and writes an OPENFOAM " " polyMesh. Multi-region support for PROSTAR meshes should be stable." - " Multi-region merging for STARCCM meshes will not always be successful." + " Multi-region merging for STARCCM meshes will not always be" + " successful." ); argList::noParallel(); diff --git a/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C b/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C index 9d64cc09b0..31ef8b3a8d 100644 --- a/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C +++ b/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C @@ -44,10 +44,11 @@ Usage No backup of existing output files. - \par -remap \ - use specified remapping dictionary instead of constant/remapping + Use specified remapping dictionary instead of + constant/remapping - \par -results - convert results only to CCM format + Convert results only to CCM format Note - No parallel data @@ -206,8 +207,7 @@ int main(int argc, char *argv[]) // #include "checkHasMovingMesh.H" // #include "checkHasLagrangian.H" - IOobjectList objects(mesh, timeDirs[timeDirs.size()-1].name()); - // IOobjectList sprayObjects(mesh, Times[Times.size()-1].name(), "lagrangian"); + IOobjectList objects(mesh, timeDirs.last().name()); forAll(timeDirs, timeI) { diff --git a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C index 11255ced73..7cc4fbffb8 100644 --- a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C +++ b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) fileName pointsFile(runTime.constantPath()/"points.tmp"); OFstream pFile(pointsFile); - const scalar a = 0.1_deg; + const scalar a = degToRad(0.1); tensor rotateZ = tensor ( diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index ca276a0348..8898cded2c 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -221,6 +221,7 @@ redundantBlock {space}({comment}|{unknownPeriodicFace}|{periodicFace endOfSection {space}")"{space} +/* balance "-quoted for editor */ /* ------------------------------------------------------------------------ *\ ----- Exclusive start states ----- @@ -693,7 +694,7 @@ endOfSection {space}")"{space} {lbrac}{label} { Warning << "Found unknown block of type: " - << Foam::string(YYText())(1, YYLeng()-1) << nl + << std::string(YYText()).substr(1, YYLeng()-1) << nl << " on line " << lineNo << endl; yy_push_state(ignoreBlock); diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L index 6db26071d5..23432898a6 100644 --- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L +++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L @@ -488,7 +488,7 @@ mtype {space}"MTYPE:"{space} {spaceNl}{word}{spaceNl} { - word streamName(Foam::string::validate(YYText())); + const word streamName(word::validate(YYText())); BEGIN(cellStreamFlags); } diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index ea0bd7f6dc..cf87849079 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -370,7 +370,7 @@ void readPhysNames(IFstream& inFile, Map& physicalNames) lineStr >> regionI >> regionName; Info<< " " << regionI << '\t' - << string::validate(regionName) << endl; + << word::validate(regionName) << endl; } else if (nSpaces == 2) { @@ -380,21 +380,21 @@ void readPhysNames(IFstream& inFile, Map& physicalNames) if (physType == 1) { Info<< " " << "Line " << regionI << '\t' - << string::validate(regionName) << endl; + << word::validate(regionName) << endl; } else if (physType == 2) { Info<< " " << "Surface " << regionI << '\t' - << string::validate(regionName) << endl; + << word::validate(regionName) << endl; } else if (physType == 3) { Info<< " " << "Volume " << regionI << '\t' - << string::validate(regionName) << endl; + << word::validate(regionName) << endl; } } - physicalNames.insert(regionI, string::validate(regionName)); + physicalNames.insert(regionI, word::validate(regionName)); } inFile.getLine(line); diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C index 8583c9fac5..6ad6dfcd43 100644 --- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C +++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C @@ -512,7 +512,7 @@ void readSets >> dofSet >> tempSet >> contactSet >> nFaces; is.getLine(line); - word groupName = string::validate(line); + const word groupName = word::validate(line); Info<< "For group " << group << " named " << groupName diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index e97a717f03..5e3afb3b3a 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -419,7 +419,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size()) { // Distribute the points to be +/- 2.5deg from the x-z plane - const scalar tanTheta = Foam::tan(2.5_deg); + const scalar tanTheta = Foam::tan(degToRad(2.5)); SLList::iterator iterf = pFaces[WEDGE][0].begin(); SLList::iterator iterb = pFaces[WEDGE][1].begin(); diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C index df009f3083..575bf8de69 100644 --- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C +++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C @@ -33,10 +33,10 @@ License using namespace Foam::vectorTools; const Foam::scalar Foam::conformalVoronoiMesh::searchConeAngle - = Foam::cos(30.0_deg); + = Foam::cos(degToRad(30.0)); const Foam::scalar Foam::conformalVoronoiMesh::searchAngleOppositeSurface - = Foam::cos(150.0_deg); + = Foam::cos(degToRad(150.0)); // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index 4a64e6f801..2f5b6a5cca 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -903,10 +903,10 @@ int main(int argc, char *argv[]) } // Strip off anything after # - string::size_type i = rawLine.find_first_of("#"); + string::size_type i = rawLine.find('#'); if (i != string::npos) { - rawLine = rawLine(0, i); + rawLine.resize(i); } if (rawLine.empty()) diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C index 81971b85f5..b024745f42 100644 --- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C +++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) << endl; } - int oldFlag = entry::disableFunctionEntries; + const int oldFlag = entry::disableFunctionEntries; if (!enableEntries) { // By default disable dictionary expansion for fields diff --git a/applications/utilities/miscellaneous/foamHelp/foamHelp.C b/applications/utilities/miscellaneous/foamHelp/foamHelp.C index a0e7097e4f..88aac628c0 100644 --- a/applications/utilities/miscellaneous/foamHelp/foamHelp.C +++ b/applications/utilities/miscellaneous/foamHelp/foamHelp.C @@ -45,7 +45,7 @@ int main(int argc, char *argv[]) #include "addToolOption.H" // Intercept request for help - if ((argc > 0) && (strcmp(argv[1], "-help") == 0)) + if ((argc > 1) && (strcmp(argv[1], "-help") == 0)) { #include "setRootCase.H" } diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C index 6789c6f9e9..4be4abb392 100644 --- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C +++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C @@ -598,10 +598,7 @@ int main(int argc, char *argv[]) // Pass2: reconstruct the cloud forAllConstIter(HashTable, cloudObjects, iter) { - const word cloudName = string::validate - ( - iter.key() - ); + const word cloudName = word::validate(iter.key()); // Objects (on arbitrary processor) const IOobjectList& sprayObjs = iter(); diff --git a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C index 9ac03a63c4..d228a42087 100644 --- a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C +++ b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C @@ -89,11 +89,7 @@ int main(int argc, char *argv[]) break; } - if - ( - fieldName.type() != token::WORD - && fieldName.wordToken() != "CELL" - ) + if (!fieldName.isWord() || fieldName.wordToken() != "CELL") { FatalErrorInFunction << "Expected first CELL, found " @@ -103,7 +99,7 @@ int main(int argc, char *argv[]) label nCols = 0; smapFile >> fieldName; - while (fieldName.type() == token::WORD) + while (fieldName.isWord()) { starFieldNames[nCols++] = fieldName.wordToken(); smapFile >> fieldName; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean index 54808b94b1..7a429617b8 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean @@ -1,8 +1,19 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory +# Source the wmake functions +. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions + +# Cleanup OpenFOAM libraries wclean libso foamPv -PVblockMeshReader/Allwclean -PVFoamReader/Allwclean +wclean libso vtkPVblockMesh +wclean libso vtkPVFoam + +# Cleanup client-server and/or combined plugins +rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null +rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null + +# Cleanup generated files - remove entire top-level +removeObjectDir $PWD #------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake index d80b89f34d..cb085fd8c0 100755 --- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake +++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake @@ -12,6 +12,13 @@ export WM_CONTINUE_ON_ERROR=true # ----------------------------------------------------------------------------- +warnIncomplete() +{ + echo + echo " WARNING: incomplete build of ParaView plugin: $@" + echo +} + # major version as per paraview include directory: # Eg, "PREFIX/include/paraview-5.0" -> "5.0" major="${ParaView_INCLUDE_DIR##*-}" @@ -22,8 +29,14 @@ case "$major" in then ( wmakeLibPv foamPv - PVblockMeshReader/Allwmake $targetType $* - PVFoamReader/Allwmake $targetType $* + wmakeLibPv vtkPVblockMesh + wmakeLibPv vtkPVFoam + + if [ "$targetType" != objects ] + then + cmakePv $PWD/PVblockMeshReader || warnIncomplete "BlockMesh" + cmakePv $PWD/PVFoamReader || warnIncomplete "OpenFOAM" + fi ) fi ;; diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean deleted file mode 100755 index 9b1370c3ff..0000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source the wmake functions -. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions - -# Cleanup client-server and/or combined plugins -rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null - -rm -rf PVFoamReader/Make # safety: old build location -wclean libso vtkPVFoam - -# Cleanup generated files - remove entire top-level -removeObjectDir $PWD - -#------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake deleted file mode 100755 index b9f216f54e..0000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - -# Source CMake functions -. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions - -# ----------------------------------------------------------------------------- - -if [ -d "$ParaView_DIR" ] -then - wmakeLibPv vtkPVFoam - - if [ "$targetType" != objects ] - then - cmakePv $PWD/PVFoamReader || { - echo - echo " WARNING: incomplete build of ParaView OpenFOAM plugin" - echo - } - fi -fi - -#------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt similarity index 97% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt index f2fd631fd1..4815a13d8d 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt @@ -14,8 +14,8 @@ include_directories( $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude $ENV{WM_PROJECT_DIR}/src/conversion/lnInclude $ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude + ${PROJECT_SOURCE_DIR}/../foamPv ${PROJECT_SOURCE_DIR}/../vtkPVFoam - ${PROJECT_SOURCE_DIR}/../../foamPv/lnInclude ) add_definitions( diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader_SM.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader_SM.xml diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.cxx rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.cxx diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.h rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.h diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.cxx diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.h diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean deleted file mode 100755 index b49fed7d2d..0000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source the wmake functions -. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions - -# Cleanup client-server and/or combined plugins -rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null - -rm -rf PVblockMeshReader/Make # safety: old build location -wclean libso vtkPVblockMesh - -# Cleanup generated files - remove entire top-level -removeObjectDir $PWD - -#------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake deleted file mode 100755 index 24d577b2ae..0000000000 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - -# Source CMake functions -. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions - -# ----------------------------------------------------------------------------- - -if [ -d "$ParaView_DIR" ] -then - wmakeLibPv vtkPVblockMesh - - if [ "$targetType" != objects ] - then - cmakePv $PWD/PVblockMeshReader || { - echo - echo " WARNING: incomplete build of ParaView BlockMesh plugin" - echo - } - fi -fi - -#------------------------------------------------------------------------------ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt similarity index 97% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt index c3c889ffb5..ff3a876d30 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt +++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt @@ -13,8 +13,8 @@ include_directories( $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude $ENV{WM_PROJECT_DIR}/src/meshing/blockMesh/lnInclude + ${PROJECT_SOURCE_DIR}/../foamPv ${PROJECT_SOURCE_DIR}/../vtkPVblockMesh - ${PROJECT_SOURCE_DIR}/../../foamPv/lnInclude ) add_definitions( diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader_SM.xml similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader_SM.xml diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.cxx rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.cxx diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.h rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.h diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.cxx similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.cxx diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.h similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.h diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/files b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/files rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/files diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/options similarity index 94% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/options index 4a73939711..8c7fdce472 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/options @@ -10,7 +10,7 @@ EXE_INC = \ -I$(LIB_SRC)/conversion/lnInclude \ -I$(ParaView_INCLUDE_DIR) \ -I$(ParaView_INCLUDE_DIR)/vtkkwiml \ - -I../../foamPv/lnInclude \ + -I../foamPv \ -I../PVFoamReader LIB_LIBS = \ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFieldTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFieldTemplates.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFieldTemplates.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFieldTemplates.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFields.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFields.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFields.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFields.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMesh.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMesh.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshVolume.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshVolume.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamTemplates.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamTemplates.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamTemplates.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C similarity index 99% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C index f71354aaa1..335a975fc8 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C @@ -635,8 +635,7 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields if (debug) { - Info<< " updateInfoLagrangianFields - " - << "lagrangian objects.size() = " << objects.size() << endl; + Info<< " " << FUNCTION_NAME << endl; } } diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateTemplates.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateTemplates.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateTemplates.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/files b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/files similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/files rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/files diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/options similarity index 92% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/options rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/options index d07c5b2469..a41d97cf4f 100644 --- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/options +++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/options @@ -7,7 +7,7 @@ EXE_INC = \ -I$(LIB_SRC)/mesh/blockMesh/lnInclude \ -I$(ParaView_INCLUDE_DIR) \ -I$(ParaView_INCLUDE_DIR)/vtkkwiml \ - -I../../foamPv/lnInclude \ + -I../foamPv \ -I../PVblockMeshReader LIB_LIBS = \ diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.H b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.H similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.H rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.H diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMeshConvert.C similarity index 100% rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMeshConvert.C diff --git a/applications/utilities/postProcessing/noise/noiseDict b/applications/utilities/postProcessing/noise/noiseDict index 00a3fbc81d..ca808462c4 100644 --- a/applications/utilities/postProcessing/noise/noiseDict +++ b/applications/utilities/postProcessing/noise/noiseDict @@ -48,8 +48,11 @@ surfaceNoiseCoeffs */ - // Input file - inputFile "postProcessing/faceSource1/surface/patch_motorBike_rider-helmet%65/patch_motorBike_rider-helmet%65.case"; + // Input file(s) + file "postProcessing/faceSource1/surface/patch1/patch1.case"; + // Multiple inputs + //files ( "postProcessing/faceSource1/surface/patch1/patch1.case" + // "postProcessing/faceSource2/surface/patch2/patch2.case" ); // Surface reader reader ensight; @@ -83,20 +86,25 @@ surfaceNoiseCoeffs //startTime 0; // Write interval for FFT data, default = 1 -// fftWriteInterval 100; + //fftWriteInterval 100; + + // Bounds for valid pressure from input source + // Maximum pressure, default 0.5*VGREAT + //maxPressure 150e5; + + // Minimum pressure, default -0.5*VGREAT + //minPressure -150e5; } pointNoiseCoeffs { - csvFileData - { - file "pressureData"; - nHeaderLine 1; - refColumn 0; - componentColumns (1); - separator " "; - mergeSeparators yes; - } + file "pressureData"; + //files ( "pressureData" "pressureData2"); + nHeaderLine 1; + refColumn 0; + componentColumns (1); + separator " "; + mergeSeparators yes; HanningCoeffs { @@ -130,6 +138,13 @@ pointNoiseCoeffs // Write interval for FFT data, default = 1 fftWriteInterval 100; + + // Bounds for valid pressure from input source + // Maximum pressure, default 0.5*VGREAT + //maxPressure 150e5; + + // Minimum pressure, default -0.5*VGREAT + //minPressure -150e5; } diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C index 3f7f51dd2d..8a01c21eb4 100644 --- a/applications/utilities/postProcessing/postProcess/postProcess.C +++ b/applications/utilities/postProcessing/postProcess/postProcess.C @@ -191,7 +191,7 @@ int main(int argc, char *argv[]) ); } - FatalIOError.throwExceptions(); + const bool throwingIOErr = FatalIOError.throwExceptions(); try { @@ -208,12 +208,15 @@ int main(int argc, char *argv[]) // Report to output (avoid overwriting values from simulation) profiling::print(Info); } - catch (IOerror& err) + catch (Foam::IOerror& err) { Warning<< err << endl; } Info<< endl; + + // Restore previous exception throwing state + FatalIOError.throwExceptions(throwingIOErr); } Info<< "End\n" << endl; diff --git a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C index d9a7fbb8fc..f9be71c75f 100644 --- a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C +++ b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C @@ -254,7 +254,7 @@ bool merge if (key[0] == '~') { - word eraseKey = key(1, key.size()-1); + const word eraseKey = key.substr(1); if (thisDict.remove(eraseKey)) { // Mark thisDict entry as having been match for wildcard @@ -325,7 +325,7 @@ bool merge if (key[0] == '~') { - word eraseKey = key(1, key.size()-1); + const word eraseKey = key.substr(1); // List of indices into thisKeys labelList matches @@ -464,7 +464,7 @@ int main(int argc, char *argv[]) << endl; } - int oldFlag = entry::disableFunctionEntries; + const int oldFlag = entry::disableFunctionEntries; if (!enableEntries) { // By default disable dictionary expansion for fields diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C index bca1b7a394..b35b5b3707 100644 --- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C +++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C @@ -500,7 +500,7 @@ int main(int argc, char *argv[]) IOobjectList objects(runTime, runTime.timeName()); - int oldFlag = entry::disableFunctionEntries; + const int oldFlag = entry::disableFunctionEntries; if (!enableEntries) { // By default disable dictionary expansion for fields diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C index 24834c227f..27b20c5932 100644 --- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C +++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C @@ -91,7 +91,7 @@ void Foam::tabulatedWallFunctions::SpaldingsLaw::invertFunction() ( 2*E_*uPlus + exp(kUPlus)*(kUPlus + 1) - - 2/3*pow3(kUPlus) + - 2.0/3.0*pow3(kUPlus) - 1.5*sqr(kUPlus) - 2*kUPlus - 1 diff --git a/bin/tools/foamCreateBashCompletions b/bin/tools/foamCreateBashCompletions deleted file mode 100755 index f7c384f482..0000000000 --- a/bin/tools/foamCreateBashCompletions +++ /dev/null @@ -1,229 +0,0 @@ -#!/bin/sh -#------------------------------------------------------------------------------ -# ========= | -# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox -# \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. -# \\/ M anipulation | -#------------------------------------------------------------------------------ -# License -# This file is part of OpenFOAM. -# -# OpenFOAM is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -# for more details. -# -# You should have received a copy of the GNU General Public License -# along with OpenFOAM. If not, see . -# -# Script -# foamCreateBashCompletions -# -# Description -# Create bash completions for OpenFOAM applications -# -#------------------------------------------------------------------------------ -usage() { - exec 1>&2 - while [ "$#" -ge 1 ]; do echo "$1"; shift; done - cat< -options: - -d dir | -dir dir Directory to process - -u | -user Add \$FOAM_USER_APPBIN to the search directories - -h | -help Print the usage - -Create bash completions for OpenFOAM applications and write to . -By default searches \$FOAM_APPBIN only. - -USAGE - exit 1 -} - -# Report error and exit -die() -{ - exec 1>&2 - echo - echo "Error encountered:" - while [ "$#" -ge 1 ]; do echo " $1"; shift; done - echo - echo "See '${0##*/} -help' for usage" - echo - exit 1 -} - -#------------------------------------------------------------------------------- -#set -x - -unset outFile -searchDirs="$FOAM_APPBIN" -while [ "$#" -gt 0 ] -do - case "$1" in - -h | -help) - usage - ;; - -d | -dir) - searchDirs="$2" - [ -d $searchDirs ] || usage "directory not found '$searchDirs'" - shift - ;; - -u | -user) - searchDirs="$searchDirs $FOAM_USER_APPBIN" - ;; - -*) - usage "unknown option: '$1'" - ;; - *) - outFile=$1 - break - ;; - esac - shift -done - -[ -n "$outFile" ] || usage "No output file specified" - - -# Generate header -cat << HEADER > $outFile -#----------------------------------*-sh-*-------------------------------------- -# Bash completions for OpenFOAM applications -# Formatted as "complete ... -F _of_APPNAME APPNAME - -unset -f _of_filter_opts 2>/dev/null -_of_filter_opts() -{ - local allOpts=\$1 - local applied=\$2 - for o in \${allOpts}; do - [ "\${applied/\$o/}" == "\${applied}" ] && echo \$o - done -} - -HEADER - -#------------------------------------------------------------------------------ - -# -# Produce contents for switch for common options -# -commonOptions() -{ - local indent1=" " - local indent2=" " - for opt - do - case $opt in - -case) - echo "${indent1}-case)" - echo "${indent2}COMPREPLY=(\$(compgen -d -- \${cur}))" - echo "${indent2};;" - ;; - -srcDoc|-help) - echo "${indent1}-srcDoc|-help)" - echo "${indent2}COMPREPLY=()" - echo "${indent2};;" - ;; - -time) - echo "${indent1}-time)" - echo "${indent2}COMPREPLY=(\$(compgen -d -X '![-0-9]*' -- \${cur}))" - echo "${indent2};;" - ;; - -region) - echo "${indent1}-region)" - echo "${indent2}local regions=\$(sed 's#/##g' <<< \$([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))" - echo "${indent2}COMPREPLY=(\$(compgen -W \"\$regions\" -- \${cur}))" - echo "${indent2};;" - ;; - *Dict) - echo "${indent1}*Dict)" -# echo "${indent2}local dirs=\$(\ls -d s*/)" -# echo "${indent2}local files=\$(\ls -f | grep Dict)" -# echo "${indent2}COMPREPLY=(\$(compgen -W \"\$dirs \$files\" -- \${cur}))" - echo "${indent2}COMPREPLY=(\$(compgen -f -- \${cur}))" - echo "${indent2};;" - ;; - esac - done -} - - -#------------------------------------------------------------------------------ - -for dir in ${searchDirs} -do - if [ -d "$dir" ] - then - echo "Processing directory $dir" 1>&2 - else - echo "No such directory: $dir" 1>&2 - continue - fi - - # Sort with ignore-case - set -- $(\ls $dir | sort -f) - for appName - do - [ -f "$dir/$appName" -a -x "$dir/$appName" ] || continue - appHelp=$($appName -help) - - echo " $appName" 1>&2 - - # Options with args - optsWithArgs=($(awk '/^ {0,4}-[a-z]/ && /> $outFile -unset -f _of_${appName} 2>/dev/null -_of_${appName}() -{ - local cur="\${COMP_WORDS[COMP_CWORD]}" - local prev="\${COMP_WORDS[COMP_CWORD-1]}" - - local opts="${opts[@]} " - local optsWithArgs="${optsWithArgs[@]} " - - case \${prev} in -$(commonOptions ${optsWithArgs[@]}) - *) - if [ "\${optsWithArgs/\${prev} /}" != "\${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=(\$(compgen -f -- \${cur})) - else - # Catch-all - present all remaining options - opts=\$(_of_filter_opts "\${opts}" "\${COMP_LINE}") - optsWithArgs=\$(_of_filter_opts "\${optsWithArgs}" "\${COMP_LINE}") - COMPREPLY=(\$(compgen -W "\${opts} \${optsWithArgs}" -- \${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_${appName} $appName - -WRITECOMPLETION - done -done - - -# Generate footer -cat << FOOTER >> $outFile - -#------------------------------------------------------------------------------ -FOOTER - -#------------------------------------------------------------------------------ diff --git a/bin/tools/foamCreateCompletionCache b/bin/tools/foamCreateCompletionCache new file mode 100755 index 0000000000..48f1e3449a --- /dev/null +++ b/bin/tools/foamCreateCompletionCache @@ -0,0 +1,199 @@ +#!/bin/bash +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# License +# This file is part of OpenFOAM. +# +# OpenFOAM is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenFOAM. If not, see . +# +# Script +# foamCreateCompletionCache +# +# Description +# Create cache of bash completion values for OpenFOAM applications +# The cached values are typically used by the tcsh completion wrapper. +# +#------------------------------------------------------------------------------ +defaultOutputFile="$WM_PROJECT_DIR/etc/config.sh/completion_cache" + +usage() { + exec 1>&2 + while [ "$#" -ge 1 ]; do echo "$1"; shift; done + cat<&2 + echo + echo "Error encountered:" + while [ "$#" -ge 1 ]; do echo " $1"; shift; done + echo + echo "See '${0##*/} -help' for usage" + echo + exit 1 +} + +#------------------------------------------------------------------------------- + +searchDirs="$FOAM_APPBIN" +optHeader=true +unset outputFile +while [ "$#" -gt 0 ] +do + case "$1" in + -h | -help) + usage + ;; + -d | -dir) + [ "$#" -ge 2 ] || die "'$1' option requires an argument" + searchDirs="$2" + [ -d "$searchDirs" ] || die "directory not found '$searchDirs'" + shift + ;; + -u | -user) + searchDirs="$searchDirs $FOAM_USER_APPBIN" + ;; + -no-head*) + optHeader=false + ;; + -o | -output) + [ "$#" -ge 2 ] || die "'$1' option requires an argument" + outputFile="$2" + shift + ;; + -*) + usage "unknown option: '$1'" + ;; + *) + break + ;; + esac + shift +done + +: ${outputFile:=$defaultOutputFile} + +# Verify that output is writeable +if [ -e "$outputFile" ] +then + [ -f "$outputFile" ] || \ + die "Cannot overwrite $outputFile" "Not a file" + [ -w "$outputFile" ] || \ + die "Cannot overwrite $outputFile" "No permission?" +else + [ -w "$(dirname $outputFile)" ] || \ + die "Cannot write $outputFile" "directory is not writeble" +fi + +exec 1>| $outputFile || exit $? +echo "Writing $outputFile" 1>&2 +echo 1>&2 + +# Header not disabled +[ "$optHeader" = true ] && cat << HEADER +#----------------------------------*-sh-*-------------------------------------- +# Cached options for bash completion of OpenFOAM applications. +# These are the values expected by the '_of_complete_' function +# +# Recreate with "${0##*/}" + +# Global associative array (cached options for OpenFOAM applications) +declare -gA _of_complete_cache_; + +# Clear existing cache. +_of_complete_cache_=() + +#------------------------------------------------------------------------------ +HEADER + +#------------------------------------------------------------------------------- + +# Scans the output of the application -help to detect options with/without +# arguments. Dispatch via _of_complete_ +# +extractOptions() +{ + local appName="$1" + local helpText=$($appName -help 2>/dev/null | sed -ne '/^ *-/p') + + [ -n "$helpText" ] || { + echo "Error calling $appName" 1>&2 + return 1 + } + + # Array of options with args + local argOpts=($(awk '/^ {0,4}-[a-z]/ && /&2 + echo "_of_complete_cache_[${appName}]=\"${argOpts[@]} | ${boolOpts[@]}\"" +} +#------------------------------------------------------------------------------ + +[ "$#" -gt 0 ] || set -- ${searchDirs} + +for item +do + if [ -d "$item" ] + then + # Process directory for applications - sort with ignore-case + echo "[directory] $item" 1>&2 + choices="$(find $item -maxdepth 1 -executable -type f | sort -f 2>/dev/null)" + for appName in $choices + do + extractOptions $appName + done + elif command -v "$item" > /dev/null 2>&1 + then + extractOptions $item + else + echo "No such file or directory: $item" 1>&2 + fi +done + +# Generate footer +[ "$optHeader" = true ] && cat << FOOTER + +#------------------------------------------------------------------------------ +FOOTER + +#------------------------------------------------------------------------------ diff --git a/etc/bashrc b/etc/bashrc index 97c8152b33..e2e887ac64 100644 --- a/etc/bashrc +++ b/etc/bashrc @@ -175,9 +175,9 @@ then _foamEtc config.sh/aliases # Bash completions - if command -v complete > /dev/null 2>&1 + if [ "${BASH_VERSINFO:-0}" -ge 4 ] then - _foamEtc config.sh/bashcompletion + _foamEtc config.sh/bash_completion fi fi diff --git a/etc/config.csh/complete-wrapper b/etc/config.csh/complete-wrapper new file mode 100644 index 0000000000..8fbbdffac6 --- /dev/null +++ b/etc/config.csh/complete-wrapper @@ -0,0 +1,102 @@ +#!bash +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# This file is part of OpenFOAM, licensed under the GNU General Public License +# . +# +# File +# etc/config.csh/complete-wrapper +# +# Description +# A wrapper for using OpenFOAM bash completions with tcsh. +# +# Arguments +# appName = the application name +# +# Environment +# The tcsh COMMAND_LINE is passed in via the environment. +# This corresponds to the bash COMP_LINE variable +# +#------------------------------------------------------------------------------ +[ "$#" -ge 1 ] || exit 1 + +# Support '-test' option to check bash version +if [ "$1" = "-test" ] +then + # Uses 'declare -gA' for the implementation + # The '-A' requires bash >= 4.0 and the '-g' requires bash >= 4.2 + [ "${BASH_VERSINFO[0]:-0}${BASH_VERSINFO[1]:-0}" -ge 42 ] + exit $? +fi + +# Preload completion cache +if [ -f $WM_PROJECT_DIR/etc/config.sh/completion_cache ] +then . $WM_PROJECT_DIR/etc/config.sh/completion_cache +fi + +# Use the bash completion function, but retain cache etc. +_of_complete_tcsh=true +if [ -f $WM_PROJECT_DIR/etc/config.sh/bash_completion ] +then . $WM_PROJECT_DIR/etc/config.sh/bash_completion +else + # Could warn about missing file, or treat silently + echo + exit 1 +fi + +appName=$1 + +# Ensure COMP_LINE is available for bash function +if [ "$#" -eq 2 ] +then + COMP_LINE=$2 +else + COMP_LINE=$COMMAND_LINE +fi + +# Remove the colon as a completion separator because tcsh cannot handle it +COMP_WORDBREAKS=${COMP_WORDBREAKS//:} + +# Set COMP_WORDS in a way that can be handled by the bash script. +COMP_WORDS=($COMP_LINE) + +# The cursor is at the end of parameter #1. +# We must check for a space as the last character which will +# tell us that the previous word is complete and the cursor +# is on the next word. +if [ "${COMP_LINE: -1}" = " " ] +then + # The last character is a space, so our location is at the end + # of the command-line array + COMP_CWORD=${#COMP_WORDS[@]} +else + # The last character is not a space, so our location is on the + # last word of the command-line array, so we must decrement the + # count by 1 + COMP_CWORD=$((${#COMP_WORDS[@]}-1)) +fi + +# Call _of_complete_ APPNAME Current Previous +_of_complete_ \ + "$appName" "${COMP_WORDS[COMP_CWORD]}" "${COMP_WORDS[COMP_CWORD-1]}" + +# Tcsh needs slash on the end of directories +reply=($(for i in ${COMPREPLY[@]} + do + if [ -d "$i" -a "${i#/}" = "$i" ] + then + echo "$i/" + else + echo "$i" + fi + done +)) + +echo ${reply[@]} + +#------------------------------------------------------------------------------ diff --git a/etc/config.csh/tcsh_completion b/etc/config.csh/tcsh_completion new file mode 100644 index 0000000000..9dfcca7046 --- /dev/null +++ b/etc/config.csh/tcsh_completion @@ -0,0 +1,47 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# This file is part of OpenFOAM, licensed under the GNU General Public License +# . +# +# File +# etc/config.csh/tcsh_completion +# +# Description +# Tcsh completions for OpenFOAM applications +# Using bash completion for the hard work +# +# Requires +# bash 4.2 or newer +# +#------------------------------------------------------------------------------ + +if ($?tcsh) then # tcsh only + + # Remove old completions, which look like: + # complete APPNAME 'p,*,`bash $WM_PROJECT_DIR/etc/ ... + foreach appName (`complete | sed -ne '/WM_PROJECT/s/\t.*$//p'`) + uncomplete $appName + end + + # Generate completions for predefined directories (if support is possible) + bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper -test + if ($status == 0) then + foreach dirName ("$FOAM_APPBIN") + if ( ! -d $dirName ) continue + foreach appName (`find $dirName -maxdepth 1 -executable -type f`) + # Pass explicitly + ## complete $appName:t 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper '$appName:t' "${COMMAND_LINE}"`,' + # Pass via environment + complete $appName:t 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper '$appName:t'`,' + end + end + endif + +endif + +#------------------------------------------------------------------------------ diff --git a/etc/config.csh/unset b/etc/config.csh/unset index 6f52ec8c42..20f7c9eb6d 100644 --- a/etc/config.csh/unset +++ b/etc/config.csh/unset @@ -196,6 +196,14 @@ unalias wmRefresh unalias foamVersion unalias foamPV +# Remove old completions, which look like: +# complete APPNAME 'p,*,`bash $WM_PROJECT_DIR/etc/ ... +if ($?prompt && $?tcsh) then # Interactive tcsh only + foreach cleaned (`complete | sed -ne '/WM_PROJECT/s/\t.*$//p'`) + uncomplete $cleaned + end +endif + #------------------------------------------------------------------------------ # Intermediate variables (do as last for a clean exit code) diff --git a/etc/config.sh/bash_completion b/etc/config.sh/bash_completion new file mode 100644 index 0000000000..8d671ee9f7 --- /dev/null +++ b/etc/config.sh/bash_completion @@ -0,0 +1,227 @@ +#----------------------------------*-sh-*-------------------------------------- +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | +# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\/ M anipulation | +#------------------------------------------------------------------------------ +# This file is part of OpenFOAM, licensed under the GNU General Public License +# . +# +# File +# etc/config.sh/bash_completion +# +# Description +# Bash completion handler for OpenFOAM applications and automatic +# generation of completion associations +# +# Provides +# foamAddCompletion +# _of_complete_ +# +# Uses +# _of_complete_cache_ +# +# Requires +# bash 4.2 or newer +# +#------------------------------------------------------------------------------ + +# Remove old completions (skip for tcsh wrapper), which look like: +# "complete ... -F _of_complete_ APPNAME +if [ -z "$_of_complete_tcsh" ] +then + # For economy, obtain list first + foamOldDirs="$(complete 2>/dev/null | sed -ne 's/^.*-F _of_.* \(..*\)$/\1/p')" + for cleaned in $foamOldDirs + do + complete -r $cleaned 2>/dev/null + done +fi + + +# Add completion for command or directory of commands +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +unset -f foamAddCompletion 2>/dev/null +foamAddCompletion() +{ + [ "$#" -gt 0 ] || \ + echo "Usage: foamAddCompletion -clear | -list | dir(s) | app(s)" 1>&2 + + local appName choices + for appName + do + if [ "$appName" = "-clear" ] + then + # Clear cached values + echo "clear cached values" + _of_complete_cache_=() + + elif [ "$appName" = "-list" ] + then + # List cached keys + choices="${#_of_complete_cache_[@]}" + echo "$choices cached values:" + [ "$choices" = 0 ] || echo ${!_of_complete_cache_[@]} # keys + + elif [ -d "$appName" ] + then + # Process directory for applications + choices="$(find $appName -maxdepth 1 -executable -type f 2>/dev/null)" + for appName in $choices + do + complete -o filenames -F _of_complete_ "${appName##*/}" + # echo "complete ${appName##*/}" 1>&2 + done + + elif command -v "$appName" > /dev/null 2>&1 + then + complete -o filenames -F _of_complete_ "${appName##*/}" + # echo "complete ${appName##*/}" 1>&2 + else + echo "No completion added for $appName" 1>&2 + fi + done +} + + +# Generic completion handler for OpenFOAM applications +# +# Dispatch via "complete ... -F _of_complete_ APPNAME +# - arg1 = command-name +# - arg2 = current word +# - arg3 = previous word +# +# The respective options are generated on-the-fly from the application's -help +# output and cached to the _of_complete_cache_ global associative array with +# entries formatted as "argOpts.. | boolOpts ..". +# The '|' character separates options with and without arguments. +# +unset -f _of_complete_ 2>/dev/null +_of_complete_() +{ + local appName=$1 + local cur=$2 + local prev=$3 + local choices + + case ${prev} in + -help|-doc|-srcDoc) + # These options are usage - we can stop now. + COMPREPLY=() + return 0 + ;; + -case) + COMPREPLY=($(compgen -d -- ${cur})) + ;; + -time) + # Could use "foamListTimes -withZero", but still doesn't address ranges + COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) + ;; + -region) + choices=$(\ls -d system/*/ 2>/dev/null | sed -e 's#/$##' -e 's#^.*/##') + COMPREPLY=($(compgen -W "$choices" -- ${cur})) + ;; + -fileHandler) + choices="collated uncollated masterUncollated" + COMPREPLY=($(compgen -W "$choices" -- ${cur})) + ;; + *) + # All options + choices="${_of_complete_cache_[$appName]}" + + # Not in cache, obtain by parsing application -help + if [ -z "$choices" ] + then + local helpText=$($appName -help 2>/dev/null | sed -ne '/^ *-/p') + + if [ -n "$helpText" ] + then + # Array of options with args + local argOpts=($(awk '/^ {0,4}-[a-z]/ && /&2 + choices="false" # Mark failure to prevent repeating again + fi + _of_complete_cache_[$appName]="$choices" + ## echo "generated $appName = $choices" 1>&2 # Debugging + fi + if [ "${choices:-false}" = false ] + then + COMPREPLY=($(compgen -f -- ${cur})) + else + # Everything before the '|' ==> options with args. + local argOpts="${choices%|*}" + + if [ "${argOpts/${prev} /}" != "${argOpts}" ] + then + # Option with unknown type of arg - set to files. + # Not always correct but can still navigate path if needed... + COMPREPLY=($(compgen -f -- ${cur})) + elif [ -n "$cur" -a "${cur#-}" = "${cur}" ] + then + # Already started a (non-empty) word that isn't an option, + # in which case revert to filenames. + COMPREPLY=($(compgen -f -- ${cur})) + else + # Catchall + # - Present remaining options (not already seen in $COMP_LINE) + choices=$( + for o in ${choices} + do + [ "${COMP_LINE/$o/}" = "${COMP_LINE}" ] && echo "${o#|}" + done + ) + + COMPREPLY=($(compgen -W "$choices" -- ${cur})) + fi + fi + ;; + esac + + return 0 +} + +#------------------------------------------------------------------------------ + + +# Uses 'declare -gA' for the implementation +# The '-A' requires bash >= 4.0 and the '-g' requires bash >= 4.2 +if [ "${BASH_VERSINFO[0]:-0}${BASH_VERSINFO[1]:-0}" -ge 42 ] +then + # Global associative array (cached options for OpenFOAM applications) + declare -gA _of_complete_cache_; + + # Clear existing cache and reassign bash completions. + # But for tcsh wrapper make use of caching and avoid this overhead. + if [ -z "$_of_complete_tcsh" ] + then + _of_complete_cache_=() + + # Generate completions for predefined directories + foamAddCompletion $FOAM_APPBIN + fi +else + # Bash version is too old. + ## echo "No bash completions - requires bash >= 4.2" 1>&2 + + unset -f foamAddCompletion 2>/dev/null + foamAddCompletion() + { + echo "foamAddCompletion disabled - requires bash >= 4.2" 1>&2 + } + + unset -f _of_complete_ 2>/dev/null +fi + +#------------------------------------------------------------------------------ +# Intermediate variables (do as last for a clean exit code) + +unset cleaned foamOldDirs + +#------------------------------------------------------------------------------ diff --git a/etc/config.sh/bashcompletion b/etc/config.sh/bashcompletion deleted file mode 100644 index b2e723b793..0000000000 --- a/etc/config.sh/bashcompletion +++ /dev/null @@ -1,8546 +0,0 @@ -#----------------------------------*-sh-*-------------------------------------- -# Bash completions for OpenFOAM applications -# Formatted as "complete ... -F _of_APPNAME APPNAME - -unset -f _of_filter_opts 2>/dev/null -_of_filter_opts() -{ - local allOpts=$1 - local applied=$2 - for o in ${allOpts}; do - [ "${applied/$o/}" == "${applied}" ] && echo $o - done -} - -unset -f _of_adiabaticFlameT 2>/dev/null -_of_adiabaticFlameT() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_adiabaticFlameT adiabaticFlameT - -unset -f _of_adjointShapeOptimizationFoam 2>/dev/null -_of_adjointShapeOptimizationFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_adjointShapeOptimizationFoam adjointShapeOptimizationFoam - -unset -f _of_ansysToFoam 2>/dev/null -_of_ansysToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_ansysToFoam ansysToFoam - -unset -f _of_applyBoundaryLayer 2>/dev/null -_of_applyBoundaryLayer() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -ybl " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_applyBoundaryLayer applyBoundaryLayer - -unset -f _of_attachMesh 2>/dev/null -_of_attachMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_attachMesh attachMesh - -unset -f _of_autoPatch 2>/dev/null -_of_autoPatch() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_autoPatch autoPatch - -unset -f _of_blockMesh 2>/dev/null -_of_blockMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-blockTopology -noClean -noFunctionObjects -sets -srcDoc -doc -help " - local optsWithArgs="-case -dict -region " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_blockMesh blockMesh - -unset -f _of_boundaryFoam 2>/dev/null -_of_boundaryFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_boundaryFoam boundaryFoam - -unset -f _of_boxTurb 2>/dev/null -_of_boxTurb() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_boxTurb boxTurb - -unset -f _of_buoyantBoussinesqPimpleFoam 2>/dev/null -_of_buoyantBoussinesqPimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_buoyantBoussinesqPimpleFoam buoyantBoussinesqPimpleFoam - -unset -f _of_buoyantBoussinesqSimpleFoam 2>/dev/null -_of_buoyantBoussinesqSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_buoyantBoussinesqSimpleFoam buoyantBoussinesqSimpleFoam - -unset -f _of_buoyantPimpleFoam 2>/dev/null -_of_buoyantPimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_buoyantPimpleFoam buoyantPimpleFoam - -unset -f _of_buoyantSimpleFoam 2>/dev/null -_of_buoyantSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_buoyantSimpleFoam buoyantSimpleFoam - -unset -f _of_cavitatingDyMFoam 2>/dev/null -_of_cavitatingDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_cavitatingDyMFoam cavitatingDyMFoam - -unset -f _of_cavitatingFoam 2>/dev/null -_of_cavitatingFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_cavitatingFoam cavitatingFoam - -unset -f _of_cfx4ToFoam 2>/dev/null -_of_cfx4ToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_cfx4ToFoam cfx4ToFoam - -unset -f _of_changeDictionary 2>/dev/null -_of_changeDictionary() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -disablePatchGroups -enableFunctionEntries -latestTime -literalRE -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -instance -region -roots -subDict -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_changeDictionary changeDictionary - -unset -f _of_checkMesh 2>/dev/null -_of_checkMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-allGeometry -allTopology -constant -latestTime -meshQuality -newTimes -noFunctionObjects -noTopology -noZero -parallel -writeAllFields -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time -writeFields -writeSets " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_checkMesh checkMesh - -unset -f _of_chemFoam 2>/dev/null -_of_chemFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -postProcess -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_chemFoam chemFoam - -unset -f _of_chemkinToFoam 2>/dev/null -_of_chemkinToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-newFormat -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_chemkinToFoam chemkinToFoam - -unset -f _of_chtMultiRegionFoam 2>/dev/null -_of_chtMultiRegionFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_chtMultiRegionFoam chtMultiRegionFoam - -unset -f _of_chtMultiRegionSimpleFoam 2>/dev/null -_of_chtMultiRegionSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_chtMultiRegionSimpleFoam chtMultiRegionSimpleFoam - -unset -f _of_coalChemistryFoam 2>/dev/null -_of_coalChemistryFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_coalChemistryFoam coalChemistryFoam - -unset -f _of_coldEngineFoam 2>/dev/null -_of_coldEngineFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_coldEngineFoam coldEngineFoam - -unset -f _of_collapseEdges 2>/dev/null -_of_collapseEdges() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-collapseFaces -constant -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -collapseFaceSet -decomposeParDict -dict -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_collapseEdges collapseEdges - -unset -f _of_combinePatchFaces 2>/dev/null -_of_combinePatchFaces() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-meshQuality -noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -concaveAngle -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_combinePatchFaces combinePatchFaces - -unset -f _of_compressibleInterDyMFoam 2>/dev/null -_of_compressibleInterDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_compressibleInterDyMFoam compressibleInterDyMFoam - -unset -f _of_compressibleInterFoam 2>/dev/null -_of_compressibleInterFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_compressibleInterFoam compressibleInterFoam - -unset -f _of_compressibleMultiphaseInterFoam 2>/dev/null -_of_compressibleMultiphaseInterFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_compressibleMultiphaseInterFoam compressibleMultiphaseInterFoam - -unset -f _of_createBaffles 2>/dev/null -_of_createBaffles() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_createBaffles createBaffles - -unset -f _of_createExternalCoupledPatchGeometry 2>/dev/null -_of_createExternalCoupledPatchGeometry() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -commsDir -decomposeParDict -region -regions -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_createExternalCoupledPatchGeometry createExternalCoupledPatchGeometry - -unset -f _of_createPatch 2>/dev/null -_of_createPatch() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -writeObj -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_createPatch createPatch - -unset -f _of_createZeroDirectory 2>/dev/null -_of_createZeroDirectory() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots -templateDir " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_createZeroDirectory createZeroDirectory - -unset -f _of_datToFoam 2>/dev/null -_of_datToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_datToFoam datToFoam - -unset -f _of_decomposePar 2>/dev/null -_of_decomposePar() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-allRegions -cellDist -constant -copyUniform -copyZero -fields -force -ifRequired -latestTime -newTimes -noFunctionObjects -noSets -noZero -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_decomposePar decomposePar - -unset -f _of_deformedGeom 2>/dev/null -_of_deformedGeom() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_deformedGeom deformedGeom - -unset -f _of_dnsFoam 2>/dev/null -_of_dnsFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_dnsFoam dnsFoam - -unset -f _of_DPMDyMFoam 2>/dev/null -_of_DPMDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloudName -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_DPMDyMFoam DPMDyMFoam - -unset -f _of_DPMFoam 2>/dev/null -_of_DPMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloud -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_DPMFoam DPMFoam - -unset -f _of_driftFluxFoam 2>/dev/null -_of_driftFluxFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_driftFluxFoam driftFluxFoam - -unset -f _of_dsmcFoam 2>/dev/null -_of_dsmcFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_dsmcFoam dsmcFoam - -unset -f _of_dsmcInitialise 2>/dev/null -_of_dsmcInitialise() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_dsmcInitialise dsmcInitialise - -unset -f _of_electrostaticFoam 2>/dev/null -_of_electrostaticFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_electrostaticFoam electrostaticFoam - -unset -f _of_engineCompRatio 2>/dev/null -_of_engineCompRatio() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_engineCompRatio engineCompRatio - -unset -f _of_engineFoam 2>/dev/null -_of_engineFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_engineFoam engineFoam - -unset -f _of_engineSwirl 2>/dev/null -_of_engineSwirl() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_engineSwirl engineSwirl - -unset -f _of_equilibriumCO 2>/dev/null -_of_equilibriumCO() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_equilibriumCO equilibriumCO - -unset -f _of_equilibriumFlameT 2>/dev/null -_of_equilibriumFlameT() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_equilibriumFlameT equilibriumFlameT - -unset -f _of_extrude2DMesh 2>/dev/null -_of_extrude2DMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_extrude2DMesh extrude2DMesh - -unset -f _of_extrudeMesh 2>/dev/null -_of_extrudeMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_extrudeMesh extrudeMesh - -unset -f _of_extrudeToRegionMesh 2>/dev/null -_of_extrudeToRegionMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_extrudeToRegionMesh extrudeToRegionMesh - -unset -f _of_faceAgglomerate 2>/dev/null -_of_faceAgglomerate() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_faceAgglomerate faceAgglomerate - -unset -f _of_financialFoam 2>/dev/null -_of_financialFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_financialFoam financialFoam - -unset -f _of_fireFoam 2>/dev/null -_of_fireFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_fireFoam fireFoam - -unset -f _of_fireToFoam 2>/dev/null -_of_fireToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-ascii -check -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_fireToFoam fireToFoam - -unset -f _of_flattenMesh 2>/dev/null -_of_flattenMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_flattenMesh flattenMesh - -unset -f _of_fluent3DMeshToFoam 2>/dev/null -_of_fluent3DMeshToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-cubit -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -ignoreCellGroups -ignoreFaceGroups -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_fluent3DMeshToFoam fluent3DMeshToFoam - -unset -f _of_fluentMeshToFoam 2>/dev/null -_of_fluentMeshToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -writeSets -writeZones -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_fluentMeshToFoam fluentMeshToFoam - -unset -f _of_foamDataToFluent 2>/dev/null -_of_foamDataToFluent() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help " - local optsWithArgs="-case -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamDataToFluent foamDataToFluent - -unset -f _of_foamDictionary 2>/dev/null -_of_foamDictionary() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -srcDoc -doc -help " - local optsWithArgs="-add -case -decomposeParDict -diff -entry -roots -set " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamDictionary foamDictionary - -unset -f _of_foamFormatConvert 2>/dev/null -_of_foamFormatConvert() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -enableFunctionEntries -latestTime -newTimes -noConstant -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamFormatConvert foamFormatConvert - -unset -f _of_foamHelp 2>/dev/null -_of_foamHelp() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamHelp foamHelp - -unset -f _of_foamList 2>/dev/null -_of_foamList() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-compressibleTurbulenceModels -functionObjects -fvOptions -incompressibleTurbulenceModels -noFunctionObjects -registeredSwitches -switches -unset -srcDoc -doc -help " - local optsWithArgs="-case -scalarBCs -vectorBCs " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamList foamList - -unset -f _of_foamListTimes 2>/dev/null -_of_foamListTimes() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -processor -rm -withZero -srcDoc -doc -help " - local optsWithArgs="-case -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamListTimes foamListTimes - -unset -f _of_foamMeshToFluent 2>/dev/null -_of_foamMeshToFluent() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamMeshToFluent foamMeshToFluent - -unset -f _of_foamToEnsight 2>/dev/null -_of_foamToEnsight() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -srcDoc -doc -help " - local optsWithArgs="-case -cellZone -decomposeParDict -faceZones -fields -name -patches -region -roots -time -width " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToEnsight foamToEnsight - -unset -f _of_foamToEnsightParts 2>/dev/null -_of_foamToEnsightParts() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noMesh -noZero -srcDoc -doc -help " - local optsWithArgs="-case -index -name -time -width " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToEnsightParts foamToEnsightParts - -unset -f _of_foamToFireMesh 2>/dev/null -_of_foamToFireMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-ascii -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help " - local optsWithArgs="-case -scale -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToFireMesh foamToFireMesh - -unset -f _of_foamToGMV 2>/dev/null -_of_foamToGMV() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToGMV foamToGMV - -unset -f _of_foamToStarMesh 2>/dev/null -_of_foamToStarMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noBnd -noFunctionObjects -noZero -srcDoc -doc -help " - local optsWithArgs="-case -scale -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToStarMesh foamToStarMesh - -unset -f _of_foamToSurface 2>/dev/null -_of_foamToSurface() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -tri -srcDoc -doc -help " - local optsWithArgs="-case -scale -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToSurface foamToSurface - -unset -f _of_foamToTetDualMesh 2>/dev/null -_of_foamToTetDualMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToTetDualMesh foamToTetDualMesh - -unset -f _of_foamToVTK 2>/dev/null -_of_foamToVTK() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-allPatches -ascii -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noLagrangian -noLinks -noPointValues -noZero -parallel -poly -surfaceFields -useTimeName -xml -srcDoc -doc -help " - local optsWithArgs="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -name -pointSet -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamToVTK foamToVTK - -unset -f _of_foamUpgradeCyclics 2>/dev/null -_of_foamUpgradeCyclics() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -enableFunctionEntries -latestTime -newTimes -noFunctionObjects -noZero -parallel -test -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamUpgradeCyclics foamUpgradeCyclics - -unset -f _of_foamyHexMesh 2>/dev/null -_of_foamyHexMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-checkGeometry -conformationOnly -noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamyHexMesh foamyHexMesh - -unset -f _of_foamyQuadMesh 2>/dev/null -_of_foamyQuadMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -srcDoc -doc -help " - local optsWithArgs="-case -pointsFile " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_foamyQuadMesh foamyQuadMesh - -unset -f _of_gambitToFoam 2>/dev/null -_of_gambitToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_gambitToFoam gambitToFoam - -unset -f _of_gmshToFoam 2>/dev/null -_of_gmshToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-keepOrientation -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -region " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_gmshToFoam gmshToFoam - -unset -f _of_icoFoam 2>/dev/null -_of_icoFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_icoFoam icoFoam - -unset -f _of_icoUncoupledKinematicParcelDyMFoam 2>/dev/null -_of_icoUncoupledKinematicParcelDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloud -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_icoUncoupledKinematicParcelDyMFoam icoUncoupledKinematicParcelDyMFoam - -unset -f _of_icoUncoupledKinematicParcelFoam 2>/dev/null -_of_icoUncoupledKinematicParcelFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloud -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_icoUncoupledKinematicParcelFoam icoUncoupledKinematicParcelFoam - -unset -f _of_ideasUnvToFoam 2>/dev/null -_of_ideasUnvToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-dump -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_ideasUnvToFoam ideasUnvToFoam - -unset -f _of_insideCells 2>/dev/null -_of_insideCells() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_insideCells insideCells - -unset -f _of_interCondensatingEvaporatingFoam 2>/dev/null -_of_interCondensatingEvaporatingFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interCondensatingEvaporatingFoam interCondensatingEvaporatingFoam - -unset -f _of_interDyMFoam 2>/dev/null -_of_interDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interDyMFoam interDyMFoam - -unset -f _of_interFoam 2>/dev/null -_of_interFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interFoam interFoam - -unset -f _of_interIsoFoam 2>/dev/null -_of_interIsoFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interIsoFoam interIsoFoam - -unset -f _of_interMixingFoam 2>/dev/null -_of_interMixingFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interMixingFoam interMixingFoam - -unset -f _of_interPhaseChangeDyMFoam 2>/dev/null -_of_interPhaseChangeDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interPhaseChangeDyMFoam interPhaseChangeDyMFoam - -unset -f _of_interPhaseChangeFoam 2>/dev/null -_of_interPhaseChangeFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_interPhaseChangeFoam interPhaseChangeFoam - -unset -f _of_kivaToFoam 2>/dev/null -_of_kivaToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -file -version -zHeadMin " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_kivaToFoam kivaToFoam - -unset -f _of_laplacianFoam 2>/dev/null -_of_laplacianFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_laplacianFoam laplacianFoam - -unset -f _of_lumpedPointForces 2>/dev/null -_of_lumpedPointForces() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noZero -parallel -vtk -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_lumpedPointForces lumpedPointForces - -unset -f _of_lumpedPointMovement 2>/dev/null -_of_lumpedPointMovement() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-removeLock -slave -srcDoc -doc -help " - local optsWithArgs="-case -max -scale -span " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_lumpedPointMovement lumpedPointMovement - -unset -f _of_lumpedPointZones 2>/dev/null -_of_lumpedPointZones() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-verbose -srcDoc -doc -help " - local optsWithArgs="-case -region " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_lumpedPointZones lumpedPointZones - -unset -f _of_magneticFoam 2>/dev/null -_of_magneticFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noB -noFunctionObjects -noH -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_magneticFoam magneticFoam - -unset -f _of_mapFields 2>/dev/null -_of_mapFields() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-consistent -noFunctionObjects -parallelSource -parallelTarget -subtract -srcDoc -doc -help " - local optsWithArgs="-case -mapMethod -sourceDecomposeParDict -sourceRegion -sourceTime -targetDecomposeParDict -targetRegion " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mapFields mapFields - -unset -f _of_mapFieldsPar 2>/dev/null -_of_mapFieldsPar() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-consistent -noFunctionObjects -noLagrangian -parallel -subtract -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -fields -mapMethod -patchMapMethod -roots -sourceRegion -sourceTime -targetRegion " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mapFieldsPar mapFieldsPar - -unset -f _of_mdEquilibrationFoam 2>/dev/null -_of_mdEquilibrationFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mdEquilibrationFoam mdEquilibrationFoam - -unset -f _of_mdFoam 2>/dev/null -_of_mdFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mdFoam mdFoam - -unset -f _of_mdInitialise 2>/dev/null -_of_mdInitialise() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mdInitialise mdInitialise - -unset -f _of_mergeMeshes 2>/dev/null -_of_mergeMeshes() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-addRegion -case -decomposeParDict -masterRegion -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mergeMeshes mergeMeshes - -unset -f _of_mergeOrSplitBaffles 2>/dev/null -_of_mergeOrSplitBaffles() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-detectOnly -noFunctionObjects -overwrite -parallel -split -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mergeOrSplitBaffles mergeOrSplitBaffles - -unset -f _of_mhdFoam 2>/dev/null -_of_mhdFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mhdFoam mhdFoam - -unset -f _of_mirrorMesh 2>/dev/null -_of_mirrorMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mirrorMesh mirrorMesh - -unset -f _of_mixtureAdiabaticFlameT 2>/dev/null -_of_mixtureAdiabaticFlameT() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mixtureAdiabaticFlameT mixtureAdiabaticFlameT - -unset -f _of_modifyMesh 2>/dev/null -_of_modifyMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_modifyMesh modifyMesh - -unset -f _of_moveDynamicMesh 2>/dev/null -_of_moveDynamicMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-checkAMI -noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_moveDynamicMesh moveDynamicMesh - -unset -f _of_moveEngineMesh 2>/dev/null -_of_moveEngineMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_moveEngineMesh moveEngineMesh - -unset -f _of_moveMesh 2>/dev/null -_of_moveMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_moveMesh moveMesh - -unset -f _of_MPPICDyMFoam 2>/dev/null -_of_MPPICDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloudName -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_MPPICDyMFoam MPPICDyMFoam - -unset -f _of_MPPICFoam 2>/dev/null -_of_MPPICFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloud -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_MPPICFoam MPPICFoam - -unset -f _of_MPPICInterFoam 2>/dev/null -_of_MPPICInterFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_MPPICInterFoam MPPICInterFoam - -unset -f _of_mshToFoam 2>/dev/null -_of_mshToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-hex -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_mshToFoam mshToFoam - -unset -f _of_multiphaseEulerFoam 2>/dev/null -_of_multiphaseEulerFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_multiphaseEulerFoam multiphaseEulerFoam - -unset -f _of_multiphaseInterDyMFoam 2>/dev/null -_of_multiphaseInterDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_multiphaseInterDyMFoam multiphaseInterDyMFoam - -unset -f _of_multiphaseInterFoam 2>/dev/null -_of_multiphaseInterFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_multiphaseInterFoam multiphaseInterFoam - -unset -f _of_netgenNeutralToFoam 2>/dev/null -_of_netgenNeutralToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_netgenNeutralToFoam netgenNeutralToFoam - -unset -f _of_noise 2>/dev/null -_of_noise() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_noise noise - -unset -f _of_nonNewtonianIcoFoam 2>/dev/null -_of_nonNewtonianIcoFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_nonNewtonianIcoFoam nonNewtonianIcoFoam - -unset -f _of_objToVTK 2>/dev/null -_of_objToVTK() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_objToVTK objToVTK - -unset -f _of_orientFaceZone 2>/dev/null -_of_orientFaceZone() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_orientFaceZone orientFaceZone - -unset -f _of_overInterDyMFoam 2>/dev/null -_of_overInterDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_overInterDyMFoam overInterDyMFoam - -unset -f _of_overLaplacianDyMFoam 2>/dev/null -_of_overLaplacianDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_overLaplacianDyMFoam overLaplacianDyMFoam - -unset -f _of_overPimpleDyMFoam 2>/dev/null -_of_overPimpleDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_overPimpleDyMFoam overPimpleDyMFoam - -unset -f _of_overRhoPimpleDyMFoam 2>/dev/null -_of_overRhoPimpleDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_overRhoPimpleDyMFoam overRhoPimpleDyMFoam - -unset -f _of_overSimpleFoam 2>/dev/null -_of_overSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_overSimpleFoam overSimpleFoam - -unset -f _of_particleTracks 2>/dev/null -_of_particleTracks() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_particleTracks particleTracks - -unset -f _of_patchSummary 2>/dev/null -_of_patchSummary() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -expand -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_patchSummary patchSummary - -unset -f _of_pdfPlot 2>/dev/null -_of_pdfPlot() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_pdfPlot pdfPlot - -unset -f _of_PDRFoam 2>/dev/null -_of_PDRFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_PDRFoam PDRFoam - -unset -f _of_PDRMesh 2>/dev/null -_of_PDRMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_PDRMesh PDRMesh - -unset -f _of_pimpleDyMFoam 2>/dev/null -_of_pimpleDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_pimpleDyMFoam pimpleDyMFoam - -unset -f _of_pimpleFoam 2>/dev/null -_of_pimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_pimpleFoam pimpleFoam - -unset -f _of_pisoFoam 2>/dev/null -_of_pisoFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_pisoFoam pisoFoam - -unset -f _of_plot3dToFoam 2>/dev/null -_of_plot3dToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noBlank -noFunctionObjects -singleBlock -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_plot3dToFoam plot3dToFoam - -unset -f _of_polyDualMesh 2>/dev/null -_of_polyDualMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-concaveMultiCells -doNotPreserveFaceZones -noFunctionObjects -overwrite -splitAllFaces -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_polyDualMesh polyDualMesh - -unset -f _of_porousSimpleFoam 2>/dev/null -_of_porousSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_porousSimpleFoam porousSimpleFoam - -unset -f _of_postChannel 2>/dev/null -_of_postChannel() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help " - local optsWithArgs="-case -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_postChannel postChannel - -unset -f _of_postProcess 2>/dev/null -_of_postProcess() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -profiling -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -field -fields -func -funcs -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_postProcess postProcess - -unset -f _of_potentialFoam 2>/dev/null -_of_potentialFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-initialiseUBCs -noFunctionObjects -parallel -withFunctionObjects -writePhi -writep -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -pName -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_potentialFoam potentialFoam - -unset -f _of_potentialFreeSurfaceDyMFoam 2>/dev/null -_of_potentialFreeSurfaceDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_potentialFreeSurfaceDyMFoam potentialFreeSurfaceDyMFoam - -unset -f _of_potentialFreeSurfaceFoam 2>/dev/null -_of_potentialFreeSurfaceFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_potentialFreeSurfaceFoam potentialFreeSurfaceFoam - -unset -f _of_reactingFoam 2>/dev/null -_of_reactingFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reactingFoam reactingFoam - -unset -f _of_reactingMultiphaseEulerFoam 2>/dev/null -_of_reactingMultiphaseEulerFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reactingMultiphaseEulerFoam reactingMultiphaseEulerFoam - -unset -f _of_reactingParcelFilmFoam 2>/dev/null -_of_reactingParcelFilmFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reactingParcelFilmFoam reactingParcelFilmFoam - -unset -f _of_reactingParcelFoam 2>/dev/null -_of_reactingParcelFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reactingParcelFoam reactingParcelFoam - -unset -f _of_reactingTwoPhaseEulerFoam 2>/dev/null -_of_reactingTwoPhaseEulerFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reactingTwoPhaseEulerFoam reactingTwoPhaseEulerFoam - -unset -f _of_reconstructPar 2>/dev/null -_of_reconstructPar() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-allRegions -constant -latestTime -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -withZero -srcDoc -doc -help " - local optsWithArgs="-case -fields -lagrangianFields -region -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reconstructPar reconstructPar - -unset -f _of_reconstructParMesh 2>/dev/null -_of_reconstructParMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-cellDist -constant -fullMatch -latestTime -newTimes -noFunctionObjects -noZero -withZero -srcDoc -doc -help " - local optsWithArgs="-case -mergeTol -region -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_reconstructParMesh reconstructParMesh - -unset -f _of_redistributePar 2>/dev/null -_of_redistributePar() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-cellDist -constant -decompose -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -reconstruct -withZero -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -mergeTol -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_redistributePar redistributePar - -unset -f _of_refineHexMesh 2>/dev/null -_of_refineHexMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-minSet -noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_refineHexMesh refineHexMesh - -unset -f _of_refinementLevel 2>/dev/null -_of_refinementLevel() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -readLevel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_refinementLevel refinementLevel - -unset -f _of_refineMesh 2>/dev/null -_of_refineMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-all -noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_refineMesh refineMesh - -unset -f _of_refineWallLayer 2>/dev/null -_of_refineWallLayer() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots -useSet " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_refineWallLayer refineWallLayer - -unset -f _of_removeFaces 2>/dev/null -_of_removeFaces() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_removeFaces removeFaces - -unset -f _of_renumberMesh 2>/dev/null -_of_renumberMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -frontWidth -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_renumberMesh renumberMesh - -unset -f _of_rhoCentralDyMFoam 2>/dev/null -_of_rhoCentralDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoCentralDyMFoam rhoCentralDyMFoam - -unset -f _of_rhoCentralFoam 2>/dev/null -_of_rhoCentralFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoCentralFoam rhoCentralFoam - -unset -f _of_rhoPimpleDyMFoam 2>/dev/null -_of_rhoPimpleDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoPimpleDyMFoam rhoPimpleDyMFoam - -unset -f _of_rhoPimpleFoam 2>/dev/null -_of_rhoPimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoPimpleFoam rhoPimpleFoam - -unset -f _of_rhoPorousSimpleFoam 2>/dev/null -_of_rhoPorousSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoPorousSimpleFoam rhoPorousSimpleFoam - -unset -f _of_rhoReactingBuoyantFoam 2>/dev/null -_of_rhoReactingBuoyantFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoReactingBuoyantFoam rhoReactingBuoyantFoam - -unset -f _of_rhoReactingFoam 2>/dev/null -_of_rhoReactingFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoReactingFoam rhoReactingFoam - -unset -f _of_rhoSimpleFoam 2>/dev/null -_of_rhoSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rhoSimpleFoam rhoSimpleFoam - -unset -f _of_rotateMesh 2>/dev/null -_of_rotateMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_rotateMesh rotateMesh - -unset -f _of_scalarTransportFoam 2>/dev/null -_of_scalarTransportFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_scalarTransportFoam scalarTransportFoam - -unset -f _of_selectCells 2>/dev/null -_of_selectCells() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_selectCells selectCells - -unset -f _of_setAlphaField 2>/dev/null -_of_setAlphaField() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_setAlphaField setAlphaField - -unset -f _of_setFields 2>/dev/null -_of_setFields() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_setFields setFields - -unset -f _of_setSet 2>/dev/null -_of_setSet() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -loop -newTimes -noFunctionObjects -noSync -noVTK -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-batch -case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_setSet setSet - -unset -f _of_setsToZones 2>/dev/null -_of_setsToZones() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFlipMap -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_setsToZones setsToZones - -unset -f _of_shallowWaterFoam 2>/dev/null -_of_shallowWaterFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_shallowWaterFoam shallowWaterFoam - -unset -f _of_simpleCoalParcelFoam 2>/dev/null -_of_simpleCoalParcelFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_simpleCoalParcelFoam simpleCoalParcelFoam - -unset -f _of_simpleFoam 2>/dev/null -_of_simpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_simpleFoam simpleFoam - -unset -f _of_simpleReactingParcelFoam 2>/dev/null -_of_simpleReactingParcelFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_simpleReactingParcelFoam simpleReactingParcelFoam - -unset -f _of_singleCellMesh 2>/dev/null -_of_singleCellMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_singleCellMesh singleCellMesh - -unset -f _of_smapToFoam 2>/dev/null -_of_smapToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_smapToFoam smapToFoam - -unset -f _of_snappyHexMesh 2>/dev/null -_of_snappyHexMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-checkGeometry -noFunctionObjects -overwrite -parallel -profiling -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -outFile -patches -region -roots -surfaceSimplify " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_snappyHexMesh snappyHexMesh - -unset -f _of_snappyRefineMesh 2>/dev/null -_of_snappyRefineMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_snappyRefineMesh snappyRefineMesh - -unset -f _of_solidDisplacementFoam 2>/dev/null -_of_solidDisplacementFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_solidDisplacementFoam solidDisplacementFoam - -unset -f _of_solidEquilibriumDisplacementFoam 2>/dev/null -_of_solidEquilibriumDisplacementFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_solidEquilibriumDisplacementFoam solidEquilibriumDisplacementFoam - -unset -f _of_sonicDyMFoam 2>/dev/null -_of_sonicDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_sonicDyMFoam sonicDyMFoam - -unset -f _of_sonicFoam 2>/dev/null -_of_sonicFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_sonicFoam sonicFoam - -unset -f _of_sonicLiquidFoam 2>/dev/null -_of_sonicLiquidFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_sonicLiquidFoam sonicLiquidFoam - -unset -f _of_splitCells 2>/dev/null -_of_splitCells() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-geometry -noFunctionObjects -overwrite -srcDoc -doc -help " - local optsWithArgs="-case -set -tol " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_splitCells splitCells - -unset -f _of_splitMesh 2>/dev/null -_of_splitMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_splitMesh splitMesh - -unset -f _of_splitMeshRegions 2>/dev/null -_of_splitMeshRegions() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-cellZones -cellZonesOnly -detectOnly -largestOnly -makeCellZones -noFunctionObjects -overwrite -parallel -prefixRegion -sloppyCellZones -useFaceZones -srcDoc -doc -help " - local optsWithArgs="-blockedFaces -case -cellZonesFileOnly -decomposeParDict -insidePoint -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_splitMeshRegions splitMeshRegions - -unset -f _of_sprayDyMFoam 2>/dev/null -_of_sprayDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_sprayDyMFoam sprayDyMFoam - -unset -f _of_sprayEngineFoam 2>/dev/null -_of_sprayEngineFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_sprayEngineFoam sprayEngineFoam - -unset -f _of_sprayFoam 2>/dev/null -_of_sprayFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_sprayFoam sprayFoam - -unset -f _of_SRFPimpleFoam 2>/dev/null -_of_SRFPimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_SRFPimpleFoam SRFPimpleFoam - -unset -f _of_SRFSimpleFoam 2>/dev/null -_of_SRFSimpleFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_SRFSimpleFoam SRFSimpleFoam - -unset -f _of_star4ToFoam 2>/dev/null -_of_star4ToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-ascii -noFunctionObjects -solids -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_star4ToFoam star4ToFoam - -unset -f _of_steadyParticleTracks 2>/dev/null -_of_steadyParticleTracks() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help " - local optsWithArgs="-case -dict -region -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_steadyParticleTracks steadyParticleTracks - -unset -f _of_stitchMesh 2>/dev/null -_of_stitchMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -partial -perfect -srcDoc -doc -help " - local optsWithArgs="-case -region -toleranceDict " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_stitchMesh stitchMesh - -unset -f _of_subsetMesh 2>/dev/null -_of_subsetMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -patch -patches -region -resultTime -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_subsetMesh subsetMesh - -unset -f _of_surfaceAdd 2>/dev/null -_of_surfaceAdd() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-mergeRegions -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -points " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceAdd surfaceAdd - -unset -f _of_surfaceBooleanFeatures 2>/dev/null -_of_surfaceBooleanFeatures() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-invertedSpace -noFunctionObjects -perturb -surf1Baffle -surf2Baffle -srcDoc -doc -help " - local optsWithArgs="-case -trim " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceBooleanFeatures surfaceBooleanFeatures - -unset -f _of_surfaceCheck 2>/dev/null -_of_surfaceCheck() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-blockMesh -checkSelfIntersection -noFunctionObjects -splitNonManifold -verbose -srcDoc -doc -help " - local optsWithArgs="-case -outputThreshold " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceCheck surfaceCheck - -unset -f _of_surfaceClean 2>/dev/null -_of_surfaceClean() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noClean -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceClean surfaceClean - -unset -f _of_surfaceCoarsen 2>/dev/null -_of_surfaceCoarsen() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceCoarsen surfaceCoarsen - -unset -f _of_surfaceConvert 2>/dev/null -_of_surfaceConvert() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-clean -group -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -scale -writePrecision " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceConvert surfaceConvert - -unset -f _of_surfaceFeatureConvert 2>/dev/null -_of_surfaceFeatureConvert() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceFeatureConvert surfaceFeatureConvert - -unset -f _of_surfaceFeatureExtract 2>/dev/null -_of_surfaceFeatureExtract() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs="-case -dict " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceFeatureExtract surfaceFeatureExtract - -unset -f _of_surfaceFind 2>/dev/null -_of_surfaceFind() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -x -y -z " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceFind surfaceFind - -unset -f _of_surfaceHookUp 2>/dev/null -_of_surfaceHookUp() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -dict " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceHookUp surfaceHookUp - -unset -f _of_surfaceInertia 2>/dev/null -_of_surfaceInertia() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -shellProperties -srcDoc -doc -help " - local optsWithArgs="-case -density -referencePoint " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceInertia surfaceInertia - -unset -f _of_surfaceInflate 2>/dev/null -_of_surfaceInflate() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-checkSelfIntersection -debug -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -featureAngle -nSmooth " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceInflate surfaceInflate - -unset -f _of_surfaceLambdaMuSmooth 2>/dev/null -_of_surfaceLambdaMuSmooth() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs="-featureFile " - - case ${prev} in - - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceLambdaMuSmooth surfaceLambdaMuSmooth - -unset -f _of_surfaceMeshConvert 2>/dev/null -_of_surfaceMeshConvert() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-clean -noFunctionObjects -tri -srcDoc -doc -help " - local optsWithArgs="-case -dict -from -scaleIn -scaleOut -to " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceMeshConvert surfaceMeshConvert - -unset -f _of_surfaceMeshConvertTesting 2>/dev/null -_of_surfaceMeshConvertTesting() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-clean -noFunctionObjects -orient -stdout -surfMesh -testModify -triFace -triSurface -unsorted -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceMeshConvertTesting surfaceMeshConvertTesting - -unset -f _of_surfaceMeshExport 2>/dev/null -_of_surfaceMeshExport() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-clean -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -dict -from -name -scaleIn -scaleOut -to " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceMeshExport surfaceMeshExport - -unset -f _of_surfaceMeshImport 2>/dev/null -_of_surfaceMeshImport() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-clean -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -dict -from -name -scaleIn -scaleOut -to " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceMeshImport surfaceMeshImport - -unset -f _of_surfaceMeshInfo 2>/dev/null -_of_surfaceMeshInfo() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-areas -noFunctionObjects -xml -srcDoc -doc -help " - local optsWithArgs="-case -scale " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceMeshInfo surfaceMeshInfo - -unset -f _of_surfaceMeshTriangulate 2>/dev/null -_of_surfaceMeshTriangulate() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -excludeProcPatches -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -faceZones -patches -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceMeshTriangulate surfaceMeshTriangulate - -unset -f _of_surfaceOrient 2>/dev/null -_of_surfaceOrient() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-inside -noFunctionObjects -usePierceTest -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceOrient surfaceOrient - -unset -f _of_surfacePatch 2>/dev/null -_of_surfacePatch() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -dict " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfacePatch surfacePatch - -unset -f _of_surfacePointMerge 2>/dev/null -_of_surfacePointMerge() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfacePointMerge surfacePointMerge - -unset -f _of_surfaceRedistributePar 2>/dev/null -_of_surfaceRedistributePar() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-keepNonMapped -noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceRedistributePar surfaceRedistributePar - -unset -f _of_surfaceRefineRedGreen 2>/dev/null -_of_surfaceRefineRedGreen() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceRefineRedGreen surfaceRefineRedGreen - -unset -f _of_surfaceSplitByPatch 2>/dev/null -_of_surfaceSplitByPatch() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceSplitByPatch surfaceSplitByPatch - -unset -f _of_surfaceSplitByTopology 2>/dev/null -_of_surfaceSplitByTopology() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-srcDoc -doc -help " - local optsWithArgs=" " - - case ${prev} in - - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceSplitByTopology surfaceSplitByTopology - -unset -f _of_surfaceSplitNonManifolds 2>/dev/null -_of_surfaceSplitNonManifolds() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-debug -noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceSplitNonManifolds surfaceSplitNonManifolds - -unset -f _of_surfaceSubset 2>/dev/null -_of_surfaceSubset() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceSubset surfaceSubset - -unset -f _of_surfaceToPatch 2>/dev/null -_of_surfaceToPatch() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -faceSet -tol " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceToPatch surfaceToPatch - -unset -f _of_surfaceTransformPoints 2>/dev/null -_of_surfaceTransformPoints() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case -rollPitchYaw -rotate -scale -translate -yawPitchRoll " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_surfaceTransformPoints surfaceTransformPoints - -unset -f _of_temporalInterpolate 2>/dev/null -_of_temporalInterpolate() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -divisions -fields -interpolationType -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_temporalInterpolate temporalInterpolate - -unset -f _of_tetgenToFoam 2>/dev/null -_of_tetgenToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFaceFile -noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_tetgenToFoam tetgenToFoam - -unset -f _of_thermoFoam 2>/dev/null -_of_thermoFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_thermoFoam thermoFoam - -unset -f _of_topoSet 2>/dev/null -_of_topoSet() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noSync -noZero -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -dict -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_topoSet topoSet - -unset -f _of_transformPoints 2>/dev/null -_of_transformPoints() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -rotateFields -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -rollPitchYaw -roots -rotate -scale -translate -yawPitchRoll " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_transformPoints transformPoints - -unset -f _of_twoLiquidMixingFoam 2>/dev/null -_of_twoLiquidMixingFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_twoLiquidMixingFoam twoLiquidMixingFoam - -unset -f _of_twoPhaseEulerFoam 2>/dev/null -_of_twoPhaseEulerFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_twoPhaseEulerFoam twoPhaseEulerFoam - -unset -f _of_uncoupledKinematicParcelFoam 2>/dev/null -_of_uncoupledKinematicParcelFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -cloud -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_uncoupledKinematicParcelFoam uncoupledKinematicParcelFoam - -unset -f _of_viewFactorsGen 2>/dev/null -_of_viewFactorsGen() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_viewFactorsGen viewFactorsGen - -unset -f _of_vtkUnstructuredToFoam 2>/dev/null -_of_vtkUnstructuredToFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -srcDoc -doc -help " - local optsWithArgs="-case " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_vtkUnstructuredToFoam vtkUnstructuredToFoam - -unset -f _of_wallFunctionTable 2>/dev/null -_of_wallFunctionTable() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_wallFunctionTable wallFunctionTable - -unset -f _of_writeMeshObj 2>/dev/null -_of_writeMeshObj() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -patchEdges -patchFaces -srcDoc -doc -help " - local optsWithArgs="-case -cell -cellSet -decomposeParDict -face -faceSet -point -region -roots -time " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - -time) - COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_writeMeshObj writeMeshObj - -unset -f _of_XiDyMFoam 2>/dev/null -_of_XiDyMFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_XiDyMFoam XiDyMFoam - -unset -f _of_XiFoam 2>/dev/null -_of_XiFoam() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_XiFoam XiFoam - -unset -f _of_zipUpMesh 2>/dev/null -_of_zipUpMesh() -{ - local cur="${COMP_WORDS[COMP_CWORD]}" - local prev="${COMP_WORDS[COMP_CWORD-1]}" - - local opts="-noFunctionObjects -parallel -srcDoc -doc -help " - local optsWithArgs="-case -decomposeParDict -region -roots " - - case ${prev} in - -case) - COMPREPLY=($(compgen -d -- ${cur})) - ;; - *Dict) - COMPREPLY=($(compgen -f -- ${cur})) - ;; - -region) - local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null)))) - COMPREPLY=($(compgen -W "$regions" -- ${cur})) - ;; - *) - if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ] - then - # Unknown type of arg follows - set to files. - # Not always correct but can still navigate path if needed... - COMPREPLY=($(compgen -f -- ${cur})) - else - # Catch-all - present all remaining options - opts=$(_of_filter_opts "${opts}" "${COMP_LINE}") - optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}") - COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur})) - fi - ;; - esac - - return 0 -} -complete -o nospace -F _of_zipUpMesh zipUpMesh - - -#------------------------------------------------------------------------------ diff --git a/etc/config.sh/completion_cache b/etc/config.sh/completion_cache new file mode 100644 index 0000000000..942dbe4e46 --- /dev/null +++ b/etc/config.sh/completion_cache @@ -0,0 +1,259 @@ +#----------------------------------*-sh-*-------------------------------------- +# Cached options for bash completion of OpenFOAM applications. +# These are the values expected by the '_of_complete_' function +# +# Recreate with "foamCreateCompletionCache" + +# Global associative array (cached options for OpenFOAM applications) +declare -gA _of_complete_cache_; + +# Clear existing cache. +_of_complete_cache_=() + +#------------------------------------------------------------------------------ +_of_complete_cache_[adiabaticFlameT]="-case | -srcDoc -doc -help" +_of_complete_cache_[adjointShapeOptimizationFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[ansysToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[applyBoundaryLayer]="-case -decomposeParDict -region -roots -ybl | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[attachMesh]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help" +_of_complete_cache_[autoPatch]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help" +_of_complete_cache_[blockMesh]="-case -dict -region | -blockTopology -noClean -noFunctionObjects -sets -srcDoc -doc -help" +_of_complete_cache_[boundaryFoam]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[boxTurb]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[buoyantBoussinesqPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[buoyantBoussinesqSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[buoyantPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[buoyantSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[cavitatingDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[cavitatingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[cfx4ToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[changeDictionary]="-case -decomposeParDict -dict -instance -region -roots -subDict -time | -constant -disablePatchGroups -enableFunctionEntries -latestTime -literalRE -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[checkMesh]="-case -decomposeParDict -region -roots -time -writeFields -writeSets | -allGeometry -allTopology -constant -latestTime -meshQuality -newTimes -noFunctionObjects -noTopology -noZero -parallel -writeAllFields -srcDoc -doc -help" +_of_complete_cache_[chemFoam]="-case | -noFunctionObjects -postProcess -srcDoc -doc -help" +_of_complete_cache_[chemkinToFoam]="-case | -newFormat -srcDoc -doc -help" +_of_complete_cache_[chtMultiRegionFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[chtMultiRegionSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[coalChemistryFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[coldEngineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[collapseEdges]="-case -collapseFaceSet -decomposeParDict -dict -roots -time | -collapseFaces -constant -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[combinePatchFaces]="-case -concaveAngle -decomposeParDict -roots | -meshQuality -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[compressibleInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[compressibleInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[compressibleMultiphaseInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[createBaffles]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[createExternalCoupledPatchGeometry]="-case -commsDir -decomposeParDict -region -regions -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[createPatch]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -writeObj -srcDoc -doc -help" +_of_complete_cache_[createZeroDirectory]="-case -decomposeParDict -roots -templateDir | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[datToFoam]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[decomposePar]="-case -decomposeParDict -region -time | -allRegions -cellDist -constant -copyUniform -copyZero -fields -force -ifRequired -latestTime -newTimes -noFunctionObjects -noSets -noZero -srcDoc -doc -help" +_of_complete_cache_[deformedGeom]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[dnsFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[DPMDyMFoam]="-case -cloudName -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[DPMFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[driftFluxFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[dsmcFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[dsmcInitialise]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[electrostaticFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[engineCompRatio]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[engineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[engineSwirl]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[equilibriumCO]="-case | -srcDoc -doc -help" +_of_complete_cache_[equilibriumFlameT]="-case | -srcDoc -doc -help" +_of_complete_cache_[extrude2DMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[extrudeMesh]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[extrudeToRegionMesh]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[faceAgglomerate]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[financialFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[fireFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[fireToFoam]="-case -scale | -ascii -check -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[flattenMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[fluent3DMeshToFoam]="-case -ignoreCellGroups -ignoreFaceGroups -scale | -cubit -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[fluentMeshToFoam]="-case -scale | -noFunctionObjects -writeSets -writeZones -srcDoc -doc -help" +_of_complete_cache_[foamDataToFluent]="-case -time | -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help" +_of_complete_cache_[foamDictionary]="-add -case -decomposeParDict -diff -entry -roots -set | -disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -srcDoc -doc -help" +_of_complete_cache_[foamFormatConvert]="-case -decomposeParDict -region -roots -time | -constant -enableFunctionEntries -latestTime -newTimes -noConstant -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[foamHelp]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[foamList]="-case -scalarBCs -vectorBCs | -compressibleTurbulenceModels -functionObjects -fvOptions -incompressibleTurbulenceModels -noFunctionObjects -registeredSwitches -switches -unset -srcDoc -doc -help" +_of_complete_cache_[foamListTimes]="-case -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -processor -rm -withZero -srcDoc -doc -help" +_of_complete_cache_[foamMeshToFluent]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[foamToEnsight]="-case -cellZone -decomposeParDict -faceZones -fields -name -patches -region -roots -time -width | -ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -srcDoc -doc -help" +_of_complete_cache_[foamToEnsightParts]="-case -index -name -time -width | -ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noMesh -noZero -srcDoc -doc -help" +_of_complete_cache_[foamToFireMesh]="-case -scale -time | -ascii -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help" +_of_complete_cache_[foamToGMV]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[foamToStarMesh]="-case -scale -time | -constant -latestTime -newTimes -noBnd -noFunctionObjects -noZero -srcDoc -doc -help" +_of_complete_cache_[foamToSurface]="-case -scale -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -tri -srcDoc -doc -help" +_of_complete_cache_[foamToTecplot360]="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -region -roots -time | -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noPointValues -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[foamToTetDualMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[foamToVTK]="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -name -pointSet -region -roots -time | -allPatches -ascii -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noLagrangian -noLinks -noPointValues -noZero -parallel -poly -surfaceFields -useTimeName -xml -srcDoc -doc -help" +_of_complete_cache_[foamUpgradeCyclics]="-case -decomposeParDict -region -roots -time | -constant -enableFunctionEntries -latestTime -newTimes -noFunctionObjects -noZero -parallel -test -srcDoc -doc -help" +_of_complete_cache_[foamyHexMesh]="-case -decomposeParDict -roots | -checkGeometry -conformationOnly -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[foamyQuadMesh]="-case -pointsFile | -noFunctionObjects -overwrite -srcDoc -doc -help" +_of_complete_cache_[gambitToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[gmshToFoam]="-case -region | -keepOrientation -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[icoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[icoUncoupledKinematicParcelDyMFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[icoUncoupledKinematicParcelFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[ideasUnvToFoam]="-case | -dump -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[insideCells]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[interCondensatingEvaporatingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[interDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[interFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[interIsoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[interMixingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[interPhaseChangeDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[interPhaseChangeFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[kivaToFoam]="-case -file -version -zHeadMin | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[laplacianFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[lumpedPointForces]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noZero -parallel -vtk -srcDoc -doc -help" +_of_complete_cache_[lumpedPointMovement]="-case -max -scale -span | -removeLock -slave -srcDoc -doc -help" +_of_complete_cache_[lumpedPointZones]="-case -region | -verbose -srcDoc -doc -help" +_of_complete_cache_[magneticFoam]="-case -decomposeParDict -roots | -noB -noFunctionObjects -noH -parallel -srcDoc -doc -help" +_of_complete_cache_[mapFields]="-case -mapMethod -sourceDecomposeParDict -sourceRegion -sourceTime -targetDecomposeParDict -targetRegion | -consistent -noFunctionObjects -parallelSource -parallelTarget -subtract -srcDoc -doc -help" +_of_complete_cache_[mapFieldsPar]="-case -decomposeParDict -fields -mapMethod -patchMapMethod -roots -sourceRegion -sourceTime -targetRegion | -consistent -noFunctionObjects -noLagrangian -parallel -subtract -srcDoc -doc -help" +_of_complete_cache_[mdEquilibrationFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[mdFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[mdInitialise]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[mergeMeshes]="-addRegion -case -decomposeParDict -masterRegion -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[mergeOrSplitBaffles]="-case -decomposeParDict -dict -region -roots | -detectOnly -noFunctionObjects -overwrite -parallel -split -srcDoc -doc -help" +_of_complete_cache_[mhdFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[mirrorMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[mixtureAdiabaticFlameT]="-case | -srcDoc -doc -help" +_of_complete_cache_[modifyMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[moveDynamicMesh]="-case -decomposeParDict -region -roots | -checkAMI -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[moveEngineMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[moveMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[MPPICDyMFoam]="-case -cloudName -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[MPPICFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[MPPICInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[mshToFoam]="-case | -hex -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[multiphaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[multiphaseInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[multiphaseInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[netgenNeutralToFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[noise]="-case -decomposeParDict -dict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[nonNewtonianIcoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[objToVTK]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[orientFaceZone]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[overInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[overLaplacianDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[overPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[overRhoPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[overSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[particleTracks]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[patchSummary]="-case -decomposeParDict -region -roots -time | -constant -expand -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[pdfPlot]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[PDRFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[PDRMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[pimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[pimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[pisoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[plot3dToFoam]="-case -scale | -noBlank -noFunctionObjects -singleBlock -srcDoc -doc -help" +_of_complete_cache_[polyDualMesh]="-case | -concaveMultiCells -doNotPreserveFaceZones -noFunctionObjects -overwrite -splitAllFaces -srcDoc -doc -help" +_of_complete_cache_[porousSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[postChannel]="-case -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help" +_of_complete_cache_[postProcess]="-case -decomposeParDict -dict -field -fields -func -funcs -region -roots -time | -constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -profiling -srcDoc -doc -help" +_of_complete_cache_[potentialFoam]="-case -decomposeParDict -pName -roots | -initialiseUBCs -noFunctionObjects -parallel -withFunctionObjects -writePhi -writep -srcDoc -doc -help" +_of_complete_cache_[potentialFreeSurfaceDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[potentialFreeSurfaceFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[reactingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[reactingMultiphaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[reactingParcelFilmFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[reactingParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[reactingTwoPhaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[reconstructPar]="-case -fields -lagrangianFields -region -time | -allRegions -constant -latestTime -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -withZero -srcDoc -doc -help" +_of_complete_cache_[reconstructParMesh]="-case -mergeTol -region -time | -cellDist -constant -fullMatch -latestTime -newTimes -noFunctionObjects -noZero -withZero -srcDoc -doc -help" +_of_complete_cache_[redistributePar]="-case -decomposeParDict -mergeTol -region -roots -time | -cellDist -constant -decompose -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -reconstruct -withZero -srcDoc -doc -help" +_of_complete_cache_[refineHexMesh]="-case -decomposeParDict -region -roots | -minSet -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[refinementLevel]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -readLevel -srcDoc -doc -help" +_of_complete_cache_[refineMesh]="-case -decomposeParDict -dict -region -roots | -all -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[refineWallLayer]="-case -decomposeParDict -roots -useSet | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[removeFaces]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[renumberMesh]="-case -decomposeParDict -dict -region -roots -time | -constant -frontWidth -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[rhoCentralDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoCentralFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoPimpleAdiabaticFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoPorousSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoReactingBuoyantFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoReactingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rhoSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[rotateMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[scalarTransportFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[selectCells]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[setAlphaField]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[setFields]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[setSet]="-batch -case -decomposeParDict -region -roots -time | -constant -latestTime -loop -newTimes -noFunctionObjects -noSync -noVTK -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[setsToZones]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noFlipMap -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[shallowWaterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[simpleCoalParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[simpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[simpleReactingParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[singleCellMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[smapToFoam]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[snappyHexMesh]="-case -decomposeParDict -dict -outFile -patches -region -roots -surfaceSimplify | -checkGeometry -noFunctionObjects -overwrite -parallel -profiling -srcDoc -doc -help" +_of_complete_cache_[snappyRefineMesh]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[solidDisplacementFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[solidEquilibriumDisplacementFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[sonicDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[sonicFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[sonicLiquidFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[splitCells]="-case -set -tol | -geometry -noFunctionObjects -overwrite -srcDoc -doc -help" +_of_complete_cache_[splitMesh]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help" +_of_complete_cache_[splitMeshRegions]="-blockedFaces -case -cellZonesFileOnly -decomposeParDict -insidePoint -region -roots | -cellZones -cellZonesOnly -detectOnly -largestOnly -makeCellZones -noFunctionObjects -overwrite -parallel -prefixRegion -sloppyCellZones -useFaceZones -srcDoc -doc -help" +_of_complete_cache_[sprayDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[sprayEngineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[sprayFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[SRFPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[SRFSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[star4ToFoam]="-case -scale | -ascii -noFunctionObjects -solids -srcDoc -doc -help" +_of_complete_cache_[steadyParticleTracks]="-case -dict -region -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help" +_of_complete_cache_[stitchMesh]="-case -region -toleranceDict | -noFunctionObjects -overwrite -partial -perfect -srcDoc -doc -help" +_of_complete_cache_[subsetMesh]="-case -decomposeParDict -patch -patches -region -resultTime -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help" +_of_complete_cache_[surfaceAdd]="-case -points | -mergeRegions -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceBooleanFeatures]="-case -trim | -invertedSpace -noFunctionObjects -perturb -surf1Baffle -surf2Baffle -srcDoc -doc -help" +_of_complete_cache_[surfaceCheck]="-case -outputThreshold | -blockMesh -checkSelfIntersection -noFunctionObjects -splitNonManifold -verbose -srcDoc -doc -help" +_of_complete_cache_[surfaceClean]="-case | -noClean -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceCoarsen]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceConvert]="-case -scale -writePrecision | -clean -group -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceFeatureConvert]="-case -scale | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceFeatureExtract]="-case -dict | -srcDoc -doc -help" +_of_complete_cache_[surfaceFind]="-case -x -y -z | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceHookUp]="-case -dict | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceInertia]="-case -density -referencePoint | -noFunctionObjects -shellProperties -srcDoc -doc -help" +_of_complete_cache_[surfaceInflate]="-case -featureAngle -nSmooth | -checkSelfIntersection -debug -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceLambdaMuSmooth]="-featureFile | -srcDoc -doc -help" +_of_complete_cache_[surfaceMeshConvert]="-case -dict -from -scaleIn -scaleOut -to | -clean -noFunctionObjects -tri -srcDoc -doc -help" +_of_complete_cache_[surfaceMeshConvertTesting]="-case -scale | -clean -noFunctionObjects -orient -stdout -surfMesh -testModify -triFace -triSurface -unsorted -srcDoc -doc -help" +_of_complete_cache_[surfaceMeshExport]="-case -dict -from -name -scaleIn -scaleOut -to | -clean -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceMeshImport]="-case -dict -from -name -scaleIn -scaleOut -to | -clean -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceMeshInfo]="-case -scale | -areas -noFunctionObjects -xml -srcDoc -doc -help" +_of_complete_cache_[surfaceMeshTriangulate]="-case -decomposeParDict -faceZones -patches -region -roots -time | -constant -excludeProcPatches -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[surfaceOrient]="-case | -inside -noFunctionObjects -usePierceTest -srcDoc -doc -help" +_of_complete_cache_[surfacePatch]="-case -dict | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfacePointMerge]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceRedistributePar]="-case -decomposeParDict -roots | -keepNonMapped -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[surfaceRefineRedGreen]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceSplitByPatch]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceSplitByTopology]=" | -srcDoc -doc -help" +_of_complete_cache_[surfaceSplitNonManifolds]="-case | -debug -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceSubset]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceToPatch]="-case -faceSet -tol | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[surfaceTransformPoints]="-case -rollPitchYaw -rotate -scale -translate -yawPitchRoll | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[temporalInterpolate]="-case -decomposeParDict -divisions -fields -interpolationType -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[tetgenToFoam]="-case -decomposeParDict -roots | -noFaceFile -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[thermoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[topoSet]="-case -decomposeParDict -dict -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noSync -noZero -parallel -srcDoc -doc -help" +_of_complete_cache_[transformPoints]="-case -decomposeParDict -region -rollPitchYaw -roots -rotate -scale -translate -yawPitchRoll | -noFunctionObjects -parallel -rotateFields -srcDoc -doc -help" +_of_complete_cache_[twoLiquidMixingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[twoPhaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[uncoupledKinematicParcelFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[viewFactorsGen]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[vtkUnstructuredToFoam]="-case | -noFunctionObjects -srcDoc -doc -help" +_of_complete_cache_[wallFunctionTable]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help" +_of_complete_cache_[writeMeshObj]="-case -cell -cellSet -decomposeParDict -face -faceSet -point -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -patchEdges -patchFaces -srcDoc -doc -help" +_of_complete_cache_[XiDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[XiFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help" +_of_complete_cache_[zipUpMesh]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help" + +#------------------------------------------------------------------------------ diff --git a/etc/config.sh/unset b/etc/config.sh/unset index 95afc82534..fe8b8f18e1 100644 --- a/etc/config.sh/unset +++ b/etc/config.sh/unset @@ -181,16 +181,21 @@ unset -f wmRefresh 2>/dev/null unset -f foamVersion 2>/dev/null unset -f foamPV 2>/dev/null -# Cleanup bash completions, which look like this: -# "complete ... -F _of_APPNAME APPNAME -# For economy, obtain list first but also add in 'filter_opts' helper -foamClean="$(complete 2>/dev/null | sed -n -e 's/complete.*-F _of_.* \(..*\)$/\1/p')" -for cleaned in $foamClean filter_opts +# Remove old completions, which look like +# "complete ... -F _of_complete_ APPNAME +# For economy, obtain list first +foamOldDirs="$(complete 2>/dev/null | sed -ne 's/^.*-F _of_.* \(..*\)$/\1/p')" +for cleaned in $foamOldDirs do - unset -f _of_$cleaned 2>/dev/null - complete -r $cleaned 2>/dev/null + complete -r $cleaned 2>/dev/null done +# Completion functions +unset -f foamAddCompletion 2>/dev/null +unset -f _of_complete_ 2>/dev/null + +# Completion cache +unset _of_complete_cache_ #------------------------------------------------------------------------------ # Intermediate variables (do as last for a clean exit code) diff --git a/etc/cshrc b/etc/cshrc index 6c42ebdf61..7b8da52c26 100644 --- a/etc/cshrc +++ b/etc/cshrc @@ -219,6 +219,7 @@ _foamEtc config.csh/settings if ($?prompt) then # Interactive shell _foamEtc config.csh/aliases + _foamEtc config.csh/tcsh_completion endif diff --git a/etc/templates/axisymmetricJet/system/blockMeshDict b/etc/templates/axisymmetricJet/system/blockMeshDict index 1fcb03846a..3bbfc45ed6 100644 --- a/etc/templates/axisymmetricJet/system/blockMeshDict +++ b/etc/templates/axisymmetricJet/system/blockMeshDict @@ -24,7 +24,7 @@ backgroundMesh rBcells 50; } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/closedVolume/system/blockMeshDict b/etc/templates/closedVolume/system/blockMeshDict index 273d50fad2..db3fd8ee72 100644 --- a/etc/templates/closedVolume/system/blockMeshDict +++ b/etc/templates/closedVolume/system/blockMeshDict @@ -27,7 +27,7 @@ backgroundMesh zCells 20; } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/closedVolumeRotating/system/blockMeshDict b/etc/templates/closedVolumeRotating/system/blockMeshDict index b7f0c57061..71e33484d3 100644 --- a/etc/templates/closedVolumeRotating/system/blockMeshDict +++ b/etc/templates/closedVolumeRotating/system/blockMeshDict @@ -58,7 +58,7 @@ geometry } } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/closedVolumeRotating/system/blockMeshDict-box b/etc/templates/closedVolumeRotating/system/blockMeshDict-box index 273d50fad2..db3fd8ee72 100644 --- a/etc/templates/closedVolumeRotating/system/blockMeshDict-box +++ b/etc/templates/closedVolumeRotating/system/blockMeshDict-box @@ -27,7 +27,7 @@ backgroundMesh zCells 20; } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/compressibleInflowOutflow/system/blockMeshDict b/etc/templates/compressibleInflowOutflow/system/blockMeshDict index a761d4fecb..a362f0657c 100644 --- a/etc/templates/compressibleInflowOutflow/system/blockMeshDict +++ b/etc/templates/compressibleInflowOutflow/system/blockMeshDict @@ -27,7 +27,7 @@ backgroundMesh zCells 20; } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/inflowOutflow/system/blockMeshDict b/etc/templates/inflowOutflow/system/blockMeshDict index a761d4fecb..a362f0657c 100644 --- a/etc/templates/inflowOutflow/system/blockMeshDict +++ b/etc/templates/inflowOutflow/system/blockMeshDict @@ -27,7 +27,7 @@ backgroundMesh zCells 20; } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/inflowOutflowRotating/system/blockMeshDict b/etc/templates/inflowOutflowRotating/system/blockMeshDict index 6de435522b..155d6eb364 100644 --- a/etc/templates/inflowOutflowRotating/system/blockMeshDict +++ b/etc/templates/inflowOutflowRotating/system/blockMeshDict @@ -58,7 +58,7 @@ geometry } } -convertToMeters 1; +scale 1; vertices ( diff --git a/etc/templates/inflowOutflowRotating/system/blockMeshDict-box b/etc/templates/inflowOutflowRotating/system/blockMeshDict-box index a761d4fecb..a362f0657c 100644 --- a/etc/templates/inflowOutflowRotating/system/blockMeshDict-box +++ b/etc/templates/inflowOutflowRotating/system/blockMeshDict-box @@ -27,7 +27,7 @@ backgroundMesh zCells 20; } -convertToMeters 1; +scale 1; vertices ( diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C index d9b2e0b3a4..3a922ed016 100644 --- a/src/OSspecific/POSIX/POSIX.C +++ b/src/OSspecific/POSIX/POSIX.C @@ -88,7 +88,7 @@ static inline bool isBackupName(const Foam::fileName& name) { return false; } - else if (name[name.size()-1] == '~') + else if (name.back() == '~') { return true; } diff --git a/src/OSspecific/POSIX/printStack.C b/src/OSspecific/POSIX/printStack.C index bee02686b3..4031b91d77 100644 --- a/src/OSspecific/POSIX/printStack.C +++ b/src/OSspecific/POSIX/printStack.C @@ -40,12 +40,11 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -string pOpen(const string &cmd, label line=0) +string pOpen(const string& cmd, label line=0) { - string res = "\n"; + string res; FILE *cmdPipe = popen(cmd.c_str(), "r"); - if (cmdPipe) { char *buf = nullptr; @@ -54,8 +53,7 @@ string pOpen(const string &cmd, label line=0) for (label cnt = 0; cnt <= line; cnt++) { size_t linecap = 0; - ssize_t linelen; - linelen = ::getline(&buf, &linecap, cmdPipe); + ssize_t linelen = ::getline(&buf, &linecap, cmdPipe); if (linelen < 0) { @@ -65,6 +63,11 @@ string pOpen(const string &cmd, label line=0) if (cnt == line) { res = string(buf); + // Trim trailing newline + if (res.size()) + { + res.resize(res.size()-1); + } break; } } @@ -77,7 +80,7 @@ string pOpen(const string &cmd, label line=0) pclose(cmdPipe); } - return res.substr(0, res.size() - 1); + return res; } diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index dba68b7a11..d9f2104c18 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -211,7 +211,7 @@ $(functionEntries)/includeEntry/includeEntry.C $(functionEntries)/includeEtcEntry/includeEtcEntry.C $(functionEntries)/includeFuncEntry/includeFuncEntry.C $(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C -$(functionEntries)/inputModeEntry/inputModeEntry.C +$(functionEntries)/inputMode/inputMode.C $(functionEntries)/removeEntry/removeEntry.C IOdictionary = db/IOobjects/IOdictionary diff --git a/src/OpenFOAM/containers/HashTables/HashTableFwd.H b/src/OpenFOAM/containers/HashTables/HashTableFwd.H new file mode 100644 index 0000000000..2b3fe403b1 --- /dev/null +++ b/src/OpenFOAM/containers/HashTables/HashTableFwd.H @@ -0,0 +1,53 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +InNamspace + Foam + +Description + Forwards for various hash table types + +\*---------------------------------------------------------------------------*/ + +#ifndef HashTableFwd_H +#define HashTableFwd_H + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +template class HashTable; +template class HashPtrTable; +template class HashSet; + +template class Map; +template class PtrMap; + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C index 5ec0b29cf0..1dfeac4253 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.C +++ b/src/OpenFOAM/db/IOobject/IOobject.C @@ -149,7 +149,7 @@ bool Foam::IOobject::fileNameComponents // No '/' found (or empty entirely) // => no instance or local - name = word::validated(path, false); + name = word::validate(path); } else if (first == 0) { @@ -160,7 +160,7 @@ bool Foam::IOobject::fileNameComponents const std::string ending = path.substr(last+1); nameLen = ending.size(); // The raw length of name - name = word::validated(ending, false); + name = word::validate(ending); } else { @@ -176,7 +176,7 @@ bool Foam::IOobject::fileNameComponents const std::string ending = path.substr(last+1); nameLen = ending.size(); // The raw length of name - name = word::validated(ending, false); + name = word::validate(ending); } // Check for valid (and stripped) name, regardless of the debug level diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H index b41ef980f2..7b89997c8a 100644 --- a/src/OpenFOAM/db/IOobject/IOobject.H +++ b/src/OpenFOAM/db/IOobject/IOobject.H @@ -174,11 +174,11 @@ protected: // Protected Member Functions //- Construct and return an IFstream for the object. - // \Return nullptr if the stream construction failed + // \return nullptr if the stream construction failed Istream* objectStream(); //- Return an IFstream for the object given the exact file. - // \Return nullptr if the stream construction failed + // \return nullptr if the stream construction failed Istream* objectStream(const fileName& fName); //- Set the object state to bad diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C index 7d639e7b5c..3147e59380 100644 --- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C +++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C @@ -65,7 +65,7 @@ bool Foam::IOobject::readHeader(Istream& is) && firstToken.wordToken() == "FoamFile" ) { - dictionary headerDict(is); + const dictionary headerDict(is); is.version(headerDict.lookup("version")); is.format(headerDict.lookup("format")); diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.C b/src/OpenFOAM/db/IOobjectList/IOobjectList.C index 981e5ca2e5..f70f3e7ebf 100644 --- a/src/OpenFOAM/db/IOobjectList/IOobjectList.C +++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.C @@ -154,14 +154,14 @@ Foam::IOobjectList::IOobjectList } // Create a list of file names in this directory - fileNameList objNames = + const auto objNames = readDir(db.path(newInstance, db.dbDir()/local), fileName::FILE); - forAll(objNames, i) + for (const auto& objName : objNames) { IOobject* objectPtr = new IOobject ( - objNames[i], + objName, newInstance, local, db, @@ -170,8 +170,23 @@ Foam::IOobjectList::IOobjectList registerObject ); - // Use object with local scope - if (objectPtr->typeHeaderOk>(false)) + bool ok = false; + const bool throwingIOerr = FatalIOError.throwExceptions(); + + try + { + // Use object with local scope and current instance (no searching) + ok = objectPtr->typeHeaderOk>(false, false); + } + catch (Foam::IOerror& err) + { + Warning + << err << nl << endl; + } + + FatalIOError.throwExceptions(throwingIOerr); + + if (ok) { insert(objectPtr->name(), objectPtr); } diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C index 5707d2d5c9..333aeca259 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C @@ -56,8 +56,8 @@ inline void Foam::UIPstream::readFromBuffer(T& t) inline void Foam::UIPstream::readFromBuffer ( void* data, - size_t count, - size_t align + const size_t count, + const size_t align ) { if (align > 1) @@ -76,6 +76,22 @@ inline void Foam::UIPstream::readFromBuffer } +inline Foam::Istream& Foam::UIPstream::readStringFromBuffer(std::string& str) +{ + size_t len; + readFromBuffer(len); + // Uses the underlying std::string::operator=() + // - no stripInvalid invoked (the sending side should have done that) + // - relies on trailing '\0' char (so cannot send anything with an embedded + // nul char) + str = &externalBuf_[externalBufPosition_]; + externalBufPosition_ += len + 1; + checkEof(); + + return *this; +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::UIPstream::~UIPstream() @@ -107,7 +123,7 @@ Foam::Istream& Foam::UIPstream::read(token& t) char c; - // return on error + // Return on error if (!read(c)) { t.setBad(); @@ -141,7 +157,7 @@ Foam::Istream& Foam::UIPstream::read(token& t) } // Word - case token::WORD : + case token::tokenType::WORD : { word* pval = new word; if (read(*pval)) @@ -165,30 +181,26 @@ Foam::Istream& Foam::UIPstream::read(token& t) } // String - case token::VERBATIMSTRING : + case token::tokenType::VERBATIMSTRING : { // Recurse to read actual string read(t); - t.type() = token::VERBATIMSTRING; + t.type() = token::tokenType::VERBATIMSTRING; return *this; } - case token::VARIABLE : + case token::tokenType::VARIABLE : { // Recurse to read actual string read(t); - t.type() = token::VARIABLE; + t.type() = token::tokenType::VARIABLE; return *this; } - case token::STRING : + case token::tokenType::STRING : { string* pval = new string; if (read(*pval)) { t = pval; - if (c == token::VERBATIMSTRING) - { - t.type() = token::VERBATIMSTRING; - } } else { @@ -199,7 +211,7 @@ Foam::Istream& Foam::UIPstream::read(token& t) } // Label - case token::LABEL : + case token::tokenType::LABEL : { label val; if (read(val)) @@ -214,7 +226,7 @@ Foam::Istream& Foam::UIPstream::read(token& t) } // floatScalar - case token::FLOAT_SCALAR : + case token::tokenType::FLOAT_SCALAR : { floatScalar val; if (read(val)) @@ -229,7 +241,7 @@ Foam::Istream& Foam::UIPstream::read(token& t) } // doubleScalar - case token::DOUBLE_SCALAR : + case token::tokenType::DOUBLE_SCALAR : { doubleScalar val; if (read(val)) @@ -272,23 +284,13 @@ Foam::Istream& Foam::UIPstream::read(char& c) Foam::Istream& Foam::UIPstream::read(word& str) { - size_t len; - readFromBuffer(len); - str = &externalBuf_[externalBufPosition_]; - externalBufPosition_ += len + 1; - checkEof(); - return *this; + return readStringFromBuffer(str); } Foam::Istream& Foam::UIPstream::read(string& str) { - size_t len; - readFromBuffer(len); - str = &externalBuf_[externalBufPosition_]; - externalBufPosition_ += len + 1; - checkEof(); - return *this; + return readStringFromBuffer(str); } diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H index b4aefe4446..4913693741 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H @@ -80,10 +80,19 @@ class UIPstream //- Read a T from the transfer buffer template - inline void readFromBuffer(T&); + inline void readFromBuffer(T& t); - //- Read data from the transfer buffer - inline void readFromBuffer(void* data, size_t count, size_t align); + //- Read count bytes of data from the transfer buffer + // using align byte alignment + inline void readFromBuffer + ( + void* data, + const size_t count, + const size_t align + ); + + //- Read string length and its content. + inline Istream& readStringFromBuffer(std::string& str); public: @@ -139,28 +148,28 @@ public: ); //- Return next token from stream - Istream& read(token&); + Istream& read(token& t); //- Read a character - Istream& read(char&); + Istream& read(char& c); //- Read a word - Istream& read(word&); + Istream& read(word& str); - // Read a string (including enclosing double-quotes) - Istream& read(string&); + // Read a string + Istream& read(string& str); //- Read a label - Istream& read(label&); + Istream& read(label& val); //- Read a floatScalar - Istream& read(floatScalar&); + Istream& read(floatScalar& val); //- Read a doubleScalar - Istream& read(doubleScalar&); + Istream& read(doubleScalar& val); - //- Read binary block - Istream& read(char*, std::streamsize); + //- Read binary block with 8-byte alignment. + Istream& read(char* data, const std::streamsize count); //- Rewind and return the stream so that it may be read again Istream& rewind(); diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C index 8e6a5eb17a..6667389b74 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C @@ -51,8 +51,8 @@ inline void Foam::UOPstream::writeToBuffer(const char& c) inline void Foam::UOPstream::writeToBuffer ( const void* data, - size_t count, - size_t align + const size_t count, + const size_t align ) { if (!sendBuf_.capacity()) @@ -77,6 +77,13 @@ inline void Foam::UOPstream::writeToBuffer } +inline void Foam::UOPstream::writeStringToBuffer(const std::string& str) +{ + const size_t len = str.size(); + writeToBuffer(len); + writeToBuffer(str.c_str(), len + 1, 1); +} + // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * // @@ -153,14 +160,14 @@ Foam::UOPstream::~UOPstream() Foam::Ostream& Foam::UOPstream::write(const token& t) { // Raw token output only supported for verbatim strings for now - if (t.type() == token::VERBATIMSTRING) + if (t.type() == token::tokenType::VERBATIMSTRING) { - write(char(token::VERBATIMSTRING)); + writeToBuffer(char(token::tokenType::VERBATIMSTRING)); write(t.stringToken()); } - else if (t.type() == token::VARIABLE) + else if (t.type() == token::tokenType::VARIABLE) { - write(char(token::VARIABLE)); + writeToBuffer(char(token::tokenType::VARIABLE)); write(t.stringToken()); } else @@ -185,7 +192,7 @@ Foam::Ostream& Foam::UOPstream::write(const char c) Foam::Ostream& Foam::UOPstream::write(const char* str) { - word nonWhiteChars(string::validate(str)); + const word nonWhiteChars(string::validate(str)); if (nonWhiteChars.size() == 1) { @@ -204,11 +211,8 @@ Foam::Ostream& Foam::UOPstream::write(const char* str) Foam::Ostream& Foam::UOPstream::write(const word& str) { - write(char(token::WORD)); - - size_t len = str.size(); - writeToBuffer(len); - writeToBuffer(str.c_str(), len + 1, 1); + writeToBuffer(char(token::tokenType::WORD)); + writeStringToBuffer(str); return *this; } @@ -216,11 +220,8 @@ Foam::Ostream& Foam::UOPstream::write(const word& str) Foam::Ostream& Foam::UOPstream::write(const string& str) { - write(char(token::STRING)); - - size_t len = str.size(); - writeToBuffer(len); - writeToBuffer(str.c_str(), len + 1, 1); + writeToBuffer(char(token::tokenType::STRING)); + writeStringToBuffer(str); return *this; } @@ -234,16 +235,13 @@ Foam::Ostream& Foam::UOPstream::writeQuoted { if (quoted) { - write(char(token::STRING)); + writeToBuffer(char(token::tokenType::STRING)); } else { - write(char(token::WORD)); + writeToBuffer(char(token::tokenType::WORD)); } - - size_t len = str.size(); - writeToBuffer(len); - writeToBuffer(str.c_str(), len + 1, 1); + writeStringToBuffer(str); return *this; } @@ -251,7 +249,7 @@ Foam::Ostream& Foam::UOPstream::writeQuoted Foam::Ostream& Foam::UOPstream::write(const int32_t val) { - write(char(token::LABEL)); + writeToBuffer(char(token::tokenType::LABEL)); writeToBuffer(val); return *this; } @@ -259,7 +257,7 @@ Foam::Ostream& Foam::UOPstream::write(const int32_t val) Foam::Ostream& Foam::UOPstream::write(const int64_t val) { - write(char(token::LABEL)); + writeToBuffer(char(token::tokenType::LABEL)); writeToBuffer(val); return *this; } @@ -267,7 +265,7 @@ Foam::Ostream& Foam::UOPstream::write(const int64_t val) Foam::Ostream& Foam::UOPstream::write(const floatScalar val) { - write(char(token::FLOAT_SCALAR)); + writeToBuffer(char(token::tokenType::FLOAT_SCALAR)); writeToBuffer(val); return *this; } @@ -275,13 +273,17 @@ Foam::Ostream& Foam::UOPstream::write(const floatScalar val) Foam::Ostream& Foam::UOPstream::write(const doubleScalar val) { - write(char(token::DOUBLE_SCALAR)); + writeToBuffer(char(token::tokenType::DOUBLE_SCALAR)); writeToBuffer(val); return *this; } -Foam::Ostream& Foam::UOPstream::write(const char* data, std::streamsize count) +Foam::Ostream& Foam::UOPstream::write +( + const char* data, + const std::streamsize count +) { if (format() != BINARY) { diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H index 349ac52104..6ee40e0378 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H @@ -74,13 +74,23 @@ class UOPstream //- Write a T to the transfer buffer template - inline void writeToBuffer(const T&); + inline void writeToBuffer(const T& t); //- Write a char to the transfer buffer - inline void writeToBuffer(const char&); + inline void writeToBuffer(const char& c); - //- Write data to the transfer buffer - inline void writeToBuffer(const void* data, size_t count, size_t align); + //- Write count bytes of data to the transfer buffer + // using align byte alignment + inline void writeToBuffer + ( + const void* data, + const size_t count, + const size_t align + ); + + //- Write string length and content. + // The content includes the trailing nul char. + inline void writeStringToBuffer(const std::string& str); public: @@ -102,7 +112,7 @@ public: ); //- Construct given buffers - UOPstream(const int toProcNo, PstreamBuffers&); + UOPstream(const int toProcNo, PstreamBuffers& buffers); //- Destructor @@ -134,42 +144,43 @@ public: ); //- Write next token to stream - Ostream& write(const token&); + Ostream& write(const token& t); - //- Write character - Ostream& write(const char); + //- Write single character. Whitespace is suppressed. + Ostream& write(const char c); - //- Write character string - Ostream& write(const char*); + //- Write the word-characters of a character string. + // Sends as a single char, or as word. + Ostream& write(const char* str); //- Write word - Ostream& write(const word&); + Ostream& write(const word& str); //- Write string - Ostream& write(const string&); + Ostream& write(const string& str); //- Write std::string surrounded by quotes. // Optional write without quotes. Ostream& writeQuoted ( - const std::string&, + const std::string& str, const bool quoted=true ); - //- Write int32_t - virtual Ostream& write(const int32_t); + //- Write int32_t as a label + virtual Ostream& write(const int32_t val); - //- Write int64_t - Ostream& write(const int64_t); + //- Write int64_t as a label + Ostream& write(const int64_t val); //- Write floatScalar - Ostream& write(const floatScalar); + Ostream& write(const floatScalar val); //- Write doubleScalar - Ostream& write(const doubleScalar); + Ostream& write(const doubleScalar val); - //- Write binary block - Ostream& write(const char*, std::streamsize); + //- Write binary block with 8-byte alignment. + Ostream& write(const char* data, const std::streamsize count); //- Add indentation characters void indent() @@ -223,7 +234,7 @@ public: // Print //- Print description of IOstream to Ostream - void print(Ostream&) const; + void print(Ostream& os) const; }; diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H index 7e71fc543c..0b936c9f7e 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation - \\/ M anipulation | Copyright 2015-2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C index 7bd031d87a..40c2d8e595 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C @@ -224,7 +224,7 @@ Foam::Istream& Foam::ISstream::read(token& t) else { t = sPtr; - t.type() = token::VERBATIMSTRING; + t.type() = token::tokenType::VERBATIMSTRING; } return *this; @@ -266,7 +266,7 @@ Foam::Istream& Foam::ISstream::read(token& t) else { t = sPtr; - t.type() = token::VARIABLE; + t.type() = token::tokenType::VARIABLE; } return *this; } @@ -604,13 +604,14 @@ Foam::Istream& Foam::ISstream::readVariable(string& str) // Read, counting brackets buf[nChar++] = c; + // Also allow '/' between ${...} blocks for slash-scoping of entries while ( get(c) && ( c == token::BEGIN_BLOCK || c == token::END_BLOCK - || word::valid(c) + || word::valid(c) || c == '/' ) ) { @@ -620,7 +621,7 @@ Foam::Istream& Foam::ISstream::readVariable(string& str) buf[errLen] = '\0'; FatalIOErrorInFunction(*this) - << "word '" << buf << "...'\n" + << "variable '" << buf << "...'\n" << " is too long (max. " << maxLen << " characters)" << exit(FatalIOError); @@ -656,7 +657,7 @@ Foam::Istream& Foam::ISstream::readVariable(string& str) buf[errLen] = '\0'; FatalIOErrorInFunction(*this) - << "word '" << buf << "...'\n" + << "variable '" << buf << "...'\n" << " is too long (max. " << maxLen << " characters)" << exit(FatalIOError); diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C index 0feb835340..5dc8a3e6bd 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C @@ -31,7 +31,7 @@ License Foam::Ostream& Foam::OSstream::write(const token& t) { - if (t.type() == token::VERBATIMSTRING) + if (t.type() == token::tokenType::VERBATIMSTRING) { write(char(token::HASH)); write(char(token::BEGIN_BLOCK)); @@ -39,9 +39,9 @@ Foam::Ostream& Foam::OSstream::write(const token& t) write(char(token::HASH)); write(char(token::END_BLOCK)); } - else if (t.type() == token::VARIABLE) + else if (t.type() == token::tokenType::VARIABLE) { - writeQuoted( t.stringToken(), false); + writeQuoted(t.stringToken(), false); } return *this; } @@ -81,9 +81,9 @@ Foam::Ostream& Foam::OSstream::write(const string& str) os_ << token::BEGIN_STRING; int backslash = 0; - for (string::const_iterator iter = str.begin(); iter != str.end(); ++iter) + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { - char c = *iter; + const char c = *iter; if (c == '\\') { @@ -132,14 +132,9 @@ Foam::Ostream& Foam::OSstream::writeQuoted os_ << token::BEGIN_STRING; int backslash = 0; - for - ( - string::const_iterator iter = str.begin(); - iter != str.end(); - ++iter - ) + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { - char c = *iter; + const char c = *iter; if (c == '\\') { diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C index f9ff715821..cb28408f7d 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C @@ -67,7 +67,7 @@ void Foam::prefixOSstream::print(Ostream& os) const Foam::Ostream& Foam::prefixOSstream::write(const token& t) { - if (t.type() == token::VERBATIMSTRING) + if (t.type() == token::tokenType::VERBATIMSTRING) { write(char(token::HASH)); write(char(token::BEGIN_BLOCK)); @@ -75,7 +75,7 @@ Foam::Ostream& Foam::prefixOSstream::write(const token& t) write(char(token::HASH)); write(char(token::END_BLOCK)); } - else if (t.type() == token::VARIABLE) + else if (t.type() == token::tokenType::VARIABLE) { writeQuoted(t.stringToken(), false); } diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C index 4246fc80e7..17019bda99 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.C +++ b/src/OpenFOAM/db/IOstreams/token/token.C @@ -92,7 +92,7 @@ bool Foam::token::compound::isCompound(const word& name) Foam::token::compound& Foam::token::transferCompoundToken(const Istream& is) { - if (type_ == COMPOUND) + if (type_ == tokenType::COMPOUND) { if (compoundTokenPtr_->empty()) { diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H index b883cd376d..1de16e5e13 100644 --- a/src/OpenFOAM/db/IOstreams/token/token.H +++ b/src/OpenFOAM/db/IOstreams/token/token.H @@ -197,7 +197,7 @@ public: // Write - virtual void write(Ostream&) const = 0; + virtual void write(Ostream& os) const = 0; // IOstream Operators @@ -284,28 +284,47 @@ public: inline token(); //- Construct as copy - inline token(const token&); + inline token(const token& t); //- Construct punctuation character token - inline token(punctuationToken, label lineNumber=0); + inline explicit token(punctuationToken p); //- Construct word token - inline token(const word&, label lineNumber=0); + inline explicit token(const word& w); //- Construct string token - inline token(const string&, label lineNumber=0); + inline explicit token(const string& str); //- Construct label token - inline token(const label, label lineNumber=0); + inline explicit token(const label val); //- Construct floatScalar token - inline token(const floatScalar, label lineNumber=0); + inline explicit token(const floatScalar val); //- Construct doubleScalar token - inline token(const doubleScalar, label lineNumber=0); + inline explicit token(const doubleScalar val); + + + //- Construct punctuation character token + inline token(punctuationToken p, const label lineNumber); + + //- Construct word token + inline token(const word& w, const label lineNumber); + + //- Construct string token + inline token(const string& str, const label lineNumber); + + //- Construct label token + inline token(const label val, const label lineNumber); + + //- Construct floatScalar token + inline token(const floatScalar val, const label lineNumber); + + //- Construct doubleScalar token + inline token(const doubleScalar val, const label lineNumber); //- Construct from Istream - token(Istream&); + token(Istream& is); //- Destructor @@ -377,43 +396,43 @@ public: // Assignment - inline void operator=(const token&); + inline void operator=(const token& t); - inline void operator=(const punctuationToken); + inline void operator=(const punctuationToken p); - inline void operator=(word*); - inline void operator=(const word&); + inline void operator=(word* wPtr); + inline void operator=(const word& w); - inline void operator=(string*); - inline void operator=(const string&); + inline void operator=(string* strPtr); + inline void operator=(const string& str); - inline void operator=(const label); - inline void operator=(const floatScalar); - inline void operator=(const doubleScalar); + inline void operator=(const label val); + inline void operator=(const floatScalar val); + inline void operator=(const doubleScalar val); - inline void operator=(compound*); + inline void operator=(compound* compPtr); // Equality - inline bool operator==(const token&) const; - inline bool operator==(const punctuationToken) const; - inline bool operator==(const word&) const; - inline bool operator==(const string&) const; - inline bool operator==(const label) const; - inline bool operator==(const floatScalar) const; - inline bool operator==(const doubleScalar) const; + inline bool operator==(const token& t) const; + inline bool operator==(const punctuationToken p) const; + inline bool operator==(const word& w) const; + inline bool operator==(const string& str) const; + inline bool operator==(const label val) const; + inline bool operator==(const floatScalar val) const; + inline bool operator==(const doubleScalar val) const; // Inequality - inline bool operator!=(const token&) const; - inline bool operator!=(const punctuationToken) const; - inline bool operator!=(const word&) const; - inline bool operator!=(const string&) const; - inline bool operator!=(const label) const; - inline bool operator!=(const floatScalar) const; - inline bool operator!=(const doubleScalar) const; + inline bool operator!=(const token& t) const; + inline bool operator!=(const punctuationToken p) const; + inline bool operator!=(const word& w) const; + inline bool operator!=(const string& str) const; + inline bool operator!=(const label val) const; + inline bool operator!=(const floatScalar val) const; + inline bool operator!=(const doubleScalar val) const; // IOstream operators diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H index 9831e05695..32417b4e75 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenI.H +++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H @@ -27,15 +27,20 @@ License inline void Foam::token::clear() { - if (type_ == WORD) + if (type_ == tokenType::WORD) { delete wordTokenPtr_; } - else if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING) + else if + ( + type_ == tokenType::STRING + || type_ == tokenType::VARIABLE + || type_ == tokenType::VERBATIMSTRING + ) { delete stringTokenPtr_; } - else if (type_ == COMPOUND) + else if (type_ == tokenType::COMPOUND) { if (compoundTokenPtr_->unique()) { @@ -47,7 +52,7 @@ inline void Foam::token::clear() } } - type_ = UNDEFINED; + type_ = tokenType::UNDEFINED; } @@ -55,7 +60,7 @@ inline void Foam::token::clear() inline Foam::token::token() : - type_(UNDEFINED), + type_(tokenType::UNDEFINED), lineNumber_(0) {} @@ -67,49 +72,85 @@ inline Foam::token::token(const token& t) { switch (type_) { - case token::UNDEFINED: + case tokenType::UNDEFINED: break; - case PUNCTUATION: + case tokenType::PUNCTUATION: punctuationToken_ = t.punctuationToken_; break; - case WORD: + case tokenType::WORD: wordTokenPtr_ = new word(*t.wordTokenPtr_); break; - case STRING: - case VARIABLE: - case VERBATIMSTRING: + case tokenType::STRING: + case tokenType::VARIABLE: + case tokenType::VERBATIMSTRING: stringTokenPtr_ = new string(*t.stringTokenPtr_); break; - case LABEL: + case tokenType::LABEL: labelToken_ = t.labelToken_; break; - case FLOAT_SCALAR: + case tokenType::FLOAT_SCALAR: floatScalarToken_ = t.floatScalarToken_; break; - case DOUBLE_SCALAR: + case tokenType::DOUBLE_SCALAR: doubleScalarToken_ = t.doubleScalarToken_; break; - case COMPOUND: + case tokenType::COMPOUND: compoundTokenPtr_ = t.compoundTokenPtr_; compoundTokenPtr_->refCount::operator++(); break; - case token::ERROR: + case tokenType::ERROR: break; } } +inline Foam::token::token(punctuationToken p) +: + token(p, 0) +{} + + +inline Foam::token::token(const word& w) +: + token(w, 0) +{} + + +inline Foam::token::token(const string& str) +: + token(str, 0) +{} + + +inline Foam::token::token(const label val) +: + token(val, 0) +{} + + +inline Foam::token::token(const floatScalar val) +: + token(val, 0) +{} + + +inline Foam::token::token(const doubleScalar val) +: + token(val, 0) +{} + + inline Foam::token::token(punctuationToken p, label lineNumber) : - type_(PUNCTUATION), + type_(tokenType::PUNCTUATION), punctuationToken_(p), lineNumber_(lineNumber) {} @@ -117,40 +158,40 @@ inline Foam::token::token(punctuationToken p, label lineNumber) inline Foam::token::token(const word& w, label lineNumber) : - type_(WORD), + type_(tokenType::WORD), wordTokenPtr_(new word(w)), lineNumber_(lineNumber) {} -inline Foam::token::token(const string& s, label lineNumber) +inline Foam::token::token(const string& str, label lineNumber) : - type_(STRING), - stringTokenPtr_(new string(s)), + type_(tokenType::STRING), + stringTokenPtr_(new string(str)), lineNumber_(lineNumber) {} -inline Foam::token::token(const label l, label lineNumber) +inline Foam::token::token(const label val, label lineNumber) : - type_(LABEL), - labelToken_(l), + type_(tokenType::LABEL), + labelToken_(val), lineNumber_(lineNumber) {} -inline Foam::token::token(const floatScalar s, label lineNumber) +inline Foam::token::token(const floatScalar val, label lineNumber) : - type_(FLOAT_SCALAR), - floatScalarToken_(s), + type_(tokenType::FLOAT_SCALAR), + floatScalarToken_(val), lineNumber_(lineNumber) {} -inline Foam::token::token(const doubleScalar s, label lineNumber) +inline Foam::token::token(const doubleScalar val, label lineNumber) : - type_(DOUBLE_SCALAR), - doubleScalarToken_(s), + type_(tokenType::DOUBLE_SCALAR), + doubleScalarToken_(val), lineNumber_(lineNumber) {} @@ -177,27 +218,27 @@ inline Foam::token::tokenType& Foam::token::type() inline bool Foam::token::good() const { - return (type_ != ERROR && type_ != UNDEFINED); + return (type_ != tokenType::ERROR && type_ != tokenType::UNDEFINED); } inline bool Foam::token::undefined() const { - return (type_ == UNDEFINED); + return (type_ == tokenType::UNDEFINED); } inline bool Foam::token::error() const { - return (type_ == ERROR); + return (type_ == tokenType::ERROR); } inline bool Foam::token::isPunctuation() const { - return (type_ == PUNCTUATION); + return (type_ == tokenType::PUNCTUATION); } inline Foam::token::punctuationToken Foam::token::pToken() const { - if (type_ == PUNCTUATION) + if (type_ == tokenType::PUNCTUATION) { return punctuationToken_; } @@ -210,12 +251,12 @@ inline Foam::token::punctuationToken Foam::token::pToken() const inline bool Foam::token::isWord() const { - return (type_ == WORD); + return (type_ == tokenType::WORD); } inline const Foam::word& Foam::token::wordToken() const { - if (type_ == WORD) + if (type_ == tokenType::WORD) { return *wordTokenPtr_; } @@ -228,17 +269,27 @@ inline const Foam::word& Foam::token::wordToken() const inline bool Foam::token::isVariable() const { - return (type_ == VARIABLE); + return (type_ == tokenType::VARIABLE); } inline bool Foam::token::isString() const { - return (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING); + return + ( + type_ == tokenType::STRING + || type_ == tokenType::VARIABLE + || type_ == tokenType::VERBATIMSTRING + ); } inline const Foam::string& Foam::token::stringToken() const { - if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING) + if + ( + type_ == tokenType::STRING + || type_ == tokenType::VARIABLE + || type_ == tokenType::VERBATIMSTRING + ) { return *stringTokenPtr_; } @@ -251,12 +302,12 @@ inline const Foam::string& Foam::token::stringToken() const inline bool Foam::token::isLabel() const { - return (type_ == LABEL); + return (type_ == tokenType::LABEL); } inline Foam::label Foam::token::labelToken() const { - if (type_ == LABEL) + if (type_ == tokenType::LABEL) { return labelToken_; } @@ -269,12 +320,12 @@ inline Foam::label Foam::token::labelToken() const inline bool Foam::token::isFloatScalar() const { - return (type_ == FLOAT_SCALAR); + return (type_ == tokenType::FLOAT_SCALAR); } inline Foam::floatScalar Foam::token::floatScalarToken() const { - if (type_ == FLOAT_SCALAR) + if (type_ == tokenType::FLOAT_SCALAR) { return floatScalarToken_; } @@ -288,12 +339,12 @@ inline Foam::floatScalar Foam::token::floatScalarToken() const inline bool Foam::token::isDoubleScalar() const { - return (type_ == DOUBLE_SCALAR); + return (type_ == tokenType::DOUBLE_SCALAR); } inline Foam::doubleScalar Foam::token::doubleScalarToken() const { - if (type_ == DOUBLE_SCALAR) + if (type_ == tokenType::DOUBLE_SCALAR) { return doubleScalarToken_; } @@ -307,16 +358,20 @@ inline Foam::doubleScalar Foam::token::doubleScalarToken() const inline bool Foam::token::isScalar() const { - return (type_ == FLOAT_SCALAR || type_ == DOUBLE_SCALAR); + return + ( + type_ == tokenType::FLOAT_SCALAR + || type_ == tokenType::DOUBLE_SCALAR + ); } inline Foam::scalar Foam::token::scalarToken() const { - if (type_ == FLOAT_SCALAR) + if (type_ == tokenType::FLOAT_SCALAR) { return floatScalarToken_; } - else if (type_ == DOUBLE_SCALAR) + else if (type_ == tokenType::DOUBLE_SCALAR) { return doubleScalarToken_; } @@ -329,12 +384,12 @@ inline Foam::scalar Foam::token::scalarToken() const inline bool Foam::token::isNumber() const { - return (type_ == LABEL || isScalar()); + return (type_ == tokenType::LABEL || isScalar()); } inline Foam::scalar Foam::token::number() const { - if (type_ == LABEL) + if (type_ == tokenType::LABEL) { return labelToken_; } @@ -351,12 +406,12 @@ inline Foam::scalar Foam::token::number() const inline bool Foam::token::isCompound() const { - return (type_ == COMPOUND); + return (type_ == tokenType::COMPOUND); } inline const Foam::token::compound& Foam::token::compoundToken() const { - if (type_ == COMPOUND) + if (type_ == tokenType::COMPOUND) { return *compoundTokenPtr_; } @@ -382,7 +437,7 @@ inline Foam::label& Foam::token::lineNumber() inline void Foam::token::setBad() { clear(); - type_ = ERROR; + type_ = tokenType::ERROR; } @@ -395,41 +450,41 @@ inline void Foam::token::operator=(const token& t) switch (type_) { - case token::UNDEFINED: + case tokenType::UNDEFINED: break; - case PUNCTUATION: + case tokenType::PUNCTUATION: punctuationToken_ = t.punctuationToken_; break; - case WORD: + case tokenType::WORD: wordTokenPtr_ = new word(*t.wordTokenPtr_); break; - case STRING: - case VARIABLE: - case VERBATIMSTRING: + case tokenType::STRING: + case tokenType::VARIABLE: + case tokenType::VERBATIMSTRING: stringTokenPtr_ = new string(*t.stringTokenPtr_); break; - case LABEL: + case tokenType::LABEL: labelToken_ = t.labelToken_; break; - case FLOAT_SCALAR: + case tokenType::FLOAT_SCALAR: floatScalarToken_ = t.floatScalarToken_; break; - case DOUBLE_SCALAR: + case tokenType::DOUBLE_SCALAR: doubleScalarToken_ = t.doubleScalarToken_; break; - case COMPOUND: + case tokenType::COMPOUND: compoundTokenPtr_ = t.compoundTokenPtr_; compoundTokenPtr_->refCount::operator++(); break; - case token::ERROR: + case tokenType::ERROR: break; } @@ -439,14 +494,14 @@ inline void Foam::token::operator=(const token& t) inline void Foam::token::operator=(const punctuationToken p) { clear(); - type_ = PUNCTUATION; + type_ = tokenType::PUNCTUATION; punctuationToken_ = p; } inline void Foam::token::operator=(word* wPtr) { clear(); - type_ = WORD; + type_ = tokenType::WORD; wordTokenPtr_ = wPtr; } @@ -455,44 +510,44 @@ inline void Foam::token::operator=(const word& w) operator=(new word(w)); } -inline void Foam::token::operator=(string* sPtr) +inline void Foam::token::operator=(string* strPtr) { clear(); - type_ = STRING; - stringTokenPtr_ = sPtr; + type_ = tokenType::STRING; + stringTokenPtr_ = strPtr; } -inline void Foam::token::operator=(const string& s) +inline void Foam::token::operator=(const string& str) { - operator=(new string(s)); + operator=(new string(str)); } -inline void Foam::token::operator=(const label l) +inline void Foam::token::operator=(const label val) { clear(); - type_ = LABEL; - labelToken_ = l; + type_ = tokenType::LABEL; + labelToken_ = val; } -inline void Foam::token::operator=(const floatScalar s) +inline void Foam::token::operator=(const floatScalar val) { clear(); - type_ = FLOAT_SCALAR; - floatScalarToken_ = s; + type_ = tokenType::FLOAT_SCALAR; + floatScalarToken_ = val; } -inline void Foam::token::operator=(const doubleScalar s) +inline void Foam::token::operator=(const doubleScalar val) { clear(); - type_ = DOUBLE_SCALAR; - doubleScalarToken_ = s; + type_ = tokenType::DOUBLE_SCALAR; + doubleScalarToken_ = val; } -inline void Foam::token::operator=(Foam::token::compound* cPtr) +inline void Foam::token::operator=(Foam::token::compound* compPtr) { clear(); - type_ = COMPOUND; - compoundTokenPtr_ = cPtr; + type_ = tokenType::COMPOUND; + compoundTokenPtr_ = compPtr; } @@ -505,33 +560,33 @@ inline bool Foam::token::operator==(const token& t) const switch (type_) { - case token::UNDEFINED: + case tokenType::UNDEFINED: return true; - case PUNCTUATION: + case tokenType::PUNCTUATION: return punctuationToken_ == t.punctuationToken_; - case WORD: + case tokenType::WORD: return *wordTokenPtr_ == *t.wordTokenPtr_; - case STRING: - case VARIABLE: - case VERBATIMSTRING: + case tokenType::STRING: + case tokenType::VARIABLE: + case tokenType::VERBATIMSTRING: return *stringTokenPtr_ == *t.stringTokenPtr_; - case LABEL: + case tokenType::LABEL: return labelToken_ == t.labelToken_; - case FLOAT_SCALAR: + case tokenType::FLOAT_SCALAR: return equal(floatScalarToken_, t.floatScalarToken_); - case DOUBLE_SCALAR: + case tokenType::DOUBLE_SCALAR: return equal(doubleScalarToken_, t.doubleScalarToken_); - case COMPOUND: + case tokenType::COMPOUND: return compoundTokenPtr_ == t.compoundTokenPtr_; - case token::ERROR: + case tokenType::ERROR: return true; } @@ -540,36 +595,52 @@ inline bool Foam::token::operator==(const token& t) const inline bool Foam::token::operator==(const punctuationToken p) const { - return (type_ == PUNCTUATION && punctuationToken_ == p); + return (type_ == tokenType::PUNCTUATION && punctuationToken_ == p); } inline bool Foam::token::operator==(const word& w) const { - return (type_ == WORD && wordToken() == w); + return (type_ == tokenType::WORD && wordToken() == w); } -inline bool Foam::token::operator==(const string& s) const +inline bool Foam::token::operator==(const string& str) const { return ( - (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING) - && stringToken() == s + ( + type_ == tokenType::STRING + || type_ == tokenType::VARIABLE + || type_ == tokenType::VERBATIMSTRING + ) + && stringToken() == str ); } -inline bool Foam::token::operator==(const label l) const +inline bool Foam::token::operator==(const label val) const { - return (type_ == LABEL && labelToken_ == l); + return + ( + type_ == tokenType::LABEL + && labelToken_ == val + ); } -inline bool Foam::token::operator==(const floatScalar s) const +inline bool Foam::token::operator==(const floatScalar val) const { - return (type_ == FLOAT_SCALAR && equal(floatScalarToken_, s)); + return + ( + type_ == tokenType::FLOAT_SCALAR + && equal(floatScalarToken_, val) + ); } -inline bool Foam::token::operator==(const doubleScalar s) const +inline bool Foam::token::operator==(const doubleScalar val) const { - return (type_ == DOUBLE_SCALAR && equal(doubleScalarToken_, s)); + return + ( + type_ == tokenType::DOUBLE_SCALAR + && equal(doubleScalarToken_, val) + ); } inline bool Foam::token::operator!=(const token& t) const @@ -587,24 +658,24 @@ inline bool Foam::token::operator!=(const word& w) const return !operator==(w); } -inline bool Foam::token::operator!=(const string& s) const +inline bool Foam::token::operator!=(const string& str) const { - return !operator==(s); + return !operator==(str); } -inline bool Foam::token::operator!=(const floatScalar s) const +inline bool Foam::token::operator!=(const label val) const { - return !operator==(s); + return !operator==(val); } -inline bool Foam::token::operator!=(const doubleScalar s) const +inline bool Foam::token::operator!=(const floatScalar val) const { - return !operator==(s); + return !operator==(val); } -inline bool Foam::token::operator!=(const label l) const +inline bool Foam::token::operator!=(const doubleScalar val) const { - return !operator==(l); + return !operator==(val); } diff --git a/src/OpenFOAM/db/IOstreams/token/tokenIO.C b/src/OpenFOAM/db/IOstreams/token/tokenIO.C index acf14b96fe..f451de1796 100644 --- a/src/OpenFOAM/db/IOstreams/token/tokenIO.C +++ b/src/OpenFOAM/db/IOstreams/token/tokenIO.C @@ -33,7 +33,7 @@ License Foam::token::token(Istream& is) : - type_(UNDEFINED) + type_(tokenType::UNDEFINED) { is.read(*this); } @@ -52,47 +52,47 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token& t) { switch (t.type_) { - case token::UNDEFINED: + case token::tokenType::UNDEFINED: os << "UNDEFINED"; WarningInFunction << "Undefined token" << endl; break; - case token::PUNCTUATION: + case token::tokenType::PUNCTUATION: os << t.punctuationToken_; break; - case token::WORD: + case token::tokenType::WORD: os << *t.wordTokenPtr_; break; - case token::STRING: - case token::VERBATIMSTRING: + case token::tokenType::STRING: + case token::tokenType::VERBATIMSTRING: os << *t.stringTokenPtr_; break; - case token::VARIABLE: + case token::tokenType::VARIABLE: // Behaviour differs according to stream type os.write(t); break; - case token::LABEL: + case token::tokenType::LABEL: os << t.labelToken_; break; - case token::FLOAT_SCALAR: + case token::tokenType::FLOAT_SCALAR: os << t.floatScalarToken_; break; - case token::DOUBLE_SCALAR: + case token::tokenType::DOUBLE_SCALAR: os << t.doubleScalarToken_; break; - case token::COMPOUND: + case token::tokenType::COMPOUND: os << *t.compoundTokenPtr_; break; - case token::ERROR: + case token::tokenType::ERROR: os << "ERROR"; WarningInFunction << "Error token" << endl; @@ -141,43 +141,43 @@ ostream& Foam::operator<<(ostream& os, const InfoProxy& ip) switch (t.type()) { - case token::UNDEFINED: + case token::tokenType::UNDEFINED: os << " an undefined token"; break; - case token::PUNCTUATION: + case token::tokenType::PUNCTUATION: os << " the punctuation token " << '\'' << t.pToken() << '\''; break; - case token::WORD: + case token::tokenType::WORD: os << " the word " << '\'' << t.wordToken() << '\''; break; - case token::STRING: + case token::tokenType::STRING: os << " the string " << t.stringToken(); break; - case token::VARIABLE: + case token::tokenType::VARIABLE: os << " the variable " << t.stringToken(); break; - case token::VERBATIMSTRING: + case token::tokenType::VERBATIMSTRING: os << " the verbatim string " << t.stringToken(); break; - case token::LABEL: + case token::tokenType::LABEL: os << " the label " << t.labelToken(); break; - case token::FLOAT_SCALAR: + case token::tokenType::FLOAT_SCALAR: os << " the floatScalar " << t.floatScalarToken(); break; - case token::DOUBLE_SCALAR: + case token::tokenType::DOUBLE_SCALAR: os << " the doubleScalar " << t.doubleScalarToken(); break; - case token::COMPOUND: + case token::tokenType::COMPOUND: { if (t.compoundToken().empty()) { @@ -192,7 +192,7 @@ ostream& Foam::operator<<(ostream& os, const InfoProxy& ip) } break; - case token::ERROR: + case token::tokenType::ERROR: os << " an error"; break; @@ -213,43 +213,43 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) switch (t.type()) { - case token::UNDEFINED: + case token::tokenType::UNDEFINED: os << " an undefined token"; break; - case token::PUNCTUATION: + case token::tokenType::PUNCTUATION: os << " the punctuation token " << '\'' << t.pToken() << '\''; break; - case token::WORD: + case token::tokenType::WORD: os << " the word " << '\'' << t.wordToken() << '\''; break; - case token::STRING: + case token::tokenType::STRING: os << " the string " << t.stringToken(); break; - case token::VARIABLE: + case token::tokenType::VARIABLE: os << " the variable " << t.stringToken(); break; - case token::VERBATIMSTRING: + case token::tokenType::VERBATIMSTRING: os << " the verbatim string " << t.stringToken(); break; - case token::LABEL: + case token::tokenType::LABEL: os << " the label " << t.labelToken(); break; - case token::FLOAT_SCALAR: + case token::tokenType::FLOAT_SCALAR: os << " the floatScalar " << t.floatScalarToken(); break; - case token::DOUBLE_SCALAR: + case token::tokenType::DOUBLE_SCALAR: os << " the doubleScalar " << t.doubleScalarToken(); break; - case token::COMPOUND: + case token::tokenType::COMPOUND: { if (t.compoundToken().empty()) { @@ -264,7 +264,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy& ip) } break; - case token::ERROR: + case token::tokenType::ERROR: os << " an error"; break; diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C index 9ffe101620..6167956e70 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -88,6 +88,18 @@ Foam::ITstream& Foam::dictionaryEntry::stream() const } +const Foam::dictionary* Foam::dictionaryEntry::dictPtr() const +{ + return this; +} + + +Foam::dictionary* Foam::dictionaryEntry::dictPtr() +{ + return this; +} + + const Foam::dictionary& Foam::dictionaryEntry::dict() const { return *this; diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H index c2d552b775..06976c789b 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,10 +52,8 @@ namespace Foam { // Forward declaration of friend functions and operators - class dictionaryEntry; - -Ostream& operator<<(Ostream& os, const dictionaryEntry& de); +Ostream& operator<<(Ostream& os, const dictionaryEntry& e); /*---------------------------------------------------------------------------*\ @@ -111,13 +109,13 @@ public: // Member functions - //- Return the dictionary name (scoped, e.g. dictA::dictB::dictC) + //- Return the scoped dictionary name (eg, dictA.dictB.dictC) const fileName& name() const { return dictionary::name(); } - //- Return the dictionary name (scoped, e.g. dictA::dictB::dictC) + //- Return the scoped dictionary name (eg, dictA.dictB.dictC) fileName& name() { return dictionary::name(); @@ -133,11 +131,12 @@ public: // calling this function generates a FatalError ITstream& stream() const; - //- Return true because this entry is a dictionary - bool isDict() const - { - return true; - } + + //- Return pointer to this dictionary + virtual const dictionary* dictPtr() const; + + //- Return non-const pointer to this dictionary + virtual dictionary* dictPtr(); //- Return dictionary const dictionary& dict() const; @@ -159,7 +158,7 @@ public: // Ostream operator - friend Ostream& operator<<(Ostream& os, const dictionaryEntry& de); + friend Ostream& operator<<(Ostream& os, const dictionaryEntry& e); }; diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C index 5a4feda30e..d2cdd07fd9 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C @@ -23,7 +23,6 @@ License \*---------------------------------------------------------------------------*/ -#include "keyType.H" #include "dictionaryEntry.H" #include "IOstreams.H" @@ -66,9 +65,9 @@ void Foam::dictionaryEntry::write(Ostream& os) const // * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryEntry& de) +Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryEntry& e) { - de.write(os); + e.write(os); return os; } diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C index 836add62f9..85e806ca47 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C @@ -25,7 +25,6 @@ License #include "dictionary.H" #include "IFstream.H" -#include "inputModeEntry.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -49,7 +48,7 @@ Foam::dictionary::dictionary(Istream& is) parent_(dictionary::null) { // Reset input mode as this is a "top-level" dictionary - functionEntries::inputModeEntry::clear(); + entry::resetInputMode(); read(is); } @@ -61,7 +60,7 @@ Foam::dictionary::dictionary(Istream& is, const bool keepHeader) parent_(dictionary::null) { // Reset input mode as this is a "top-level" dictionary - functionEntries::inputModeEntry::clear(); + entry::resetInputMode(); read(is, keepHeader); } @@ -130,7 +129,7 @@ bool Foam::dictionary::read(Istream& is) bool Foam::dictionary::substituteKeyword(const word& keyword, bool mergeEntry) { - const word varName = keyword(1, keyword.size()-1); + const word varName = keyword.substr(1); // Lookup the variable name in the given dictionary const entry* ePtr = lookupEntryPtr(varName, true, true); @@ -157,7 +156,7 @@ bool Foam::dictionary::substituteKeyword(const word& keyword, bool mergeEntry) Foam::Istream& Foam::operator>>(Istream& is, dictionary& dict) { // Reset input mode assuming this is a "top-level" dictionary - functionEntries::inputModeEntry::clear(); + entry::resetInputMode(); dict.clear(); dict.name() = is.name(); diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H index 389e79c7a3..2e575713b9 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -52,8 +52,7 @@ namespace Foam // Forward declaration of friend functions and operators class dictionaryListEntry; - -Ostream& operator<<(Ostream&, const dictionaryListEntry&); +Ostream& operator<<(Ostream& os, const dictionaryListEntry& e); /*---------------------------------------------------------------------------*\ @@ -66,9 +65,6 @@ class dictionaryListEntry { // Private Member Functions - //- Returns size of dictionary without FoamFile - static label realSize(const dictionary&); - //- Disallow bitwise copy dictionaryListEntry(const dictionaryListEntry&) = delete; @@ -78,13 +74,13 @@ public: // Constructors //- Construct from the parent dictionary and Istream - dictionaryListEntry(const dictionary& parentDict, Istream&); + dictionaryListEntry(const dictionary& parentDict, Istream& is); //- Construct as copy for the given parent dictionary dictionaryListEntry ( const dictionary& parentDict, - const dictionaryListEntry& + const dictionaryListEntry& dictEnt ); autoPtr clone(const dictionary& parentDict) const @@ -96,7 +92,7 @@ public: // Member functions //- Write - virtual void write(Ostream&) const; + virtual void write(Ostream& os) const; //- Return info proxy. // Used to print token information to a stream @@ -108,12 +104,12 @@ public: // Ostream operator - friend Ostream& operator<<(Ostream&, const dictionaryListEntry&); + friend Ostream& operator<<(Ostream& os, const dictionaryListEntry& e); }; template<> -Ostream& operator<<(Ostream&, const InfoProxy&); +Ostream& operator<<(Ostream& os, const InfoProxy& ip); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C index c368e68035..53399cc543 100644 --- a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C +++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C @@ -24,12 +24,12 @@ License \*---------------------------------------------------------------------------*/ #include "dictionaryListEntry.H" -#include "keyType.H" #include "IOstreams.H" -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // +// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // -Foam::label Foam::dictionaryListEntry::realSize(const dictionary& dict) +// File-scope: The dictionary size without the "FoamFile" entry +static Foam::label realSize(const Foam::dictionary& dict) { if (dict.size() < 1 || dict.first()->keyword() != "FoamFile") { @@ -127,9 +127,9 @@ void Foam::dictionaryListEntry::write(Ostream& os) const // * * * * * * * * * * * * * * Ostream operator * * * * * * * * * * * * * * // -Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& de) +Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& e) { - de.write(os); + e.write(os); return os; } diff --git a/src/OpenFOAM/db/dictionary/entry/entry.C b/src/OpenFOAM/db/dictionary/entry/entry.C index afb5a72522..81b88563b0 100644 --- a/src/OpenFOAM/db/dictionary/entry/entry.C +++ b/src/OpenFOAM/db/dictionary/entry/entry.C @@ -35,6 +35,17 @@ int Foam::entry::disableFunctionEntries ); +Foam::entry::inputMode Foam::entry::globalInputMode = inputMode::MERGE; + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +void Foam::entry::resetInputMode() +{ + globalInputMode = inputMode::MERGE; +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::entry::entry(const keyType& keyword) diff --git a/src/OpenFOAM/db/dictionary/entry/entry.H b/src/OpenFOAM/db/dictionary/entry/entry.H index 6bb08646a4..5b73b78c7d 100644 --- a/src/OpenFOAM/db/dictionary/entry/entry.H +++ b/src/OpenFOAM/db/dictionary/entry/entry.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -67,6 +67,24 @@ class entry : public IDLList::link { +public: + + // Enums/Typedefs + + //- The input mode options + enum class inputMode + { + MERGE, //!< Merge sub-dictionaries when possible + OVERWRITE, //!< Keep last entry. Silently remove previous ones + PROTECT, //!< Keep initial entry. Silently ignore subsequent ones + WARN, //!< Keep initial entry. Warn about subsequent ones. + ERROR, //!< FatalError for duplicate entries + GLOBAL //!< Use global value from #globalInputMode variable + }; + + +private: + // Private data //- Keyword of entry @@ -85,15 +103,20 @@ class entry ); //- Get the next valid keyword. - // Warn when an invalid token is encountered that is not an end-of-block or eof + // Warn when an invalid token is encountered that is not EOF or + // end-of-block // \return True if it is a valid keyType. static bool getKeyword(keyType& keyword, Istream& is); public: + //- Enable or disable use of function entries and variable expansions. static int disableFunctionEntries; + //- The current global input-mode. + static inputMode globalInputMode; + // Constructors @@ -115,11 +138,19 @@ public: virtual autoPtr clone() const; //- Construct from Istream and insert into dictionary - static bool New(dictionary& parentDict, Istream& is); + static bool New + ( + dictionary& parentDict, + Istream& is, + const inputMode inMode = inputMode::GLOBAL + ); //- Construct on freestore from Istream and return static autoPtr New(Istream& is); + //- Reset the #globalInputMode to %merge + static void resetInputMode(); + //- Destructor virtual ~entry() @@ -152,37 +183,54 @@ public: //- Return line number of last token in dictionary virtual label endLineNumber() const = 0; + //- Return true if this entry is a stream virtual bool isStream() const { return false; } - //- Return token stream if this entry is a primitive entry + //- Return token stream, if entry is a primitive entry virtual ITstream& stream() const = 0; + //- Return true if this entry is a dictionary virtual bool isDict() const { - return false; + return this->dictPtr(); } - //- Return dictionary if this entry is a dictionary + //- Return pointer to dictionary, if entry is a dictionary. + // Return nullptr if the entry is not a dictionary. + virtual const dictionary* dictPtr() const + { + return nullptr; + } + + //- Return non-const pointer to dictionary, if entry is a dictionary + // Return nullptr if the entry is not a dictionary. + virtual dictionary* dictPtr() + { + return nullptr; + } + + //- Return dictionary, if entry is a dictionary virtual const dictionary& dict() const = 0; - //- Return non-const access to dictionary if this entry is a dictionary + //- Return non-const access to dictionary, if entry is a dictionary virtual dictionary& dict() = 0; + //- Write - virtual void write(Ostream&) const = 0; + virtual void write(Ostream& os) const = 0; // Member operators - void operator=(const entry&); + void operator=(const entry& e); - bool operator==(const entry&) const; - bool operator!=(const entry&) const; + bool operator==(const entry& e) const; + bool operator!=(const entry& e) const; // Ostream operator diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C index e4a5a1a73b..b8a75380ab 100644 --- a/src/OpenFOAM/db/dictionary/entry/entryIO.C +++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C @@ -28,7 +28,6 @@ License #include "dictionaryEntry.H" #include "functionEntry.H" #include "includeEntry.H" -#include "inputModeEntry.H" #include "stringOps.H" #include "dictionaryListEntry.H" @@ -88,13 +87,13 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is) else { // Otherwise the token is invalid - cerr<< "--> FOAM Warning : " << std::endl + cerr<< "--> FOAM Warning :" << nl << " From function " - << FUNCTION_NAME << std::endl + << FUNCTION_NAME << nl << " in file " << __FILE__ - << " at line " << __LINE__ << std::endl - << " Reading " << is.name().c_str() << std::endl - << " found " << keyToken << std::endl + << " at line " << __LINE__ << nl + << " Reading " << is.name().c_str() << nl + << " found " << keyToken << nl << " expected either " << token::END_BLOCK << " or EOF" << std::endl; return false; @@ -102,8 +101,31 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is) } -bool Foam::entry::New(dictionary& parentDict, Istream& is) +bool Foam::entry::New +( + dictionary& parentDict, + Istream& is, + const entry::inputMode inMode +) { + // The inputMode for dealing with duplicate entries + const entry::inputMode mode = + ( + inMode == inputMode::GLOBAL + ? globalInputMode + : inMode + ); + + // If somehow the global itself is 'global' - this is a severe logic error. + if (mode == inputMode::GLOBAL) + { + FatalIOErrorInFunction + ( + is + ) << "Cannot use 'GLOBAL' as an inputMode" + << exit(FatalIOError); + } + is.fatalCheck(FUNCTION_NAME); keyType keyword; @@ -135,191 +157,201 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is) else { // Otherwise the token is invalid - cerr<< "--> FOAM Warning : " << std::endl + cerr<< "--> FOAM Warning :" << nl << " From function " - << FUNCTION_NAME << std::endl + << FUNCTION_NAME << nl << " in file " << __FILE__ - << " at line " << __LINE__ << std::endl - << " Reading " << is.name().c_str() << std::endl - << " found " << keyToken << std::endl + << " at line " << __LINE__ << nl + << " Reading " << is.name().c_str() << nl + << " found " << keyToken << nl << " expected either " << token::END_BLOCK << " or EOF" << std::endl; return false; } } - else // Keyword starts entry ... + else if (keyword[0] == '#') { - if (keyword[0] == '#') // ... Function entry + // Function entry + + if (disableFunctionEntries) { - if (disableFunctionEntries) + return parentDict.add + ( + new functionEntry + ( + keyword, + parentDict, + is + ), + false + ); + } + else + { + const word functionName(keyword.substr(1), false); + return functionEntry::execute(functionName, parentDict, is); + } + } + else if + ( + !disableFunctionEntries + && keyword[0] == '$' + ) + { + // Substitution entry + + token nextToken(is); + is.putBack(nextToken); + + if (keyword.size() > 2 && keyword[1] == token::BEGIN_BLOCK) + { + // Recursive substitution mode. + // Content between {} is replaced with expansion. + // Then let standard variable expansion deal with rest. + string expanded = keyword.substr(2, keyword.size()-3); + + // Substitute dictionary and environment variables. + // Do not allow empty substitutions. + stringOps::inplaceExpand(expanded, parentDict, true, false); + + // Restore the '$' prefix. + // Use replace since operator= is private + keyword.std::string::replace(1, keyword.size()-1, expanded); + } + + if (nextToken == token::BEGIN_BLOCK) + { + const word varName = keyword.substr(1); + + // Lookup the variable name in the given dictionary + const entry* ePtr = parentDict.lookupScopedEntryPtr + ( + varName, + true, + true + ); + + if (ePtr) { + // Read as primitiveEntry + const keyType newKeyword(ePtr->stream()); + return parentDict.add ( - new functionEntry - ( - keyword, - parentDict, - is - ), + new dictionaryEntry(newKeyword, parentDict, is), false ); } else - { - const word functionName(keyword.substr(1), false); - return functionEntry::execute(functionName, parentDict, is); - } - } - else if - ( - !disableFunctionEntries - && keyword[0] == '$' - ) // ... Substitution entry - { - token nextToken(is); - is.putBack(nextToken); - - if (keyword.size() > 2 && keyword[1] == token::BEGIN_BLOCK) - { - // Recursive substitution mode. - // Content between {} is replaced with expansion. - // Then let standard variable expansion deal with rest. - string expanded = keyword.substr(2, keyword.size()-3); - - // Substitute dictionary and environment variables. - // Do not allow empty substitutions. - stringOps::inplaceExpand(expanded, parentDict, true, false); - - // Restore the '$' prefix. Use replace since operator= is private - - keyword.std::string::replace(1, keyword.size()-1, expanded); - } - - if (nextToken == token::BEGIN_BLOCK) - { - const word varName = keyword.substr(1); - - // lookup the variable name in the given dictionary - const entry* ePtr = parentDict.lookupScopedEntryPtr - ( - varName, - true, - true - ); - - if (ePtr) - { - // Read as primitiveEntry - const keyType newKeyword(ePtr->stream()); - - return parentDict.add - ( - new dictionaryEntry(newKeyword, parentDict, is), - false - ); - } - else - { - FatalIOErrorInFunction(is) - << "Attempt to use undefined variable " << varName - << " as keyword" - << exit(FatalIOError); - return false; - } - } - else - { - // Deal with duplicate entries (at least partially) - const bool mergeEntry = - ( - functionEntries::inputModeEntry::merge() - || functionEntries::inputModeEntry::overwrite() - ); - - parentDict.substituteScopedKeyword(keyword, mergeEntry); - } - - return true; - } - else // ... Data entries - { - token nextToken(is); - is.putBack(nextToken); - - if (nextToken == token::END_LIST) { FatalIOErrorInFunction(is) - << "Unexpected token encountered for " - << keyword << " - " << nextToken.info() + << "Attempt to use undefined variable " << varName + << " as keyword" << exit(FatalIOError); return false; } - - // Deal with duplicate entries - bool mergeEntry = false; - - // See (using exact match) if entry already present - entry* existingPtr = parentDict.lookupEntryPtr + } + else + { + // Deal with duplicate entries (at least partially) + const bool mergeEntry = ( - keyword, - false, - false + mode == inputMode::MERGE + || mode == inputMode::OVERWRITE ); - if (existingPtr) - { - if (functionEntries::inputModeEntry::merge()) - { - mergeEntry = true; - } - else if (functionEntries::inputModeEntry::overwrite()) - { - // clear dictionary so merge acts like overwrite - if (existingPtr->isDict()) - { - existingPtr->dict().clear(); - } - mergeEntry = true; - } - else if (functionEntries::inputModeEntry::protect()) - { - // read and discard the entry - if (nextToken == token::BEGIN_BLOCK) - { - dictionaryEntry dummy(keyword, parentDict, is); - } - else - { - primitiveEntry dummy(keyword, parentDict, is); - } - return true; - } - else if (functionEntries::inputModeEntry::error()) - { - FatalIOErrorInFunction(is) - << "duplicate entry: " << keyword - << exit(FatalIOError); + parentDict.substituteScopedKeyword(keyword, mergeEntry); + } - return false; - } - } + return true; + } + else + { + // Normal entry - if (nextToken == token::BEGIN_BLOCK) + token nextToken(is); + is.putBack(nextToken); + + if (nextToken == token::END_LIST) + { + FatalIOErrorInFunction(is) + << "Unexpected token encountered for " + << keyword << " - " << nextToken.info() + << exit(FatalIOError); + return false; + } + + // How to manage duplicate entries + bool mergeEntry = false; + + // See (using exact match) if entry already present + entry* existingPtr = parentDict.lookupEntryPtr + ( + keyword, + false, + false + ); + + if (existingPtr) + { + if (mode == inputMode::MERGE) { - return parentDict.add - ( - new dictionaryEntry(keyword, parentDict, is), - mergeEntry - ); + mergeEntry = true; } - else + else if (mode == inputMode::OVERWRITE) { - return parentDict.add - ( - new primitiveEntry(keyword, parentDict, is), - mergeEntry - ); + // Clear existing dictionary so merge acts like overwrite + if (existingPtr->isDict()) + { + existingPtr->dict().clear(); + } + mergeEntry = true; } + else if (mode == inputMode::PROTECT) + { + // Read and discard the entry. + // Disable function/variable expansion to avoid side-effects + const int oldFlag = entry::disableFunctionEntries; + entry::disableFunctionEntries = 1; + + if (nextToken == token::BEGIN_BLOCK) + { + dictionaryEntry dummy("dummy", parentDict, is); + } + else + { + primitiveEntry dummy("dummy", parentDict, is); + } + + entry::disableFunctionEntries = oldFlag; + return true; + } + else if (mode == inputMode::ERROR) + { + FatalIOErrorInFunction(is) + << "duplicate entry: " << keyword + << exit(FatalIOError); + + return false; + } + } + + + if (nextToken == token::BEGIN_BLOCK) + { + return parentDict.add + ( + new dictionaryEntry(keyword, parentDict, is), + mergeEntry + ); + } + else + { + return parentDict.add + ( + new primitiveEntry(keyword, parentDict, is), + mergeEntry + ); } } } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C index bc5a1e65ea..a7e2e2c949 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C @@ -35,22 +35,22 @@ namespace Foam { namespace functionEntries { - defineTypeNameAndDebug(calcEntry, 0); - - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, calcEntry, execute, - dictionaryIstream + dictionaryIstream, + calc ); - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, calcEntry, execute, - primitiveEntryIstream + primitiveEntryIstream, + calc ); } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H index e1083db42a..769b33e9d3 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H @@ -70,34 +70,18 @@ class calcEntry : public functionEntry { - - // Private Member Functions - - //- Disallow default bitwise copy construct - calcEntry(const calcEntry&); - - //- Disallow default bitwise assignment - void operator=(const calcEntry&); - - public: - //- Runtime type information - ClassName("calc"); + //- Execute in a primitiveEntry context + static bool execute + ( + const dictionary& parentDict, + primitiveEntry& thisEntry, + Istream& is + ); - - // Member Functions - - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream&); - - //- Execute the functionEntry in a primitiveEntry context - static bool execute - ( - const dictionary& parentDict, - primitiveEntry&, - Istream& - ); + //- Execute in a sub-dict context + static bool execute(dictionary& parentDict, Istream& is); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C index 66e510a38f..2afbb71831 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C @@ -38,22 +38,23 @@ namespace functionEntries { defineTypeNameAndDebug(codeStream, 0); - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, codeStream, execute, - dictionaryIstream + dictionaryIstream, + codeStream ); - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, codeStream, execute, - primitiveEntryIstream + primitiveEntryIstream, + codeStream ); - } } @@ -175,7 +176,7 @@ Foam::functionEntries::codeStream::getFunction // create library if required if (!lib) { - bool create = + const bool create = Pstream::master() || (regIOobject::fileModificationSkew <= 0); // not NFS diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H index eeb8ce9b2e..172e84519b 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H @@ -118,10 +118,8 @@ class codeStream //- Interpreter function type typedef void (*streamingFunctionType)(Ostream&, const dictionary&); - // Private Member Functions - //- Helper function: parent (of parent etc.) of dictionary up to the top - static const dictionary& topDict(const dictionary&); + // Private Member Functions //- Helper function: access IOobject for master-only-reading // functionality @@ -139,10 +137,10 @@ class codeStream //- Disallow default bitwise copy construct - codeStream(const codeStream&); + codeStream(const codeStream&) = delete; //- Disallow default bitwise assignment - void operator=(const codeStream&); + void operator=(const codeStream&) = delete; public: @@ -165,14 +163,14 @@ public: // Member Functions //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream&); + static bool execute(dictionary& parentDict, Istream& is); //- Execute the functionEntry in a primitiveEntry context static bool execute ( const dictionary& parentDict, - primitiveEntry&, - Istream& + primitiveEntry& entry, + Istream& is ); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H index 0c9bd6604e..4d118c79ff 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H @@ -58,7 +58,7 @@ namespace Foam class dictionary; /*---------------------------------------------------------------------------*\ - Class functionEntry Declaration + Class functionEntry Declaration \*---------------------------------------------------------------------------*/ class functionEntry @@ -71,10 +71,10 @@ class functionEntry static token readLine(const word& key, Istream& is); //- Disallow default bitwise copy construct - functionEntry(const functionEntry&); + functionEntry(const functionEntry&) = delete; //- Disallow default bitwise assignment - void operator=(const functionEntry&); + void operator=(const functionEntry&) = delete; public: @@ -82,7 +82,7 @@ public: // Constructors //- Construct from keyword, parent dictionary and Istream - functionEntry(const word&, const dictionary&, Istream&); + functionEntry(const word& key, const dictionary& dict, Istream& is); // Member Function Selectors @@ -105,7 +105,7 @@ public: ( const word& functionName, dictionary& parentDict, - Istream& + Istream& is ); declareMemberFunctionSelectionTable @@ -127,12 +127,12 @@ public: ( const word& functionName, const dictionary& parentDict, - primitiveEntry&, - Istream& + primitiveEntry& entry, + Istream& is ); //- Write - virtual void write(Ostream&) const; + virtual void write(Ostream& os) const; }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C index 42e1083c17..9f25f28e04 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C @@ -31,15 +31,6 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::word Foam::functionEntries::includeEntry::typeName -( - Foam::functionEntries::includeEntry::typeName_() -); - -// Don't lookup the debug switch here as the debug switch dictionary -// might include includeEntry -int Foam::functionEntries::includeEntry::debug(0); - bool Foam::functionEntries::includeEntry::log(false); @@ -47,50 +38,50 @@ namespace Foam { namespace functionEntries { - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeEntry, execute, - dictionaryIstream + dictionaryIstream, + include ); - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeEntry, execute, - primitiveEntryIstream + primitiveEntryIstream, + include ); } } // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // -Foam::fileName Foam::functionEntries::includeEntry::includeFileName +Foam::fileName Foam::functionEntries::includeEntry::resolveFile ( Istream& is, const dictionary& dict ) { fileName fName(is); - // Substitute dictionary and environment variables. Allow empty - // substitutions. + // Substitute dictionary and environment variables. + // Allow empty substitutions. stringOps::inplaceExpand(fName, dict, true, true); if (fName.empty() || fName.isAbsolute()) { return fName; } - else - { - // relative name - return fileName(is.name()).path()/fName; - } + + // Relative name + return fileName(is.name()).path()/fName; } -Foam::fileName Foam::functionEntries::includeEntry::includeFileName +Foam::fileName Foam::functionEntries::includeEntry::resolveFile ( const fileName& dir, const fileName& f, @@ -98,19 +89,17 @@ Foam::fileName Foam::functionEntries::includeEntry::includeFileName ) { fileName fName(f); - // Substitute dictionary and environment variables. Allow empty - // substitutions. + // Substitute dictionary and environment variables. + // Allow empty substitutions. stringOps::inplaceExpand(fName, dict, true, true); if (fName.empty() || fName.isAbsolute()) { return fName; } - else - { - // relative name - return dir/fName; - } + + // Relative name + return dir/fName; } @@ -122,11 +111,8 @@ bool Foam::functionEntries::includeEntry::execute Istream& is ) { - const fileName rawFName(is); - const fileName fName - ( - includeFileName(is.name().path(), rawFName, parentDict) - ); + const fileName rawName(is); + const fileName fName = resolveFile(is.name().path(), rawName, parentDict); // Read contents of file into parentDict @@ -147,7 +133,7 @@ bool Foam::functionEntries::includeEntry::execute ( dynamic_cast(top) ); - //Info<< rio.name() << " : adding depenency on included file " + //Info<< rio.name() << " : adding dependency on included file " // << fName << endl; rio.addWatch(fName); @@ -162,7 +148,7 @@ bool Foam::functionEntries::includeEntry::execute ( is ) << "Cannot open include file " - << (ifs.name().size() ? ifs.name() : rawFName) + << (ifs.name().size() ? ifs.name() : rawName) << " while reading dictionary " << parentDict.name() << exit(FatalIOError); @@ -178,12 +164,8 @@ bool Foam::functionEntries::includeEntry::execute Istream& is ) { - const fileName rawFName(is); - const fileName fName - ( - includeFileName(is.name().path(), rawFName, parentDict) - ); - + const fileName rawName(is); + const fileName fName = resolveFile(is.name().path(), rawName, parentDict); // Read contents of file into parentDict IFstream ifs(fName); @@ -203,7 +185,7 @@ bool Foam::functionEntries::includeEntry::execute ( dynamic_cast(top) ); - //Info<< rio.name() << " : adding depenency on included file " + //Info<< rio.name() << " : adding dependency on included file " // << fName << endl; rio.addWatch(fName); @@ -218,7 +200,7 @@ bool Foam::functionEntries::includeEntry::execute ( is ) << "Cannot open include file " - << (ifs.name().size() ? ifs.name() : rawFName) + << (ifs.name().size() ? ifs.name() : rawName) << " while reading dictionary " << parentDict.name() << exit(FatalIOError); diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H index b26236f77c..bbdc122017 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H @@ -64,52 +64,40 @@ class includeEntry : public functionEntry { - // Private Member Functions - - //- Disallow default bitwise copy construct - includeEntry(const includeEntry&); - - //- Disallow default bitwise assignment - void operator=(const includeEntry&); - protected: // Protected Member Functions //- Read the include fileName from Istream, expand and return - static fileName includeFileName(Istream&, const dictionary&); + static fileName resolveFile(Istream& is, const dictionary& dict); //- Expand include fileName and return - static fileName includeFileName + static fileName resolveFile ( const fileName& dir, - const fileName&, - const dictionary& + const fileName& f, + const dictionary& dict ); public: // Static data members - //- Report which file is included to stdout + //- Report to stdout which file is included static bool log; - //- Runtime type information - ClassName("include"); - - // Member Functions - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream&); + //- Include file in a sub-dict context + static bool execute(dictionary& parentDict, Istream& is); - //- Execute the functionEntry in a primitiveEntry context + //- Include file in a primitiveEntry context static bool execute ( const dictionary& parentDict, - primitiveEntry&, - Istream& + primitiveEntry& entry, + Istream& is ); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C index 3598ab5441..c9e12d0e12 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C @@ -31,15 +31,6 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::word Foam::functionEntries::includeEtcEntry::typeName -( - Foam::functionEntries::includeEtcEntry::typeName_() -); - -// Don't lookup the debug switch here as the debug switch dictionary -// might include includeEtcEntry -int Foam::functionEntries::includeEtcEntry::debug(0); - bool Foam::functionEntries::includeEtcEntry::log(false); @@ -47,27 +38,29 @@ namespace Foam { namespace functionEntries { - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeEtcEntry, execute, - dictionaryIstream + dictionaryIstream, + includeEtc ); - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeEtcEntry, execute, - primitiveEntryIstream + primitiveEntryIstream, + includeEtc ); } } // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // -Foam::fileName Foam::functionEntries::includeEtcEntry::includeEtcFileName +Foam::fileName Foam::functionEntries::includeEtcEntry::resolveFile ( const fileName& f, const dictionary& dict @@ -83,11 +76,9 @@ Foam::fileName Foam::functionEntries::includeEtcEntry::includeEtcFileName { return fName; } - else - { - // Search the etc directories for the file - return findEtcFile(fName); - } + + // Search the etc directories for the file + return Foam::findEtcFile(fName); } @@ -99,11 +90,8 @@ bool Foam::functionEntries::includeEtcEntry::execute Istream& is ) { - const fileName rawFName(is); - const fileName fName - ( - includeEtcFileName(rawFName, parentDict) - ); + const fileName rawName(is); + const fileName fName(resolveFile(rawName, parentDict)); IFstream ifs(fName); if (ifs) @@ -121,7 +109,7 @@ bool Foam::functionEntries::includeEtcEntry::execute ( is ) << "Cannot open etc file " - << (ifs.name().size() ? ifs.name() : rawFName) + << (ifs.name().size() ? ifs.name() : rawName) << " while reading dictionary " << parentDict.name() << exit(FatalIOError); @@ -137,11 +125,8 @@ bool Foam::functionEntries::includeEtcEntry::execute Istream& is ) { - const fileName rawFName(is); - const fileName fName - ( - includeEtcFileName(rawFName, parentDict) - ); + const fileName rawName(is); + const fileName fName(resolveFile(rawName, parentDict)); IFstream ifs(fName); if (ifs) @@ -159,7 +144,7 @@ bool Foam::functionEntries::includeEtcEntry::execute ( is ) << "Cannot open etc file " - << (ifs.name().size() ? ifs.name() : rawFName) + << (ifs.name().size() ? ifs.name() : rawName) << " while reading dictionary " << parentDict.name() << exit(FatalIOError); diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H index b58e905b5c..4920ff7db0 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H @@ -79,45 +79,29 @@ class includeEtcEntry : public functionEntry { - // Private Member Functions - - //- Disallow default bitwise copy construct - includeEtcEntry(const includeEtcEntry&); - - //- Disallow default bitwise assignment - void operator=(const includeEtcEntry&); - - //- Expand include fileName and return - static fileName includeEtcFileName - ( - const fileName&, - const dictionary& - ); + //- Expand include fileName and return + static fileName resolveFile(const fileName& f, const dictionary& dict); public: // Static data members - //- Report which file is included to stdout + //- Report to stdout which file is included static bool log; - //- Runtime type information - ClassName("includeEtc"); - - // Member Functions - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream&); + //- Include file in a sub-dict context + static bool execute(dictionary& parentDict, Istream& is); - //- Execute the functionEntry in a primitiveEntry context + //- Include file in a primitiveEntry context static bool execute ( const dictionary& parentDict, - primitiveEntry&, - Istream& + primitiveEntry& entry, + Istream& is ); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C index 79644653a9..288c188904 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C @@ -33,14 +33,13 @@ namespace Foam { namespace functionEntries { - defineTypeNameAndDebug(includeFuncEntry, 0); - - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeFuncEntry, execute, - dictionaryIstream + dictionaryIstream, + includeFunc ); } } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H index f5eae2e556..08ac1f5509 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H @@ -83,17 +83,10 @@ class includeFuncEntry : public functionEntry { - public: - //- Runtime type information - ClassName("includeFunc"); - - - // Member Functions - - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream&); + //- Run function in a sub-dict context + static bool execute(dictionary& parentDict, Istream& is); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C index 59b4e443b8..369e3b925b 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C @@ -31,33 +31,26 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::word Foam::functionEntries::includeIfPresentEntry::typeName -( - Foam::functionEntries::includeIfPresentEntry::typeName_() -); - -// Don't lookup the debug switch here as the debug switch dictionary -// might include includeIfPresentEntry -int Foam::functionEntries::includeIfPresentEntry::debug(0); - namespace Foam { namespace functionEntries { - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeIfPresentEntry, execute, - dictionaryIstream + dictionaryIstream, + includeIfPresent ); - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, includeIfPresentEntry, execute, - primitiveEntryIstream + primitiveEntryIstream, + includeIfPresent ); } } @@ -70,7 +63,7 @@ bool Foam::functionEntries::includeIfPresentEntry::execute Istream& is ) { - const fileName fName(includeFileName(is, parentDict)); + const fileName fName(resolveFile(is, parentDict)); IFstream ifs(fName); if (ifs) @@ -105,7 +98,7 @@ bool Foam::functionEntries::includeIfPresentEntry::execute Istream& is ) { - const fileName fName(includeFileName(is, parentDict)); + const fileName fName(resolveFile(is, parentDict)); IFstream ifs(fName); if (ifs) diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H index 4c217e5d1f..a6d581e608 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H @@ -58,32 +58,18 @@ class includeIfPresentEntry : public includeEntry { - // Private Member Functions - - //- Disallow default bitwise copy construct - includeIfPresentEntry(const includeIfPresentEntry&); - - //- Disallow default bitwise assignment - void operator=(const includeIfPresentEntry&); - public: - //- Runtime type information - ClassName("includeIfPresent"); + //- Include (if present) in a sub-dict context + static bool execute(dictionary& parentDict, Istream& is); - - // Member Functions - - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream&); - - //- Execute the functionEntry in a primitiveEntry context - static bool execute - ( - const dictionary& parentDict, - primitiveEntry&, - Istream& - ); + //- Include (if present) in a primitiveEntry context + static bool execute + ( + const dictionary& parentDict, + primitiveEntry& entry, + Istream& is + ); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C new file mode 100644 index 0000000000..bdd92de36e --- /dev/null +++ b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C @@ -0,0 +1,93 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "inputMode.H" +#include "dictionary.H" +#include "addToMemberFunctionSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace functionEntries +{ + addNamedToMemberFunctionSelectionTable + ( + functionEntry, + inputMode, + execute, + dictionaryIstream, + inputMode + ); +} +} + + +const Foam::Enum +< + Foam::entry::inputMode +> +Foam::functionEntries::inputMode::selectableNames +{ + { entry::inputMode::MERGE, "merge" }, + { entry::inputMode::OVERWRITE, "overwrite" }, + { entry::inputMode::PROTECT, "protect" }, + { entry::inputMode::WARN, "warn" }, + { entry::inputMode::ERROR, "error" }, + // Aliases + { entry::inputMode::MERGE, "default" }, +}; + + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +bool Foam::functionEntries::inputMode::execute +( + dictionary& unused, + Istream& is +) +{ + const word modeName(is); + + // Behaviour like Enum lookupOrFailsafe() + if (selectableNames.hasEnum(modeName)) + { + entry::globalInputMode = selectableNames[modeName]; + } + else + { + WarningInFunction + << "Unsupported inputMode '" << modeName + << "' ... defaulting to 'merge'" + << endl; + + entry::resetInputMode(); + } + + return true; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.H similarity index 59% rename from src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H rename to src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.H index 66c98243ad..c670d9230d 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -22,11 +22,11 @@ License along with OpenFOAM. If not, see . Class - Foam::functionEntries::inputModeEntry + Foam::functionEntries::inputMode Description - Specify the input mode when reading dictionaries, expects - a single word to follow. + Specify the global input mode when reading further dictionaries, + expects a single word to follow. An example of \c \#inputMode directive: \verbatim @@ -47,17 +47,17 @@ Description - \par default The default treatment - currently identical to \b merge. - Note that the clear() method resets to the default mode (merge). - SourceFiles - inputModeEntry.C + inputMode.C \*---------------------------------------------------------------------------*/ -#ifndef inputModeEntry_H -#define inputModeEntry_H +#ifndef inputMode_H +#define inputMode_H +#include "entry.H" #include "functionEntry.H" +#include "Enum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -67,64 +67,20 @@ namespace functionEntries { /*---------------------------------------------------------------------------*\ - Class inputModeEntry Declaration + Class inputMode Declaration \*---------------------------------------------------------------------------*/ -class inputModeEntry +class inputMode : public functionEntry { - //- The input mode options - enum inputMode - { - MERGE, - OVERWRITE, - PROTECT, - WARN, - ERROR - }; - - //- The current input mode - static inputMode mode_; - - - // Private Member Functions - - //- Read the mode as a word and set enum appropriately - static void setMode(Istream& is); - - //- Disallow default bitwise copy construct - inputModeEntry(const inputModeEntry&) = delete; - - //- Disallow default bitwise assignment - void operator=(const inputModeEntry&) = delete; - - public: - //- Runtime type information - ClassName("inputMode"); + //- Text representations of the selectable input modes + static const Enum selectableNames; - - // Member Functions - - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream& is); - - //- Reset the inputMode to %default (ie, %merge) - static void clear(); - - //- Return true if the inputMode is %merge - static bool merge(); - - //- Return true if the inputMode is %overwrite - static bool overwrite(); - - //- Return true if the inputMode is %protect - static bool protect(); - - //- Return true if the inputMode is %error - static bool error(); + //- Change the global input-mode. + static bool execute(dictionary& unused, Istream& is); }; diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.C deleted file mode 100644 index fbb6787ca1..0000000000 --- a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.C +++ /dev/null @@ -1,138 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "inputModeEntry.H" -#include "dictionary.H" -#include "addToMemberFunctionSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -const Foam::word Foam::functionEntries::inputModeEntry::typeName -( - Foam::functionEntries::inputModeEntry::typeName_() -); - -// Don't lookup the debug switch here as the debug switch dictionary -// might include inputModeEntries -int Foam::functionEntries::inputModeEntry::debug(0); - -Foam::functionEntries::inputModeEntry::inputMode - Foam::functionEntries::inputModeEntry::mode_(MERGE); - -namespace Foam -{ -namespace functionEntries -{ - addToMemberFunctionSelectionTable - ( - functionEntry, - inputModeEntry, - execute, - dictionaryIstream - ); -} -} - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -// we could combine this into execute() directly, but leave it here for now -void Foam::functionEntries::inputModeEntry::setMode(Istream& is) -{ - clear(); - - const word mode(is); - if (mode == "merge" || mode == "default") - { - mode_ = MERGE; - } - else if (mode == "overwrite") - { - mode_ = OVERWRITE; - } - else if (mode == "protect") - { - mode_ = PROTECT; - } - else if (mode == "warn") - { - mode_ = WARN; - } - else if (mode == "error") - { - mode_ = ERROR; - } - else - { - WarningInFunction - << "unsupported input mode '" << mode - << "' ... defaulting to 'merge'" - << endl; - } -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -bool Foam::functionEntries::inputModeEntry::execute -( - dictionary& unused, - Istream& is -) -{ - setMode(is); - return true; -} - - -void Foam::functionEntries::inputModeEntry::clear() -{ - mode_ = MERGE; -} - - -bool Foam::functionEntries::inputModeEntry::merge() -{ - return mode_ == MERGE; -} - - -bool Foam::functionEntries::inputModeEntry::overwrite() -{ - return mode_ == OVERWRITE; -} - - -bool Foam::functionEntries::inputModeEntry::protect() -{ - return mode_ == PROTECT; -} - -bool Foam::functionEntries::inputModeEntry::error() -{ - return mode_ == ERROR; -} - - -// ************************************************************************* // diff --git a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C index e43c1f31f3..a0c413edd8 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C +++ b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C @@ -31,25 +31,17 @@ License // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -const Foam::word Foam::functionEntries::removeEntry::typeName -( - Foam::functionEntries::removeEntry::typeName_() -); - -// Don't lookup the debug switch here as the debug switch dictionary -// might include removeEntry -int Foam::functionEntries::removeEntry::debug(0); - namespace Foam { namespace functionEntries { - addToMemberFunctionSelectionTable + addNamedToMemberFunctionSelectionTable ( functionEntry, removeEntry, execute, - dictionaryIstream + dictionaryIstream, + remove ); } } diff --git a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H index 8508141f64..5e8fbdd836 100644 --- a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H +++ b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H @@ -64,25 +64,10 @@ class removeEntry : public functionEntry { - // Private Member Functions - - //- Disallow default bitwise copy construct - removeEntry(const removeEntry&) = delete; - - //- Disallow default bitwise assignment - void operator=(const removeEntry&) = delete; - - public: - //- Runtime type information - ClassName("remove"); - - - // Member Functions - - //- Execute the functionEntry in a sub-dict context - static bool execute(dictionary& parentDict, Istream& is); + //- Remove entries from the current sub-dict context + static bool execute(dictionary& parentDict, Istream& is); }; diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C index b36c7d4770..37cc203083 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C @@ -32,9 +32,9 @@ License void Foam::primitiveEntry::append(const UList& varTokens) { - forAll(varTokens, i) + for (const token& tok : varTokens) { - newElmt(tokenIndex()++) = varTokens[i]; + newElmt(tokenIndex()++) = tok; } } diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H index b5cebed502..38e9412a8d 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H @@ -160,7 +160,7 @@ public: return true; } - //- Return token stream if this entry is a primitive entry + //- Return token stream for this primitive entry ITstream& stream() const; //- This entry is not a dictionary, diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C index 1b9870347b..6a040941e7 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C @@ -227,10 +227,16 @@ void Foam::primitiveEntry::write(Ostream& os, const bool contentsOnly) const os.writeKeyword(keyword()); } - for (label i=0; i= 0 && ioErr.ioEndLineNumber() >= 0) + if (err.ioStartLineNumber() >= 0 && err.ioEndLineNumber() >= 0) { - os << " from line " << ioErr.ioStartLineNumber() - << " to line " << ioErr.ioEndLineNumber() << '.'; + os << " from line " << err.ioStartLineNumber() + << " to line " << err.ioEndLineNumber() << '.'; } - else if (ioErr.ioStartLineNumber() >= 0) + else if (err.ioStartLineNumber() >= 0) { - os << " at line " << ioErr.ioStartLineNumber() << '.'; + os << " at line " << err.ioStartLineNumber() << '.'; } - if (IOerror::level >= 2 && ioErr.sourceFileLineNumber()) + if (IOerror::level >= 2 && err.sourceFileLineNumber()) { - os << endl << endl - << " From function " << ioErr.functionName().c_str() << endl - << " in file " << ioErr.sourceFileName().c_str() - << " at line " << ioErr.sourceFileLineNumber() << '.'; + os << nl << nl + << " From function " << err.functionName().c_str() << endl + << " in file " << err.sourceFileName().c_str() + << " at line " << err.sourceFileLineNumber() << '.'; } } @@ -292,4 +298,5 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr) Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR: "); + // ************************************************************************* // diff --git a/src/OpenFOAM/db/error/error.C b/src/OpenFOAM/db/error/error.C index e0dbff97d8..cc0907d222 100644 --- a/src/OpenFOAM/db/error/error.C +++ b/src/OpenFOAM/db/error/error.C @@ -31,7 +31,8 @@ License #include "Pstream.H" #include "OSspecific.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::error::error(const string& title) : @@ -88,12 +89,16 @@ Foam::error::error(const error& err) } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + Foam::error::~error() throw() { delete messageStreamPtr_; } +// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // + Foam::OSstream& Foam::error::operator() ( const char* functionName, @@ -156,6 +161,8 @@ Foam::error::operator Foam::dictionary() const } +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + Foam::string Foam::error::message() const { return messageStreamPtr_->str(); @@ -249,18 +256,20 @@ void Foam::error::abort() } -Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr) -{ - os << endl - << fErr.title().c_str() << endl - << fErr.message().c_str(); +// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - if (error::level >= 2 && fErr.sourceFileLineNumber()) +Foam::Ostream& Foam::operator<<(Ostream& os, const error& err) +{ + os << nl + << err.title().c_str() << endl + << err.message().c_str(); + + if (error::level >= 2 && err.sourceFileLineNumber()) { - os << endl << endl - << " From function " << fErr.functionName().c_str() << endl - << " in file " << fErr.sourceFileName().c_str() - << " at line " << fErr.sourceFileLineNumber() << '.'; + os << nl << nl + << " From function " << err.functionName().c_str() << endl + << " in file " << err.sourceFileName().c_str() + << " at line " << err.sourceFileLineNumber() << '.'; } return os; @@ -272,4 +281,5 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr) Foam::error Foam::FatalError("--> FOAM FATAL ERROR: "); + // ************************************************************************* // diff --git a/src/OpenFOAM/db/error/error.H b/src/OpenFOAM/db/error/error.H index df42bf1ce0..961bd3cd4d 100644 --- a/src/OpenFOAM/db/error/error.H +++ b/src/OpenFOAM/db/error/error.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,7 +30,7 @@ Description The error class is globally instantiated with a title string. Errors, messages and other data are piped to the messageStream class in the - standard manner. Manipulators are supplied for exit and abort which may + standard manner. Manipulators are supplied for exit and abort that may terminate the program or throw an exception depending on whether the exception handling has been switched on (off by default). @@ -57,7 +57,7 @@ namespace Foam // Forward declaration of friend functions and operators class error; -Ostream& operator<<(Ostream&, const error&); +Ostream& operator<<(Ostream& os, const error& err); /*---------------------------------------------------------------------------*\ @@ -90,10 +90,10 @@ public: error(const string& title); //- Construct from dictionary - error(const dictionary&); + error(const dictionary& errDict); //- Construct as copy - error(const error&); + error(const error& err); //- Destructor @@ -104,29 +104,48 @@ public: string message() const; - const string& functionName() const + inline const string& functionName() const { return functionName_; } - const string& sourceFileName() const + inline const string& sourceFileName() const { return sourceFileName_; } - label sourceFileLineNumber() const + inline label sourceFileLineNumber() const { return sourceFileLineNumber_; } - void throwExceptions() + //- Return the current exception throwing (on or off) + inline bool throwing() const { - throwExceptions_ = true; + return throwExceptions_; } - void dontThrowExceptions() + //- Activate/deactivate exception throwing + // \return the previous throwing state + inline bool throwExceptions(bool doThrow) { - throwExceptions_ = false; + const bool prev = throwExceptions_; + throwExceptions_ = doThrow; + return prev; + } + + //- Activate exception throwing + // \return the previous throwing state + inline bool throwExceptions() + { + return throwExceptions(true); + } + + //- Deactivate exception throwing + // \return the previous throwing state + inline bool dontThrowExceptions() + { + return throwExceptions(false); } //- Convert to OSstream @@ -157,16 +176,16 @@ public: return operator OSstream&(); } - //- Create and return a dictionary + //- Create and return a dictionary representation of the error operator dictionary() const; //- Helper function to print a stack (if OpenFOAM IO not yet // initialised) - static void safePrintStack(std::ostream&); + static void safePrintStack(std::ostream& os); //- Helper function to print a stack - static void printStack(Ostream&); + static void printStack(Ostream& os); //- Exit : can be called for any error to exit program. // Prints stack before exiting. @@ -179,13 +198,13 @@ public: // Ostream operator - friend Ostream& operator<<(Ostream&, const error&); + friend Ostream& operator<<(Ostream& os, const error& err); }; // Forward declaration of friend functions and operators class IOerror; -Ostream& operator<<(Ostream&, const IOerror&); +Ostream& operator<<(Ostream& os, const IOerror& err); /*---------------------------------------------------------------------------*\ @@ -212,7 +231,7 @@ public: IOerror(const string& title); //- Construct from dictionary - IOerror(const dictionary&); + IOerror(const dictionary& errDict); //- Destructor @@ -221,17 +240,17 @@ public: // Member functions - const string& ioFileName() const + inline const string& ioFileName() const { return ioFileName_; } - label ioStartLineNumber() const + inline label ioStartLineNumber() const { return ioStartLineNumber_; } - label ioEndLineNumber() const + inline label ioEndLineNumber() const { return ioEndLineNumber_; } @@ -279,7 +298,7 @@ public: const string& msg ); - //- Create and return a dictionary + //- Create and return a dictionary representation of the error operator dictionary() const; @@ -292,7 +311,7 @@ public: // Ostream operator - friend Ostream& operator<<(Ostream&, const IOerror&); + friend Ostream& operator<<(Ostream& os, const IOerror& err); }; diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C index 661d249602..c0b9e7219b 100644 --- a/src/OpenFOAM/db/error/messageStream.C +++ b/src/OpenFOAM/db/error/messageStream.C @@ -90,8 +90,8 @@ Foam::OSstream& Foam::messageStream::operator() { OSstream& os = operator OSstream&(); - os << endl - << " From function " << functionName << endl + os << nl + << " From function " << functionName << nl << " in file " << sourceFileName << " at line " << sourceFileLineNumber << endl << " "; @@ -194,7 +194,7 @@ Foam::messageStream::operator Foam::OSstream&() { if (level) { - bool collect = (severity_ == INFO || severity_ == WARNING); + const bool collect = (severity_ == INFO || severity_ == WARNING); // Report the error if (!Pstream::master() && collect) diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C index 4326acf5be..fea664c741 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C @@ -210,7 +210,7 @@ bool Foam::functionObjectList::readFunctionObject { if (argLevel == 0) { - funcName = funcNameArgs(start, i - start); + funcName = funcNameArgs.substr(start, i - start); start = i+1; } ++argLevel; @@ -226,7 +226,7 @@ bool Foam::functionObjectList::readFunctionObject Tuple2 ( argName, - funcNameArgs(start, i - start) + funcNameArgs.substr(start, i - start) ) ); namedArg = false; @@ -235,7 +235,10 @@ bool Foam::functionObjectList::readFunctionObject { args.append ( - string::validate(funcNameArgs(start, i - start)) + word::validate + ( + funcNameArgs.substr(start, i - start) + ) ); } start = i+1; @@ -252,7 +255,11 @@ bool Foam::functionObjectList::readFunctionObject } else if (c == '=') { - argName = string::validate(funcNameArgs(start, i - start)); + argName = word::validate + ( + funcNameArgs.substr(start, i - start) + ); + start = i+1; namedArg = true; } @@ -323,7 +330,7 @@ bool Foam::functionObjectList::readFunctionObject // Merge this functionObject dictionary into functionsDict dictionary funcArgsDict; - funcArgsDict.add(string::validate(funcNameArgs), funcDict); + funcArgsDict.add(word::validate(funcNameArgs), funcDict); functionsDict.merge(funcArgsDict); return true; @@ -334,15 +341,15 @@ bool Foam::functionObjectList::readFunctionObject Foam::functionObjectList::functionObjectList ( - const Time& t, + const Time& runTime, const bool execution ) : PtrList(), digests_(), indices_(), - time_(t), - parentDict_(t.controlDict()), + time_(runTime), + parentDict_(runTime.controlDict()), stateDictPtr_(), execution_(execution), updated_(false) @@ -351,7 +358,7 @@ Foam::functionObjectList::functionObjectList Foam::functionObjectList::functionObjectList ( - const Time& t, + const Time& runTime, const dictionary& parentDict, const bool execution ) @@ -359,7 +366,7 @@ Foam::functionObjectList::functionObjectList PtrList(), digests_(), indices_(), - time_(t), + time_(runTime), parentDict_(parentDict), stateDictPtr_(), execution_(execution), @@ -745,8 +752,10 @@ bool Foam::functionObjectList::read() { autoPtr foPtr; - FatalError.throwExceptions(); - FatalIOError.throwExceptions(); + // Throw FatalError, FatalIOError as exceptions + const bool throwingError = FatalError.throwExceptions(); + const bool throwingIOerr = FatalIOError.throwExceptions(); + try { // New functionObject @@ -777,8 +786,10 @@ bool Foam::functionObjectList::read() WarningInFunction << "Caught FatalError " << err << nl << endl; } - FatalError.dontThrowExceptions(); - FatalIOError.dontThrowExceptions(); + + // Restore previous exception throwing state + FatalError.throwExceptions(throwingError); + FatalIOError.throwExceptions(throwingIOerr); if (foPtr.valid()) { diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H index 2a3efb45ed..c90318727b 100644 --- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H +++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H @@ -130,7 +130,7 @@ public: //- Construct from Time, a dictionary with "functions" entry // and the execution setting. - // \param[in] t - the other Time instance to construct from + // \param[in] runTime - the other Time instance to construct from // \param[in] parentDict - the parent dictionary containing // a "functions" entry, which can either be a list or a dictionary // of functionObject specifications. diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.C b/src/OpenFOAM/db/objectRegistry/objectRegistry.C index 2f048ea71c..4a6c60c612 100644 --- a/src/OpenFOAM/db/objectRegistry/objectRegistry.C +++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.C @@ -55,7 +55,7 @@ Foam::objectRegistry::objectRegistry ( IOobject ( - string::validate(t.caseName()), + word::validate(t.caseName()), t.path(), t, IOobject::NO_READ, diff --git a/src/OpenFOAM/dimensionSet/dimensionSetIO.C b/src/OpenFOAM/dimensionSet/dimensionSetIO.C index 768acc8efc..3977383160 100644 --- a/src/OpenFOAM/dimensionSet/dimensionSetIO.C +++ b/src/OpenFOAM/dimensionSet/dimensionSetIO.C @@ -140,7 +140,7 @@ void Foam::dimensionSet::tokeniser::splitWord(const word& w) { if (i > start) { - word subWord = w(start, i-start); + const word subWord = w.substr(start, i-start); if (isdigit(subWord[0]) || subWord[0] == token::SUBTRACT) { push(token(readScalar(IStringStream(subWord)()))); @@ -158,7 +158,7 @@ void Foam::dimensionSet::tokeniser::splitWord(const word& w) } else { - push(token::punctuationToken(w[i])); + push(token(token::punctuationToken(w[i]))); } } start = i+1; @@ -166,7 +166,7 @@ void Foam::dimensionSet::tokeniser::splitWord(const word& w) } if (start < w.size()) { - word subWord = w(start, w.size()-start); + const word subWord = w.substr(start); if (isdigit(subWord[0]) || subWord[0] == token::SUBTRACT) { push(token(readScalar(IStringStream(subWord)()))); @@ -524,9 +524,9 @@ Foam::Istream& Foam::dimensionSet::read do { word symbolPow = nextToken.wordToken(); - if (symbolPow[symbolPow.size()-1] == token::END_SQR) + if (symbolPow.back() == token::END_SQR) { - symbolPow = symbolPow(0, symbolPow.size()-1); + symbolPow.resize(symbolPow.size()-1); continueParsing = false; } @@ -537,8 +537,8 @@ Foam::Istream& Foam::dimensionSet::read size_t index = symbolPow.find('^'); if (index != string::npos) { - word symbol = symbolPow(0, index); - word exp = symbolPow(index+1, symbolPow.size()-index+1); + const word symbol = symbolPow.substr(0, index); + const word exp = symbolPow.substr(index+1); scalar exponent = readScalar(IStringStream(exp)()); dimensionedScalar s; @@ -580,9 +580,9 @@ Foam::Istream& Foam::dimensionSet::read { // Read first five dimensions exponents_[dimensionSet::MASS] = nextToken.number(); - for (int Dimension=1; Dimension> exponents_[Dimension]; + is >> exponents_[d]; } // Read next token diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C index b3b68fc872..87c8c30f03 100644 --- a/src/OpenFOAM/global/argList/argList.C +++ b/src/OpenFOAM/global/argList/argList.C @@ -480,6 +480,7 @@ Foam::argList::argList // Check arguments and options, argv[0] was already handled int nArgs = 1; + HashTable::const_iterator optIter; for (int argI = 1; argI < args_.size(); ++argI) { argListStr_ += ' '; @@ -489,15 +490,20 @@ Foam::argList::argList { const char *optionName = &args_[argI][1]; - if + if (!*optionName) + { + Warning + <<"Ignoring lone '-' on the command-line" << endl; + } + else if ( ( - validOptions.found(optionName) - && !validOptions[optionName].empty() + (optIter = validOptions.cfind(optionName)).found() + && !optIter.object().empty() ) || ( - validParOptions.found(optionName) - && !validParOptions[optionName].empty() + (optIter = validParOptions.cfind(optionName)).found() + && !optIter.object().empty() ) ) { diff --git a/src/OpenFOAM/matrices/solution/solution.C b/src/OpenFOAM/matrices/solution/solution.C index 5abac0fa3e..982c3398b6 100644 --- a/src/OpenFOAM/matrices/solution/solution.C +++ b/src/OpenFOAM/matrices/solution/solution.C @@ -76,16 +76,13 @@ void Foam::solution::read(const dictionary& dict) const word& e = entryNames[i]; scalar value = readScalar(relaxDict.lookup(e)); - if (e(0, 1) == "p") + if (e.startsWith("p")) { fieldRelaxDict_.add(e, value); } - else if (e.length() >= 3) + else if (e.startsWith("rho")) { - if (e(0, 3) == "rho") - { - fieldRelaxDict_.add(e, value); - } + fieldRelaxDict_.add(e, value); } } diff --git a/src/OpenFOAM/primitives/chars/wchar/wchar.H b/src/OpenFOAM/primitives/chars/wchar/wchar.H index e6cc3e182e..480a580119 100644 --- a/src/OpenFOAM/primitives/chars/wchar/wchar.H +++ b/src/OpenFOAM/primitives/chars/wchar/wchar.H @@ -53,13 +53,13 @@ class Ostream; // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // //- Output wide character (Unicode) as UTF-8 -Ostream& operator<<(Ostream&, const wchar_t); +Ostream& operator<<(Ostream& os, const wchar_t wc); //- Output wide character (Unicode) string as UTF-8 -Ostream& operator<<(Ostream&, const wchar_t*); +Ostream& operator<<(Ostream& os, const wchar_t* wstr); //- Output wide character (Unicode) string as UTF-8 -Ostream& operator<<(Ostream&, const std::wstring&); +Ostream& operator<<(Ostream& os, const std::wstring& wstr); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/OpenFOAM/primitives/chars/wchar/wcharIO.C b/src/OpenFOAM/primitives/chars/wchar/wcharIO.C index fc710a52dd..ed88e5703f 100644 --- a/src/OpenFOAM/primitives/chars/wchar/wcharIO.C +++ b/src/OpenFOAM/primitives/chars/wchar/wcharIO.C @@ -116,12 +116,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const wchar_t* wstr) Foam::Ostream& Foam::operator<<(Ostream& os, const std::wstring& wstr) { - for - ( - std::wstring::const_iterator iter = wstr.begin(); - iter != wstr.end(); - ++iter - ) + for (auto iter = wstr.cbegin(); iter != wstr.cend(); ++iter) { os << *iter; } diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.C b/src/OpenFOAM/primitives/strings/fileName/fileName.C index 87ddec68b7..097da220f6 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileName.C +++ b/src/OpenFOAM/primitives/strings/fileName/fileName.C @@ -104,30 +104,26 @@ Foam::fileName& Foam::fileName::toAbsolute() } -bool Foam::fileName::clean() +bool Foam::fileName::clean(std::string& str) { - // The top slash - we are never allowed to go above it - string::size_type top = this->find('/'); + // Start with the top slash found - we are never allowed to go above it + char prev = '/'; + auto top = str.find(prev); // No slashes - nothing to do - if (top == string::npos) + if (top == std::string::npos) { return false; } - // Start with the '/' found: - char prev = '/'; - string::size_type nChar = top+1; - string::size_type maxLen = this->size(); + // Number of output characters + std::string::size_type nChar = top+1; - for - ( - string::size_type src = nChar; - src < maxLen; - /*nil*/ - ) + const string::size_type maxLen = str.size(); + + for (string::size_type src = nChar; src < maxLen; /*nil*/) { - char c = operator[](src++); + const char c = str[src++]; if (prev == '/') { @@ -137,28 +133,27 @@ bool Foam::fileName::clean() continue; } - // Could be '/./' or '/../' + // Could be "/./", "/../" or a trailing "/." if (c == '.') { - // Found trailing '/.' - skip it + // Trailing "/." - skip it if (src >= maxLen) { - continue; + break; } - // Peek at the next character - char c1 = operator[](src); + const char c1 = str[src]; - // Found '/./' - skip it + // Found "/./" - skip it if (c1 == '/') { - src++; + ++src; continue; } - // It is '/..' or '/../' - if (c1 == '.' && (src+1 >= maxLen || operator[](src+1) == '/')) + // Trailing "/.." or intermediate "/../" + if (c1 == '.' && (src+1 >= maxLen || str[src+1] == '/')) { string::size_type parent; @@ -168,7 +163,7 @@ bool Foam::fileName::clean() if ( nChar > 2 - && (parent = this->rfind('/', nChar-2)) != string::npos + && (parent = str.rfind('/', nChar-2)) != string::npos && parent >= top ) { @@ -184,47 +179,60 @@ bool Foam::fileName::clean() } } } - operator[](nChar++) = prev = c; + str[nChar++] = prev = c; } // Remove trailing slash - if (nChar > 1 && operator[](nChar-1) == '/') + if (nChar > 1 && str[nChar-1] == '/') { nChar--; } - this->resize(nChar); + str.resize(nChar); return (nChar != maxLen); } +bool Foam::fileName::clean() +{ + return fileName::clean(*this); +} + + Foam::fileName Foam::fileName::clean() const { - fileName fName(*this); - fName.clean(); - return fName; + fileName cleaned(*this); + fileName::clean(cleaned); + return cleaned; +} + + +std::string Foam::fileName::name(const std::string& str) +{ + const auto beg = str.rfind('/'); + + if (beg == npos) + { + return str; + } + else + { + return str.substr(beg+1); + } } Foam::word Foam::fileName::name() const { - const size_type i = rfind('/'); - - if (i == npos) - { - return *this; - } - else - { - return substr(i+1); - } + return fileName::name(*this); } -Foam::word Foam::fileName::nameLessExt() const +std::string Foam::fileName::nameLessExt(const std::string& str) { - size_type beg = rfind('/'); + size_type beg = str.rfind('/'); + size_type dot = str.rfind('.'); if (beg == npos) { @@ -235,7 +243,6 @@ Foam::word Foam::fileName::nameLessExt() const ++beg; } - size_type dot = rfind('.'); if (dot != npos && dot <= beg) { dot = npos; @@ -243,18 +250,24 @@ Foam::word Foam::fileName::nameLessExt() const if (dot == npos) { - return substr(beg, npos); + return str.substr(beg); } else { - return substr(beg, dot - beg); + return str.substr(beg, dot - beg); } } -Foam::fileName Foam::fileName::path() const +Foam::word Foam::fileName::nameLessExt() const { - const size_type i = rfind('/'); + return nameLessExt(*this); +} + + +std::string Foam::fileName::path(const std::string& str) +{ + const auto i = str.rfind('/'); if (i == npos) { @@ -262,7 +275,7 @@ Foam::fileName Foam::fileName::path() const } else if (i) { - return substr(0, i); + return str.substr(0, i); } else { @@ -271,9 +284,15 @@ Foam::fileName Foam::fileName::path() const } +Foam::fileName Foam::fileName::path() const +{ + return path(*this); +} + + Foam::fileName Foam::fileName::lessExt() const { - const size_type i = find_ext(); + const auto i = find_ext(); if (i == npos) { @@ -330,7 +349,7 @@ Foam::wordList Foam::fileName::components(const char delimiter) const // Avoid empty trailing element if (beg < size()) { - wrdList.append(substr(beg, npos)); + wrdList.append(substr(beg)); } // Transfer to wordList diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.H b/src/OpenFOAM/primitives/strings/fileName/fileName.H index 19cd295120..841c0e35b2 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileName.H +++ b/src/OpenFOAM/primitives/strings/fileName/fileName.H @@ -108,7 +108,7 @@ public: inline fileName(const fileName& fn); //- Construct as copy of word - inline fileName(const word& s); + inline fileName(const word& w); //- Construct as copy of string inline fileName(const string& s, const bool doStripInvalid=true); @@ -135,26 +135,42 @@ public: //- Is this character valid for a fileName? inline static bool valid(char c); - //- Cleanup file name + //- Cleanup filename // - // * Removes repeated slashes + // Removes trailing \c / + // \verbatim + // / --> / + // /abc/ --> /abc + // \endverbatim + // + // Removes repeated slashes + // \verbatim // /abc////def --> /abc/def + // \endverbatim // - // * Removes '/./' - // /abc/def/./ghi/. --> /abc/def/./ghi + // Removes \c /./ (current directory) + // \verbatim + // /abc/def/./ghi/. --> /abc/def/ghi // abc/def/./ --> abc/def + // ./abc/ --> ./abc + // \endverbatim // - // * Removes '/../' + // Removes \c /../ (parent directory) + // \verbatim // /abc/def/../ghi/jkl/nmo/.. --> /abc/ghi/jkl // abc/../def/ghi/../jkl --> abc/../def/jkl + // \endverbatim // - // * Removes trailing '/' - // - // \return True if any contents changed + // \return True if the content changed + static bool clean(std::string& str); + + + //- Cleanup filename inplace + // \return True if any contents changed bool clean(); - //- Cleanup file name - // eg, remove repeated slashes, etc. + //- Cleanup filename + // \return cleaned copy of fileName fileName clean() const; @@ -164,6 +180,9 @@ public: // LINK (only if followLink=false) Type type(const bool followLink = true) const; + //- Return true if string starts with a '/' + inline static bool isAbsolute(const std::string& str); + //- Return true if file name is absolute (starts with a '/') inline bool isAbsolute() const; @@ -174,19 +193,28 @@ public: // Decomposition //- Return basename (part beyond last /), including its extension + // The result normally coresponds to a Foam::word // // Behaviour compared to /usr/bin/basename: // \verbatim // input name() basename // ----- ------ -------- // "foo" "foo" "foo" + // "/" "" "/" // "/foo" "foo" "foo" // "foo/bar" "bar" "bar" // "/foo/bar" "bar" "bar" // "/foo/bar/" "" "bar" // \endverbatim + static std::string name(const std::string& str); + + //- Return basename (part beyond last /), including its extension word name() const; + //- Return basename, without extension + // The result normally coresponds to a Foam::word + static std::string nameLessExt(const std::string& str); + //- Return basename, without extension word nameLessExt() const; @@ -199,17 +227,22 @@ public: } //- Return directory path name (part before last /) + // The result normally coresponds to a Foam::fileName // // Behaviour compared to /usr/bin/dirname: // \verbatim // input path() dirname // ----- ------ ------- // "foo" "." "." + // "/" "/" "/" // "/foo" "/" "foo" // "foo/bar" "foo" "foo" // "/foo/bar" "/foo" "/foo" // "/foo/bar/" "/foo/bar/" "/foo" // \endverbatim + static std::string path(const std::string& str); + + //- Return directory path name (part before last /) fileName path() const; //- Return file name without extension (part before last .) @@ -242,11 +275,11 @@ public: // \verbatim // Input components() // ----- ------ - // "foo" 1("foo") - // "/foo" 1("foo") - // "foo/bar" 2("foo", "bar") - // "/foo/bar" 2("foo", "bar") - // "/foo/bar/" 2("foo", "bar") + // "foo" ("foo") + // "/foo" ("foo") + // "foo/bar" ("foo", "bar") + // "/foo/bar" ("foo", "bar") + // "/foo/bar/" ("foo", "bar") // \endverbatim wordList components(const char delimiter = '/') const; diff --git a/src/OpenFOAM/primitives/strings/fileName/fileNameI.H b/src/OpenFOAM/primitives/strings/fileName/fileNameI.H index b119926305..c3c82cc65d 100644 --- a/src/OpenFOAM/primitives/strings/fileName/fileNameI.H +++ b/src/OpenFOAM/primitives/strings/fileName/fileNameI.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -23,12 +23,13 @@ License \*---------------------------------------------------------------------------*/ +#include // for std::cerr + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // inline void Foam::fileName::stripInvalid() { - // skip stripping unless debug is active to avoid - // costly operations + // Skip stripping unless debug is active (to avoid costly operations) if (debug && string::stripInvalid(*this)) { std::cerr @@ -115,6 +116,12 @@ inline bool Foam::fileName::valid(char c) } +inline bool Foam::fileName::isAbsolute(const std::string& str) +{ + return !str.empty() && str[0] == '/'; +} + + inline bool Foam::fileName::isAbsolute() const { return !empty() && operator[](0) == '/'; diff --git a/src/OpenFOAM/primitives/strings/keyType/keyType.H b/src/OpenFOAM/primitives/strings/keyType/keyType.H index 82713fd9ff..0f9d613943 100644 --- a/src/OpenFOAM/primitives/strings/keyType/keyType.H +++ b/src/OpenFOAM/primitives/strings/keyType/keyType.H @@ -111,6 +111,11 @@ public: // Member functions + //- Is this character valid for a keyType? + // This is largely identical with what word accepts, but also + // permit brace-brackets, which are valid for some regexs. + inline static bool valid(char c); + //- Treat as a pattern rather than a literal string? inline bool isPattern() const; diff --git a/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H b/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H index 964f48cbb0..575bb834b1 100644 --- a/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H +++ b/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H @@ -23,6 +23,21 @@ License \*---------------------------------------------------------------------------*/ +// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // + +inline bool Foam::keyType::valid(char c) +{ + return + ( + !isspace(c) + && c != '"' // string quote + && c != '\'' // string quote + && c != '/' // path separator + && c != ';' // end statement + ); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // inline Foam::keyType::keyType() diff --git a/src/OpenFOAM/primitives/strings/lists/CStringList.H b/src/OpenFOAM/primitives/strings/lists/CStringList.H index 42d762a6f0..30a21a4fcb 100644 --- a/src/OpenFOAM/primitives/strings/lists/CStringList.H +++ b/src/OpenFOAM/primitives/strings/lists/CStringList.H @@ -128,7 +128,7 @@ public: inline size_t length() const; //- The flattened character content, with interspersed nul-chars - inline char* data() const; + inline const char* data() const; // Edit diff --git a/src/OpenFOAM/primitives/strings/lists/CStringListI.H b/src/OpenFOAM/primitives/strings/lists/CStringListI.H index d91a9de646..197633691e 100644 --- a/src/OpenFOAM/primitives/strings/lists/CStringListI.H +++ b/src/OpenFOAM/primitives/strings/lists/CStringListI.H @@ -46,8 +46,8 @@ inline Foam::CStringList::CStringList() : argc_(0), len_(0), - argv_(0), - data_(0) + argv_(nullptr), + data_(nullptr) {} @@ -69,12 +69,12 @@ inline void Foam::CStringList::clear() if (data_) { delete[] data_; - data_ = 0; + data_ = nullptr; } if (argv_) { delete[] argv_; - argv_ = 0; + argv_ = nullptr; } } @@ -97,7 +97,7 @@ inline char** Foam::CStringList::strings() const } -inline char* Foam::CStringList::data() const +inline const char* Foam::CStringList::data() const { return data_; } diff --git a/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C b/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C index 8a5d383dbf..8c2fad816e 100644 --- a/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C +++ b/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C @@ -31,10 +31,7 @@ Foam::CStringList::CStringList const UList& input ) : - argc_(0), - len_(0), - argv_(0), - data_(0) + CStringList() { reset(input); } @@ -50,42 +47,38 @@ void Foam::CStringList::reset { clear(); - argc_ = input.size(); - forAll(input, argI) + if (input.empty()) { - len_ += input[argI].size(); - ++len_; // nul terminator for C-strings + // Special handling of an empty list + argv_ = new char*[1]; + argv_[0] = nullptr; // Final nullptr terminator + return; } - argv_ = new char*[argc_+1]; - argv_[argc_] = nullptr; // extra terminator - - if (argc_ > 0) + // Count overall required string length, including each trailing nul char + for (const auto& str : input) { - // allocation includes final nul terminator, - // but overall count does not - data_ = new char[len_--]; + len_ += str.size() + 1; + } + --len_; // No final nul in overall count - char* ptr = data_; - forAll(input, argI) + argv_ = new char*[input.size()+1]; // Extra +1 for terminating nullptr + data_ = new char[len_+1]; // Extra +1 for terminating nul char + + // Copy contents + char* ptr = data_; + for (const auto& str : input) + { + argv_[argc_++] = ptr; // The start of this string + + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { - argv_[argI] = ptr; - - const std::string& str = - static_cast(input[argI]); - - for - ( - std::string::const_iterator iter = str.begin(); - iter != str.end(); - ++iter - ) - { - *(ptr++) = *iter; - } - *(ptr++) = '\0'; + *(ptr++) = *iter; } + *(ptr++) = '\0'; } + + argv_[argc_] = nullptr; // Final nullptr terminator } diff --git a/src/OpenFOAM/primitives/strings/lists/SubStrings.H b/src/OpenFOAM/primitives/strings/lists/SubStrings.H new file mode 100644 index 0000000000..3e37fd7edd --- /dev/null +++ b/src/OpenFOAM/primitives/strings/lists/SubStrings.H @@ -0,0 +1,127 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::SubStrings + +Description + Sub-ranges of a string with a structure similar to std::match_results, + but without the underlying regular expression matching. + +\*---------------------------------------------------------------------------*/ + +#ifndef SubStrings_H +#define SubStrings_H + +#include +#include +#include + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class SubStrings Declaration +\*---------------------------------------------------------------------------*/ + +template +class SubStrings +: + public std::vector> +{ +public: + + // Typedefs + + //- The element type + using value_type = + typename std::sub_match; + + //- The const_iterator for the underlying string type + using string_iterator = typename String::const_iterator; + + + // Constructors + + //- Construct null + SubStrings() + {} + + + // Member Functions + + //- The total length of all sub-elements. + // Use size() for the number elements. + std::string::size_type length() const + { + std::string::size_type len = 0; + + for (const auto& elem : *this) + { + len += elem.length(); + } + + return len; + } + + + //- Append sub-string defined by begin/end iterators + void append(string_iterator b, string_iterator e) + { + value_type range; + range.first = b; + range.second = e; + range.matched = true; + + this->push_back(range); + } + + + //- Const reference to the first element, + // for consistency with other OpenFOAM containers + auto first() const -> decltype(this->front()) + { + return this->front(); + } + + + //- Const reference to the last element, + // for consistency with other OpenFOAM containers + auto last() const -> decltype(this->back()) + { + return this->back(); + } + +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/strings/string/string.C b/src/OpenFOAM/primitives/strings/string/string.C index dff5626411..b16b30f66d 100644 --- a/src/OpenFOAM/primitives/strings/string/string.C +++ b/src/OpenFOAM/primitives/strings/string/string.C @@ -101,17 +101,17 @@ bool Foam::string::hasExt(const wordRe& ending) const Foam::string::size_type Foam::string::count(const char c) const { - size_type cCount = 0; + size_type nChar = 0; - for (const_iterator iter = cbegin(); iter != cend(); ++iter) + for (auto iter = cbegin(); iter != cend(); ++iter) { if (*iter == c) { - ++cCount; + ++nChar; } } - return cCount; + return nChar; } @@ -119,14 +119,14 @@ Foam::string& Foam::string::replace ( const string& oldStr, const string& newStr, - size_type start + const size_type start ) { - size_type newStart = start; + size_type pos = start; - if ((newStart = find(oldStr, newStart)) != npos) + if ((pos = find(oldStr, pos)) != npos) { - std::string::replace(newStart, oldStr.size(), newStr); + std::string::replace(pos, oldStr.size(), newStr); } return *this; @@ -137,17 +137,22 @@ Foam::string& Foam::string::replaceAll ( const string& oldStr, const string& newStr, - size_type start + const size_type start ) { - if (oldStr.size()) - { - size_type newStart = start; + const size_type lenOld = oldStr.size(); + const size_type lenNew = newStr.size(); - while ((newStart = find(oldStr, newStart)) != npos) + if (lenOld) + { + for + ( + size_type pos = start; + (pos = find(oldStr, pos)) != npos; + pos += lenNew + ) { - std::string::replace(newStart, oldStr.size(), newStr); - newStart += newStr.size(); + std::string::replace(pos, lenOld, newStr); } } @@ -168,19 +173,14 @@ bool Foam::string::removeRepeated(const char character) if (character && find(character) != npos) { - string::size_type nChar=0; - iterator iter2 = begin(); + string::size_type nChar = 0; + iterator outIter = begin(); char prev = 0; - for - ( - string::const_iterator iter1 = iter2; - iter1 != end(); - iter1++ - ) + for (auto iter = cbegin(); iter != cend(); ++iter) { - char c = *iter1; + const char c = *iter; if (prev == c && c == character) { @@ -188,11 +188,12 @@ bool Foam::string::removeRepeated(const char character) } else { - *iter2 = prev = c; - ++iter2; + *outIter = prev = c; + ++outIter; ++nChar; } } + resize(nChar); } @@ -210,16 +211,14 @@ Foam::string Foam::string::removeRepeated(const char character) const bool Foam::string::removeTrailing(const char character) { - bool changed = false; - - string::size_type nChar = size(); + const string::size_type nChar = size(); if (character && nChar > 1 && operator[](nChar-1) == character) { resize(nChar-1); - changed = true; + return true; } - return changed; + return false; } @@ -245,10 +244,8 @@ bool Foam::string::removeStart(const std::string& text) this->erase(0, txtLen); return true; } - else - { - return false; - } + + return false; } @@ -266,10 +263,8 @@ bool Foam::string::removeEnd(const std::string& text) this->resize(strLen - txtLen); return true; } - else - { - return false; - } + + return false; } diff --git a/src/OpenFOAM/primitives/strings/string/string.H b/src/OpenFOAM/primitives/strings/string/string.H index e624a68456..b739965c39 100644 --- a/src/OpenFOAM/primitives/strings/string/string.H +++ b/src/OpenFOAM/primitives/strings/string/string.H @@ -190,22 +190,22 @@ public: //- Avoid masking the normal std::string replace using std::string::replace; - //- Replace first occurence of sub-string oldStr with newStr - // starting at start + //- Replace first occurence of sub-string oldStr with newStr, + // beginning at start string& replace ( const string& oldStr, const string& newStr, - size_type start = 0 + const size_type start = 0 ); - //- Replace all occurences of sub-string oldStr with newStr - // starting at start + //- Replace all occurences of sub-string oldStr with newStr, + // beginning at start. This is a no-op if oldStr is empty. string& replaceAll ( const string& oldStr, const string& newStr, - size_type start = 0 + const size_type start = 0 ); //- Expand initial tildes and all occurences of environment variables @@ -224,20 +224,23 @@ public: // Foam::findEtcFile string& expand(const bool allowEmpty = false); - //- Remove repeated characters returning true if string changed + //- Remove repeated characters + // \return True if string changed bool removeRepeated(const char character); //- Return string with repeated characters removed string removeRepeated(const char character) const; - //- Remove trailing character returning true if string changed + //- Remove trailing character, unless string is a single character + // \return True if string changed bool removeTrailing(const char character); - //- Return string with trailing character removed + //- Return string with trailing character removed, + // unless string is a single character string removeTrailing(const char character) const; //- Remove the given text from the start of the string. - // Always true if the removal occurred or the given text is empty. + // \return True if the removal occurred or the given text is empty. bool removeStart(const std::string& text); //- Remove the given text from the end of the string. diff --git a/src/OpenFOAM/primitives/strings/string/stringI.H b/src/OpenFOAM/primitives/strings/string/stringI.H index bae33b3342..96520dd758 100644 --- a/src/OpenFOAM/primitives/strings/string/stringI.H +++ b/src/OpenFOAM/primitives/strings/string/stringI.H @@ -23,7 +23,6 @@ License \*---------------------------------------------------------------------------*/ -#include // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -76,21 +75,18 @@ inline Foam::string::string(const std::string& str) {} -// Copy character array inline Foam::string::string(const char* str) : std::string(str) {} -// Construct from a given number of characters in a character array inline Foam::string::string(const char* str, const size_type len) : std::string(str, len) {} -// Construct from a single character inline Foam::string::string(const char c) : std::string(1, c) @@ -102,13 +98,14 @@ inline Foam::string::string(const char c) template inline bool Foam::string::valid(const std::string& str) { - for (const_iterator iter = str.begin(); iter != str.end(); ++iter) + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { if (!String::valid(*iter)) { return false; } } + return true; } @@ -118,27 +115,22 @@ inline bool Foam::string::stripInvalid(std::string& str) { if (!valid(str)) { - size_type nValid = 0; - iterator iter2 = str.begin(); + size_type nChar = 0; + iterator outIter = str.begin(); - for - ( - const_iterator iter1 = iter2; - iter1 != const_cast(str).end(); - iter1++ - ) + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { - const char c = *iter1; + const char c = *iter; if (String::valid(c)) { - *iter2 = c; - ++iter2; - ++nValid; + *outIter = c; + ++outIter; + ++nChar; } } - str.resize(nValid); + str.resize(nChar); return true; } @@ -151,7 +143,7 @@ template inline bool Foam::string::meta(const std::string& str, const char quote) { int escaped = 0; - for (const_iterator iter = str.begin(); iter != str.end(); ++iter) + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { const char c = *iter; if (quote && c == quote) @@ -181,10 +173,10 @@ Foam::string::quotemeta(const std::string& str, const char quote) } string sQuoted; - sQuoted.reserve(2*str.length()); + sQuoted.reserve(2*str.size()); int escaped = 0; - for (const_iterator iter = str.begin(); iter != str.end(); ++iter) + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) { const char c = *iter; if (c == quote) @@ -203,7 +195,7 @@ Foam::string::quotemeta(const std::string& str, const char quote) sQuoted += c; } - sQuoted.resize(sQuoted.length()); + sQuoted.resize(sQuoted.size()); return sQuoted; } @@ -212,9 +204,22 @@ Foam::string::quotemeta(const std::string& str, const char quote) template inline String Foam::string::validate(const std::string& str) { - string ss = str; - stripInvalid(ss); - return ss; + String out; + out.resize(str.size()); + + size_type count = 0; + for (auto iter = str.cbegin(); iter != str.cend(); ++iter) + { + const char c = *iter; + if (String::valid(c)) + { + out[count++] = c; + } + } + + out.resize(count); + + return out; } @@ -257,4 +262,5 @@ inline unsigned Foam::string::hash::operator() return Hasher(str.data(), str.size(), seed); } + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C index ea6d81ef04..b3c35d9541 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C @@ -123,12 +123,12 @@ Foam::string& Foam::stringOps::inplaceExpand } else { - string::iterator iter = s.begin() + begVar + 1; + string::const_iterator iter = s.cbegin() + begVar + 1; // more generous in accepting keywords than for env variables while ( - iter != s.end() + iter != s.cend() && ( std::isalnum(*iter) @@ -180,8 +180,7 @@ Foam::string& Foam::stringOps::inplaceExpand } - HashTable::const_iterator fnd = - mapping.find(varName); + auto fnd = mapping.cfind(varName); if (fnd.found()) { @@ -290,7 +289,9 @@ Foam::string Foam::stringOps::getVariable string::size_type altPos = 0; // check for parameter:-word or parameter:+word - int altType = findParameterAlternative(name, altPos, name.size()-1); + const int altType = + findParameterAlternative(name, altPos, name.size()-1); + if (altType) { value = getEnv @@ -414,13 +415,13 @@ Foam::string& Foam::stringOps::inplaceExpand } else { - string::iterator iter = s.begin() + begVar + 1; + string::const_iterator iter = s.cbegin() + begVar + 1; string::size_type endVar = begVar; // more generous in accepting keywords than for env variables while ( - iter != s.end() + iter != s.cend() && ( std::isalnum(*iter) @@ -552,12 +553,12 @@ Foam::string& Foam::stringOps::inplaceExpand } else { - string::iterator iter = s.begin() + begVar + 1; + string::const_iterator iter = s.cbegin() + begVar + 1; // more generous in accepting keywords than for env variables while ( - iter != s.end() + iter != s.cend() && ( std::isalnum(*iter) @@ -700,11 +701,11 @@ Foam::string& Foam::stringOps::inplaceExpand } else { - string::iterator iter = s.begin() + begVar + 1; + string::const_iterator iter = s.cbegin() + begVar + 1; while ( - iter != s.end() + iter != s.cend() && (std::isalnum(*iter) || *iter == '_') ) { diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H index 66e87623e5..0d7d459f59 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H @@ -30,12 +30,14 @@ Description SourceFiles stringOps.C + stringOpsTemplates.C \*---------------------------------------------------------------------------*/ #ifndef stringOps_H #define stringOps_H #include "string.H" +#include "SubStrings.H" #include "word.H" #include "dictionary.H" #include "HashTable.H" @@ -302,14 +304,21 @@ namespace stringOps Foam::word name(const std::string& fmt, const PrimitiveType& val); -} // End namespace stringOps + //- Split a string into sub-strings at the delimiter character. + // An empty sub-strings are suppressed. + template + Foam::SubStrings split + ( + const StringType& str, + const char delimiter + ); +} // End namespace stringOps // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C b/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C index a8f7030300..1b0aa62e9f 100644 --- a/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C +++ b/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,4 +65,36 @@ Foam::word Foam::stringOps::name } +template +Foam::SubStrings Foam::stringOps::split +( + const StringType& str, + const char delimiter +) +{ + Foam::SubStrings lst; + lst.reserve(20); + + std::string::size_type beg = 0, end = 0; + + while ((end = str.find(delimiter, beg)) != std::string::npos) + { + if (beg < end) + { + // (Non-empty) intermediate element + lst.append(str.cbegin() + beg, str.cbegin() + end); + } + beg = end + 1; + } + + // (Non-empty) trailing element + if (beg < str.size()) + { + lst.append(str.cbegin() + beg, str.cbegin() + str.size()); + } + + return lst; +} + + // ************************************************************************* // diff --git a/src/OpenFOAM/primitives/strings/word/word.C b/src/OpenFOAM/primitives/strings/word/word.C index 3d829ae61e..932f10af4c 100644 --- a/src/OpenFOAM/primitives/strings/word/word.C +++ b/src/OpenFOAM/primitives/strings/word/word.C @@ -35,52 +35,28 @@ const Foam::word Foam::word::null; // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // -Foam::word Foam::word::validated(const std::string& s, const bool prefix) +Foam::word Foam::word::validate(const std::string& s, const bool prefix) { - std::string::size_type count = 0; - bool extra = false; + word out; + out.resize(s.size() + (prefix ? 1 : 0)); - // Count number of valid characters and detect if the first character - // happens to be a digit, which we'd like to avoid having since this - // will cause parse issues when read back later. - for (std::string::const_iterator it = s.cbegin(); it != s.cend(); ++it) + std::string::size_type count = 0; + + // As per validate, but optionally detect if the first character + // is a digit, which we'd like to avoid having since this will + // cause parse issues when read back later. + for (auto iter = s.cbegin(); iter != s.cend(); ++iter) { - const char c = *it; + const char c = *iter; if (word::valid(c)) { - if (prefix && !count && isdigit(c)) + if (!count && prefix && isdigit(c)) { // First valid character was a digit - prefix with '_' - extra = true; - ++count; + out[count++] = '_'; } - ++count; - } - } - - if (count == s.size() && !extra) - { - return word(s, false); // Already checked, can just return as word - } - - word out; - out.resize(count); - count = 0; - - // Copy valid content. - if (extra) - { - out[count++] = '_'; - } - - for (std::string::const_iterator it = s.cbegin(); it != s.cend(); ++it) - { - const char c = *it; - - if (word::valid(c)) - { out[count++] = c; } } diff --git a/src/OpenFOAM/primitives/strings/word/word.H b/src/OpenFOAM/primitives/strings/word/word.H index 0661255341..b92d720934 100644 --- a/src/OpenFOAM/primitives/strings/word/word.H +++ b/src/OpenFOAM/primitives/strings/word/word.H @@ -64,6 +64,7 @@ class word // Private Member Functions //- Strip invalid characters from this word + // Trips an abort on invalid characters for debug 2 or greater inline void stripInvalid(); @@ -112,10 +113,10 @@ public: //- Is this character valid for a word? inline static bool valid(char c); - //- Construct a validated word, in which all invalid characters have - // been stripped out. Normally also prefix any leading digit - // with '_' to have words that work nicely as dictionary keywords. - static word validated(const std::string& s, const bool prefix=true); + //- Construct validated word (no invalid characters). + // Optionally prefix any leading digit with '_' to have words + // that work nicely as dictionary keywords. + static word validate(const std::string& s, const bool prefix=false); // File-like functions diff --git a/src/OpenFOAM/primitives/strings/word/wordI.H b/src/OpenFOAM/primitives/strings/word/wordI.H index eb17097014..2fa48801a7 100644 --- a/src/OpenFOAM/primitives/strings/word/wordI.H +++ b/src/OpenFOAM/primitives/strings/word/wordI.H @@ -24,12 +24,13 @@ License \*---------------------------------------------------------------------------*/ #include +#include // for std::cerr // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // inline void Foam::word::stripInvalid() { - // skip stripping unless debug is active (to avoid costly operations) + // Skip stripping unless debug is active (to avoid costly operations) if (debug && string::stripInvalid(*this)) { std::cerr diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H index 4df4325efd..8195abb90e 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H @@ -107,6 +107,11 @@ public: //- Is this a meta character? inline static bool meta(const char c); + //- Is this character valid for a wordRe? + // This is largely identical with what word accepts, but also + // permit brace-brackets, which are valid for some regexs. + inline static bool valid(char c); + //- Test string for regular expression meta characters inline static bool isPattern(const std::string& str); diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H index b01c590554..658df00695 100644 --- a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H +++ b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H @@ -31,6 +31,12 @@ inline bool Foam::wordRe::meta(const char c) } +inline bool Foam::wordRe::valid(char c) +{ + return keyType::valid(c); +} + + inline bool Foam::wordRe::isPattern(const std::string& str) { return string::meta(str); diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H index bf38df03a1..a885abcc23 100644 --- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H +++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H @@ -125,8 +125,7 @@ public: const dictionary& ); - //- Construct by mapping given outletMappedUniformInletHeatAdditionFvPatchField - // onto a new patch + //- Construct by mapping onto a new patch outletMappedUniformInletHeatAdditionFvPatchField ( const outletMappedUniformInletHeatAdditionFvPatchField&, diff --git a/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H b/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H index b6e2ea466f..2b2ed70887 100644 --- a/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H +++ b/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H @@ -76,14 +76,14 @@ Description . . div(phi,U) Gauss DEShybrid - linear // scheme 1 - linearUpwind grad(U) // scheme 2 - 0.65 // DES coefficient, typically = 0.65 - 30 // Reference velocity scale - 2 // Reference length scale - 0 // Minimum sigma limit (0-1) - 1 // Maximum sigma limit (0-1) - 1.0e-03; // Limiter of B function, typically 1.0e-03 + linear // scheme 1 + linearUpwind grad(U) // scheme 2 + 0.65 // DES coefficient, typically = 0.65 + 30 // Reference velocity scale + 2 // Reference length scale + 0 // Minimum sigma limit (0-1) + 1 // Maximum sigma limit (0-1) + 1.0e-03; // Limiter of B function, typically 1e-03 . . } @@ -98,8 +98,9 @@ Notes solvers by default. In order to use the scheme, add the library as a run-time loaded library in the \$FOAM\_CASE/system/controlDict dictionary, e.g.: - + \verbatim libs ("libturbulenceModelSchemes.so"); + \endverbatim SourceFiles DEShybrid.C @@ -122,7 +123,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - class DEShybrid Declaration + Class DEShybrid Declaration \*---------------------------------------------------------------------------*/ template @@ -199,7 +200,11 @@ class DEShybrid const volScalarField g(tanh(pow4(B))); const volScalarField A ( - CH2_*max(scalar(0), CDES_*delta/max(lTurb*g, 1.0e-15*L0_) - 0.5) + CH2_*max + ( + scalar(0), + CDES_*delta/max(lTurb*g, 1.0e-15*L0_) - 0.5 + ) ); const volScalarField factor @@ -266,37 +271,37 @@ public: if (U0_.value() <= 0) { FatalErrorInFunction - << "U0 coefficient must be greater than 0. " + << "U0 coefficient must be > 0. " << "Current value: " << U0_ << exit(FatalError); } if (L0_.value() <= 0) { FatalErrorInFunction - << "L0 coefficient must be greater than 0. " + << "L0 coefficient must be > 0. " << "Current value: " << L0_ << exit(FatalError); } if (sigmaMin_ < 0) { FatalErrorInFunction - << "sigmaMin coefficient must be greater than or equal to 0. " + << "sigmaMin coefficient must be >= 0. " << "Current value: " << sigmaMin_ << exit(FatalError); } if (sigmaMax_ < 0) { FatalErrorInFunction - << "sigmaMax coefficient must be greater than or equal to 0. " + << "sigmaMax coefficient must be >= 0. " << "Current value: " << sigmaMax_ << exit(FatalError); } if (sigmaMin_ > 1) { FatalErrorInFunction - << "sigmaMin coefficient must be less than or equal to 1. " + << "sigmaMin coefficient must be <= 1. " << "Current value: " << sigmaMin_ << exit(FatalError); } if (sigmaMax_ > 1) { FatalErrorInFunction - << "sigmaMax coefficient must be less than or equal to 1. " + << "sigmaMax coefficient must be <= 1. " << "Current value: " << sigmaMax_ << exit(FatalError); } } @@ -331,37 +336,37 @@ public: if (U0_.value() <= 0) { FatalErrorInFunction - << "U0 coefficient must be greater than 0. " + << "U0 coefficient must be > 0. " << "Current value: " << U0_ << exit(FatalError); } if (L0_.value() <= 0) { FatalErrorInFunction - << "L0 coefficient must be greater than 0. " + << "L0 coefficient must be > 0. " << "Current value: " << U0_ << exit(FatalError); } if (sigmaMin_ < 0) { FatalErrorInFunction - << "sigmaMin coefficient must be greater than or equal to 0. " + << "sigmaMin coefficient must be >= 0. " << "Current value: " << sigmaMin_ << exit(FatalError); } if (sigmaMax_ < 0) { FatalErrorInFunction - << "sigmaMax coefficient must be greater than or equal to 0. " + << "sigmaMax coefficient must be >= 0. " << "Current value: " << sigmaMax_ << exit(FatalError); } if (sigmaMin_ > 1) { FatalErrorInFunction - << "sigmaMin coefficient must be less than or equal to 1. " + << "sigmaMin coefficient must be <= 1. " << "Current value: " << sigmaMin_ << exit(FatalError); } if (sigmaMax_ > 1) { FatalErrorInFunction - << "sigmaMax coefficient must be less than or equal to 1. " + << "sigmaMax coefficient must be <= 1. " << "Current value: " << sigmaMax_ << exit(FatalError); } } diff --git a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C index 65330eee05..cbdbcd0b9b 100644 --- a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C +++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C @@ -75,7 +75,12 @@ tmp v2f::Ls() const max ( this->nu(), - dimensionedScalar("zero", this->nu()().dimensions(), 0.0) + dimensionedScalar + ( + "zero", + this->nu()().dimensions(), + 0.0 + ) ) )/epsilon_ ) diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C index 2154d2cc94..83222a222b 100644 --- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C +++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C @@ -34,16 +34,15 @@ Foam::autoPtr Foam::reactionRateFlameArea::New const combustionModel& combModel ) { - word reactionRateFlameAreaType + const word modelType ( dict.lookup("reactionRateFlameArea") ); Info<< "Selecting reaction rate flame area correlation " - << reactionRateFlameAreaType << endl; + << modelType << endl; - auto cstrIter = - dictionaryConstructorTablePtr_->cfind(reactionRateFlameAreaType); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { @@ -51,15 +50,13 @@ Foam::autoPtr Foam::reactionRateFlameArea::New ( dict ) << "Unknown reactionRateFlameArea type " - << reactionRateFlameAreaType << nl << nl + << modelType << nl << nl << "Valid reaction rate flame area types :" << endl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalIOError); } - const label tempOpen = reactionRateFlameAreaType.find('<'); - - const word className = reactionRateFlameAreaType(0, tempOpen); + const word className = modelType.substr(0, modelType.find('<')); return autoPtr (cstrIter()(className, dict, mesh, combModel)); diff --git a/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C b/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C index aa4893c078..6dbf0d5623 100644 --- a/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C +++ b/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C @@ -380,7 +380,9 @@ Foam::combustionModels::diffusionMulticomponent::R if (this->active()) { - const label specieI = this->thermo().composition().species()[Y.member()]; + const label specieI = + this->thermo().composition().species()[Y.member()]; + Su += this->chemistryPtr_->RR(specieI); } diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C index ca7d0616b8..50e69d177d 100644 --- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C +++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C @@ -35,7 +35,7 @@ Foam::combustionModels::psiCombustionModel::New const word& phaseName ) { - const word combModelName + const word modelType ( IOdictionary ( @@ -51,21 +51,21 @@ Foam::combustionModels::psiCombustionModel::New ).lookup("combustionModel") ); - Info<< "Selecting combustion model " << combModelName << endl; + Info<< "Selecting combustion model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(combModelName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown psiCombustionModel type " - << combModelName << endl << endl - << "Valid combustionModel types :" << endl + << modelType << nl << nl + << "Valid combustionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - const word className = combModelName(0, combModelName.find('<')); + const word className = modelType.substr(0, modelType.find('<')); return autoPtr ( diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C index f6ffadc0b6..fb03177606 100644 --- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C +++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C @@ -35,7 +35,7 @@ Foam::combustionModels::rhoCombustionModel::New const word& phaseName ) { - const word combTypeName + const word modelType ( IOdictionary ( @@ -51,23 +51,21 @@ Foam::combustionModels::rhoCombustionModel::New ).lookup("combustionModel") ); - Info<< "Selecting combustion model " << combTypeName << endl; + Info<< "Selecting combustion model " << modelType << endl; - auto cstrIter = dictionaryConstructorTablePtr_->cfind(combTypeName); + auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType); if (!cstrIter.found()) { FatalErrorInFunction << "Unknown rhoCombustionModel type " - << combTypeName << endl << endl - << "Valid combustionModel types :" << endl + << modelType << nl << nl + << "Valid combustionModel types :" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - const label tempOpen = combTypeName.find('<'); - - const word className = combTypeName(0, tempOpen); + const word className = modelType.substr(0, modelType.find('<')); return autoPtr ( diff --git a/src/conversion/ccm/reader/ccmReader.C b/src/conversion/ccm/reader/ccmReader.C index 66b8bd9505..78495c4ba5 100644 --- a/src/conversion/ccm/reader/ccmReader.C +++ b/src/conversion/ccm/reader/ccmReader.C @@ -211,7 +211,8 @@ void Foam::ccm::reader::readProblemDescription // readInterfaceDefinitions: -// - get /InterfaceDefinitions. used by STARCCM to define in-place interfaces, etc +// - get /InterfaceDefinitions. +// used by STARCCM to define in-place interfaces, etc // - only handle in-place one here void Foam::ccm::reader::readInterfaceDefinitions() { @@ -364,7 +365,7 @@ void Foam::ccm::reader::readProblemDescription_boundaryRegion } else { - dict.add(opt, word::validated(str)); + dict.add(opt, word::validate(str, true)); } } @@ -388,7 +389,8 @@ void Foam::ccm::reader::readProblemDescription_boundaryRegion ) { #ifdef DEBUG_CCMIOREAD - Info<< "boundary is on an interface: remap name for " << Id << endl; + Info<< "boundary is on an interface: remap name for " + << Id << endl; #endif // Substitute immediately with interface name str = interfaceDefinitions_.interfaceName(Id); @@ -405,7 +407,7 @@ void Foam::ccm::reader::readProblemDescription_boundaryRegion if (!str.empty()) { - dict.add(opt, word::validated(str)); + dict.add(opt, word::validate(str, true)); } } @@ -470,7 +472,7 @@ void Foam::ccm::reader::readProblemDescription_cellTable str = "zone_" + ::Foam::name(Id); } - dict.add(opt, word::validated(str)); + dict.add(opt, word::validate(str, true)); } @@ -482,7 +484,7 @@ void Foam::ccm::reader::readProblemDescription_cellTable if (!str.empty()) { - dict.add(opt, word::validated(str)); + dict.add(opt, word::validate(str, true)); } } diff --git a/src/conversion/ccm/reader/ccmReader.H b/src/conversion/ccm/reader/ccmReader.H index 67d937f136..d19952298b 100644 --- a/src/conversion/ccm/reader/ccmReader.H +++ b/src/conversion/ccm/reader/ccmReader.H @@ -329,8 +329,9 @@ private: //- Get interfaces, cellTable and boundaryRegion information void readProblemDescription(const ccmID& probNode); - //- Get /InterfaceDefinitions, used by STARCCM to define in-place interfaces, etc - // only handle in-place (IN_PLACE) ones at the moment + //- Get /InterfaceDefinitions, used by STARCCM to define in-place + // interfaces, etc. + // Only handle in-place (IN_PLACE) ones at the moment void readInterfaceDefinitions(); //- Get boundaryRegion information @@ -358,7 +359,8 @@ private: //- Read the monitoring void readMonitoring(const ccmID& topoId); - //- Move solid faces from Default_Boundary_Region -> Default_Boundary_Solid + //- Move solid faces from Default_Boundary_Region to + // Default_Boundary_Solid void juggleSolids(); //- Remove unwanted fluid/porous/solid regions diff --git a/src/conversion/ccm/reader/ccmReaderMesh.C b/src/conversion/ccm/reader/ccmReaderMesh.C index a7cfd831b3..cd696c8619 100644 --- a/src/conversion/ccm/reader/ccmReaderMesh.C +++ b/src/conversion/ccm/reader/ccmReaderMesh.C @@ -1053,7 +1053,11 @@ void Foam::ccm::reader::readMonitoring // //- simulate ReadFaceCells with kCCMIOBoundaryFaces // CCMIOGetNode(nullptr, childNode, "Cells", &subNode); - // CCMIORead1i(nullptr, subNode, faceCells.begin(), kCCMIOStart, kCCMIOEnd); + // CCMIORead1i + // ( + // nullptr, subNode, faceCells.begin(), + // kCCMIOStart, kCCMIOEnd + // ); // // Info << "cells: " << faceCells << endl; } @@ -1159,7 +1163,8 @@ void Foam::ccm::reader::juggleSolids() // Adjust start and sizes patchSizes_[patchIndex] -= adjustPatch; patchSizes_[patchIndex+1] = adjustPatch; - patchStarts[patchIndex+1] = patchStarts[patchIndex] + patchSizes_[patchIndex]; + patchStarts[patchIndex+1] = + patchStarts[patchIndex] + patchSizes_[patchIndex]; origBndId_[patchIndex+1] = boundaryRegion_.append ( @@ -1686,8 +1691,9 @@ void Foam::ccm::reader::cleanupInterfaces() oldToNew[face0] = pos + nsorted; oldToNew[face1] = pos + nsorted + nsizeby2; - // Mark destination of the faces, but cannot renumber yet - // use negative to potential overlap with other patch regions + // Mark destination of the faces, but cannot renumber + // yet. Use negative to potential overlap with other + // patch regions bafInterfaces_[elemI][0] = -oldToNew[face0]; bafInterfaces_[elemI][1] = -oldToNew[face1]; @@ -1743,14 +1749,6 @@ void Foam::ccm::reader::cleanupInterfaces() oldToNew[face1] = oldToNew[face0]; } -// Info<< "nInternalFaces " << nInternalFaces_ << nl -// << "oldToNew (internal) " -// << SubList