diff --git a/applications/solvers/combustion/XiFoam/bEqn.H b/applications/solvers/combustion/XiFoam/bEqn.H index 2b9b50d124..d93311ece1 100644 --- a/applications/solvers/combustion/XiFoam/bEqn.H +++ b/applications/solvers/combustion/XiFoam/bEqn.H @@ -30,7 +30,7 @@ if (ign.ignited()) n /= mgb; -# include "StCorr.H" + #include "StCorr.H" // Calculate turbulent flame speed flux // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -58,7 +58,7 @@ if (ign.ignited()) // Add ignition cell contribution to b-equation // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# include "ignite.H" + #include "ignite.H" // Solve for b @@ -134,7 +134,7 @@ if (ign.ignited()) (sigmas*SuInf*(Su0 - SuInf) + sqr(SuMin)*sigmaExt) /(sqr(Su0 - SuInf) + sqr(SuMin)); - solve + fvScalarMatrix SuEqn ( fvm::ddt(rho, Su) + fvm::div(phi + phiXi, Su, "div(phiXi,Su)") @@ -144,6 +144,9 @@ if (ign.ignited()) - fvm::SuSp(rho*(sigmas + Rc), Su) ); + SuEqn.relax(); + SuEqn.solve(); + // Limit the maximum Su // ~~~~~~~~~~~~~~~~~~~~ Su.min(SuMax); @@ -196,7 +199,7 @@ if (ign.ignited()) // Solve for the flame wrinkling // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - solve + fvScalarMatrix XiEqn ( fvm::ddt(rho, Xi) + fvm::div(phi + phiXi, Xi, "div(phiXi,Xi)") @@ -215,6 +218,8 @@ if (ign.ignited()) ) ); + XiEqn.relax(); + XiEqn.solve(); // Correct boundedness of Xi // ~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/applications/solvers/combustion/dieselEngineFoam/YEqn.H b/applications/solvers/combustion/dieselEngineFoam/YEqn.H index 9d46c0d611..f6251d1c30 100644 --- a/applications/solvers/combustion/dieselEngineFoam/YEqn.H +++ b/applications/solvers/combustion/dieselEngineFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i rhos(solidRegions.size()); PtrList cps(solidRegions.size()); - PtrList rhosCps(solidRegions.size()); PtrList Ks(solidRegions.size()); PtrList Ts(solidRegions.size()); @@ -47,12 +46,6 @@ ) ); - rhosCps.set - ( - i, - new volScalarField("rhosCps", rhos[i]*cps[i]) - ); - Info<< " Adding to Ks\n" << endl; Ks.set ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/createSolidMeshes.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/readSolidMultiRegionSIMPLEControls.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/setRegionSolidFields.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/solveSolid.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H similarity index 100% rename from applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/solid/solveSolid.H rename to applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/solid/solveSolid.H diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H index 3361a89add..8f109a3f82 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/createSolidFields.H @@ -1,7 +1,6 @@ // Initialise solid field pointer lists PtrList rhos(solidRegions.size()); PtrList cps(solidRegions.size()); - PtrList rhosCps(solidRegions.size()); PtrList Ks(solidRegions.size()); PtrList Ts(solidRegions.size()); @@ -47,12 +46,6 @@ ) ); - rhosCps.set - ( - i, - new volScalarField("rhosCps", rhos[i]*cps[i]) - ); - Info<< " Adding to Ks\n" << endl; Ks.set ( diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H index c2e5668a68..4b09671de2 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/solid/solidRegionDiffusionNo.H @@ -8,7 +8,7 @@ ( solidRegions[regionI], runTime, - rhosCps[regionI], + rhos[regionI]*cps[regionI], Ks[regionI] ), DiNum diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/files b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/files deleted file mode 100644 index e5f536ca09..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/Make/files +++ /dev/null @@ -1,5 +0,0 @@ -derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C -chtMultiRegionSimpleFoam.C - -EXE = $(FOAM_APPBIN)/chtMultiRegionSimpleFoam - diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C deleted file mode 100644 index e2b1d536d2..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ /dev/null @@ -1,168 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 "solidWallHeatFluxTemperatureFvPatchScalarField.H" -#include "addToRunTimeSelectionTable.H" -#include "fvPatchFieldMapper.H" -#include "volFields.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(p, iF), - q_(p.size(), 0.0), - KName_("undefined-K") -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const solidWallHeatFluxTemperatureFvPatchScalarField& ptf, - const fvPatch& p, - const DimensionedField& iF, - const fvPatchFieldMapper& mapper -) -: - fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - q_(ptf.q_, mapper), - KName_(ptf.KName_) -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const fvPatch& p, - const DimensionedField& iF, - const dictionary& dict -) -: - fixedGradientFvPatchScalarField(p, iF, dict), - q_("q", dict, p.size()), - KName_(dict.lookup("K")) -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf -) -: - fixedGradientFvPatchScalarField(tppsf), - q_(tppsf.q_), - KName_(tppsf.KName_) -{} - - -Foam::solidWallHeatFluxTemperatureFvPatchScalarField:: -solidWallHeatFluxTemperatureFvPatchScalarField -( - const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf, - const DimensionedField& iF -) -: - fixedGradientFvPatchScalarField(tppsf, iF), - q_(tppsf.q_), - KName_(tppsf.KName_) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap -( - const fvPatchFieldMapper& m -) -{ - fixedGradientFvPatchScalarField::autoMap(m); - q_.autoMap(m); -} - - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap -( - const fvPatchScalarField& ptf, - const labelList& addr -) -{ - fixedGradientFvPatchScalarField::rmap(ptf, addr); - - const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf = - refCast(ptf); - - q_.rmap(hfptf.q_, addr); -} - - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() -{ - if (updated()) - { - return; - } - - const scalarField& Kw = patch().lookupPatchField - ( - KName_ - ); - - gradient() = q_/Kw; - - fixedGradientFvPatchScalarField::updateCoeffs(); -} - - -void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write -( - Ostream& os -) const -{ - fixedGradientFvPatchScalarField::write(os); - q_.writeEntry("q", os); - os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; - this->writeEntry("value", os); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - makePatchTypeField - ( - fvPatchScalarField, - solidWallHeatFluxTemperatureFvPatchScalarField - ); -} - -// ************************************************************************* // diff --git a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H deleted file mode 100644 index ffbcf52ed5..0000000000 --- a/applications/solvers/heatTransfer/chtMultiRegionSimpleFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H +++ /dev/null @@ -1,180 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 - solidWallHeatFluxTemperatureFvPatchScalarField - -Description - Heat flux boundary condition for temperature on solid region - - Example usage: - myWallPatch - { - type solidWallHeatFluxTemperature; - K K; // Name of K field - q uniform 1000; // Heat flux / [W/m2] - value 300.0; // Initial temperature / [K] - } - - -SourceFiles - solidWallHeatFluxTemperatureFvPatchScalarField.C - -\*---------------------------------------------------------------------------*/ - -#ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H -#define solidWallHeatFluxTemperatureFvPatchScalarField_H - -#include "fixedGradientFvPatchFields.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/*---------------------------------------------------------------------------*\ - Class solidWallHeatFluxTemperatureFvPatchScalarField Declaration -\*---------------------------------------------------------------------------*/ - -class solidWallHeatFluxTemperatureFvPatchScalarField -: - public fixedGradientFvPatchScalarField -{ - // Private data - - //- Heat flux / [W/m2] - scalarField q_; - - //- Name of thermal conductivity field - word KName_; - - -public: - - //- Runtime type information - TypeName("solidWallHeatFluxTemperature"); - - - // Constructors - - //- Construct from patch and internal field - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField& - ); - - //- Construct from patch, internal field and dictionary - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const fvPatch&, - const DimensionedField&, - const dictionary& - ); - - //- Construct by mapping given - // solidWallHeatFluxTemperatureFvPatchScalarField - // onto a new patch - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const solidWallHeatFluxTemperatureFvPatchScalarField&, - const fvPatch&, - const DimensionedField&, - const fvPatchFieldMapper& - ); - - //- Construct as copy - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const solidWallHeatFluxTemperatureFvPatchScalarField& - ); - - //- Construct and return a clone - virtual tmp clone() const - { - return tmp - ( - new solidWallHeatFluxTemperatureFvPatchScalarField(*this) - ); - } - - //- Construct as copy setting internal field reference - solidWallHeatFluxTemperatureFvPatchScalarField - ( - const solidWallHeatFluxTemperatureFvPatchScalarField&, - const DimensionedField& - ); - - //- Construct and return a clone setting internal field reference - virtual tmp clone - ( - const DimensionedField& iF - ) const - { - return tmp - ( - new solidWallHeatFluxTemperatureFvPatchScalarField(*this, iF) - ); - } - - - // Member functions - - // Evaluation functions - - //- Update the coefficients associated with the patch field - virtual void updateCoeffs(); - - - // Mapping functions - - //- Map (and resize as needed) from self given a mapping object - virtual void autoMap - ( - const fvPatchFieldMapper& - ); - - //- Reverse map the given fvPatchField onto this fvPatchField - virtual void rmap - ( - const fvPatchScalarField&, - const labelList& - ); - - - // I-O - - //- Write - void write(Ostream&) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H index dd2f6416ee..0c8c1bd115 100644 --- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H +++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/createFields.H @@ -1,4 +1,4 @@ - Info << "Reading field p\n" << endl; + Info<< "Reading field p\n" << endl; volScalarField p ( IOobject @@ -12,7 +12,7 @@ mesh ); - Info << "Reading field U\n" << endl; + Info<< "Reading field U\n" << endl; volVectorField U ( IOobject @@ -34,7 +34,7 @@ setRefCell(p, mesh.solutionDict().subDict("SIMPLE"), pRefCell, pRefValue); - Info << "Reading field pa\n" << endl; + Info<< "Reading field pa\n" << endl; volScalarField pa ( IOobject @@ -48,7 +48,7 @@ mesh ); - Info << "Reading field Ua\n" << endl; + Info<< "Reading field Ua\n" << endl; volVectorField Ua ( IOobject @@ -84,10 +84,8 @@ dimensionedScalar lambda(laminarTransport.lookup("lambda")); dimensionedScalar alphaMax(laminarTransport.lookup("alphaMax")); - const labelList& inletCells = - mesh.boundary()[mesh.boundaryMesh().findPatchID("inlet")].faceCells(); - //const labelList& outletCells = - // mesh.boundary()[mesh.boundaryMesh().findPatchID("outlet")].faceCells(); + const labelList& inletCells = mesh.boundary()["inlet"].faceCells(); + //const labelList& outletCells = mesh.boundary()["outlet"].faceCells(); volScalarField alpha ( diff --git a/applications/solvers/incompressible/boundaryFoam/makeGraphs.H b/applications/solvers/incompressible/boundaryFoam/makeGraphs.H index 7367dc7c7d..2f24e8924b 100644 --- a/applications/solvers/incompressible/boundaryFoam/makeGraphs.H +++ b/applications/solvers/incompressible/boundaryFoam/makeGraphs.H @@ -25,9 +25,9 @@ makeGraph(y, flowDirection & R & flowDirection, "Rff", gFormat); makeGraph(y, wallNormal & R & wallNormal, "Rww", gFormat); makeGraph(y, flowDirection & R & wallNormal, "Rfw", gFormat); -makeGraph(y, sqrt(mag(R.component(tensor::XX))), "u", gFormat); -makeGraph(y, sqrt(mag(R.component(tensor::YY))), "v", gFormat); -makeGraph(y, sqrt(mag(R.component(tensor::ZZ))), "w", gFormat); -makeGraph(y, R.component(tensor::XY), "uv", gFormat); +makeGraph(y, sqrt(mag(R.component(symmTensor::XX))), "u", gFormat); +makeGraph(y, sqrt(mag(R.component(symmTensor::YY))), "v", gFormat); +makeGraph(y, sqrt(mag(R.component(symmTensor::ZZ))), "w", gFormat); +makeGraph(y, R.component(symmTensor::XY), "uv", gFormat); makeGraph(y, mag(fvc::grad(U)), "gammaDot", gFormat); diff --git a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H index f1651d8df3..f137c0027f 100644 --- a/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H +++ b/applications/solvers/incompressible/pimpleDyMFoam/correctPhi.H @@ -27,7 +27,7 @@ zeroGradientFvPatchScalarField::typeName ); - for (label i=0; icorrect(); + turbulence->correct(); + } runTime.write(); diff --git a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C index bc87b5118f..8d3f2279bc 100644 --- a/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C +++ b/applications/solvers/lagrangian/incompressibleUncoupledKinematicParcelFoam/incompressibleUncoupledKinematicParcelFoam.C @@ -41,7 +41,12 @@ Description int main(int argc, char *argv[]) { - argList::addOption("cloudName", "cloud name"); + argList::addOption + ( + "cloudName", + "name", + "specify alternative cloud name. default is 'kinematicCloud'" + ); #include "setRootCase.H" #include "createTime.H" diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H index 5cf44cb09f..c687f2035b 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i(Ua.boundaryField()[i])) { diff --git a/applications/solvers/multiphase/bubbleFoam/createPhib.H b/applications/solvers/multiphase/bubbleFoam/createPhib.H index 77bb467063..bdf4c46bcc 100644 --- a/applications/solvers/multiphase/bubbleFoam/createPhib.H +++ b/applications/solvers/multiphase/bubbleFoam/createPhib.H @@ -36,7 +36,7 @@ calculatedFvPatchScalarField::typeName ); - for (label i=0; i(Ub.boundaryField()[i])) { diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H index 3da1b5e9c1..9d3be93d0e 100644 --- a/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H +++ b/applications/solvers/multiphase/compressibleInterDyMFoam/createFields.H @@ -135,7 +135,7 @@ zeroGradientFvPatchScalarField::typeName ); - for (label i=0; i(U_.boundaryField()[i])) { diff --git a/applications/test/FixedList/FixedListTest.C b/applications/test/FixedList/FixedListTest.C index 79abb4a34a..208ff277b1 100644 --- a/applications/test/FixedList/FixedListTest.C +++ b/applications/test/FixedList/FixedListTest.C @@ -43,7 +43,6 @@ using namespace Foam; int main(int argc, char *argv[]) { - argList::validArgs.clear(); argList args(argc, argv); FixedList list; diff --git a/applications/test/ODETest/ODETest.C b/applications/test/ODETest/ODETest.C index e8d29553e1..2a3b8357b9 100644 --- a/applications/test/ODETest/ODETest.C +++ b/applications/test/ODETest/ODETest.C @@ -104,7 +104,6 @@ public: int main(int argc, char *argv[]) { - argList::validArgs.clear(); argList::validArgs.append("ODESolver"); argList args(argc, argv); diff --git a/applications/test/prefixOSstream/prefixOSstreamTest.C b/applications/test/prefixOSstream/prefixOSstreamTest.C index 98bcee40c4..093c540e96 100644 --- a/applications/test/prefixOSstream/prefixOSstreamTest.C +++ b/applications/test/prefixOSstream/prefixOSstreamTest.C @@ -45,7 +45,6 @@ using namespace Foam; int main(int argc, char *argv[]) { - argList::validArgs.clear(); argList args(argc, argv); //Pout.prefix() = '[' + name(Pstream::myProcNo()) + "] "; diff --git a/applications/test/primitivePatch/testPrimitivePatch.C b/applications/test/primitivePatch/testPrimitivePatch.C index e2336530e6..f85b65435b 100644 --- a/applications/test/primitivePatch/testPrimitivePatch.C +++ b/applications/test/primitivePatch/testPrimitivePatch.C @@ -220,10 +220,7 @@ int main(int argc, char *argv[]) # include "createPolyMesh.H" const word patchName = args[1]; - - label patchI = mesh.boundaryMesh().findPatchID(patchName); - - const polyPatch& patch = mesh.boundaryMesh()[patchI]; + const polyPatch& patch = mesh.boundaryMesh()[patchName]; Info<< "Patch:" << patch.name() << endl; diff --git a/applications/test/readCHEMKINIII/readCHEMKINIII.C b/applications/test/readCHEMKINIII/readCHEMKINIII.C index 9165f84839..7005f93592 100644 --- a/applications/test/readCHEMKINIII/readCHEMKINIII.C +++ b/applications/test/readCHEMKINIII/readCHEMKINIII.C @@ -35,7 +35,6 @@ using namespace Foam; int main(int argc, char *argv[]) { - argList::validArgs.clear(); argList::validArgs.append("CHEMKINIIIFile"); argList::addOption("thermo", "fileName"); argList args(argc, argv); diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C index b2649c1d2b..0b09b7859d 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C +++ b/applications/utilities/mesh/advanced/combinePatchFaces/combinePatchFaces.C @@ -38,7 +38,7 @@ Description E.g. to allow all faces on same patch to be merged: - combinePatchFaces .. cavity 180 -concaveAngle 90 + combinePatchFaces 180 -concaveAngle 90 \*---------------------------------------------------------------------------*/ @@ -428,15 +428,18 @@ int main(int argc, char *argv[]) { # include "addOverwriteOption.H" - argList::validArgs.append("feature angle [0..180]"); + argList::validArgs.append("featureAngle [0..180]"); argList::addOption ( "concaveAngle", - "[0..180]", - "specify concave angle [0..180] degrees (default: 30.0 degrees)" + "degrees", + "specify concave angle [0..180] (default: 30 degrees)" + ); + argList::addBoolOption + ( + "snapMesh", + "use system/snapMeshDict" ); - - argList::addBoolOption("snapMesh"); # include "setRootCase.H" # include "createTime.H" diff --git a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C index 5e0ce9248f..4a1a9b5a08 100644 --- a/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C +++ b/applications/utilities/mesh/advanced/refineWallLayer/refineWallLayer.C @@ -46,12 +46,18 @@ using namespace Foam; int main(int argc, char *argv[]) { -# include "addOverwriteOption.H" + #include "addOverwriteOption.H" argList::noParallel(); argList::validArgs.append("patchName"); argList::validArgs.append("edgeWeight"); - argList::addOption("useSet", "cellSet"); + argList::addOption + ( + "useSet", + "name", + "restrict cells to refine based on specified cellSet name" + ); + # include "setRootCase.H" # include "createTime.H" diff --git a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C index acaa9bf48d..0224943836 100644 --- a/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C +++ b/applications/utilities/mesh/advanced/refinementLevel/refinementLevel.C @@ -96,11 +96,15 @@ bool limitRefinementLevel int main(int argc, char *argv[]) { - argList::addBoolOption("readLevel"); + argList::addBoolOption + ( + "readLevel", + "read level from refinementLevel file" + ); -# include "setRootCase.H" -# include "createTime.H" -# include "createPolyMesh.H" + #include "setRootCase.H" + #include "createTime.H" + #include "createPolyMesh.H" Info<< "Dividing cells into bins depending on cell volume.\nThis will" << " correspond to refinement levels for a mesh with only 2x2x2" @@ -109,7 +113,7 @@ int main(int argc, char *argv[]) << " to allow for some truncation error." << nl << endl; - bool readLevel = args.optionFound("readLevel"); + const bool readLevel = args.optionFound("readLevel"); const scalarField& vols = mesh.cellVolumes(); diff --git a/applications/utilities/mesh/advanced/splitCells/splitCells.C b/applications/utilities/mesh/advanced/splitCells/splitCells.C index 19828287bc..3967a51516 100644 --- a/applications/utilities/mesh/advanced/splitCells/splitCells.C +++ b/applications/utilities/mesh/advanced/splitCells/splitCells.C @@ -517,17 +517,35 @@ void collectCuts int main(int argc, char *argv[]) { -# include "addOverwriteOption.H" + argList::addNote + ( + "split cells with flat faces" + ); + #include "addOverwriteOption.H" argList::noParallel(); - argList::addOption("set", "cellSet name"); - argList::addBoolOption("geometry"); - argList::addOption("tol", "edge snap tolerance"); - argList::validArgs.append("edge angle [0..360]"); + argList::validArgs.append("edgeAngle [0..360]"); -# include "setRootCase.H" -# include "createTime.H" + argList::addOption + ( + "set", + "name", + "split cells from specified cellSet only" + ); + argList::addBoolOption + ( + "geometry", + "use geometric cut for hexes as well" + ); + argList::addOption + ( + "tol", + "scalar", "edge snap tolerance (default 0.2)" + ); + + #include "setRootCase.H" + #include "createTime.H" runTime.functionObjects().off(); -# include "createPolyMesh.H" + #include "createPolyMesh.H" const word oldInstance = mesh.pointsInstance(); const scalar featureAngle = args.argRead(1); @@ -538,7 +556,7 @@ int main(int argc, char *argv[]) const bool geometry = args.optionFound("geometry"); const bool overwrite = args.optionFound("overwrite"); - scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); + const scalar edgeTol = args.optionLookupOrDefault("tol", 0.2); Info<< "Trying to split cells with internal angles > feature angle\n" << nl << "featureAngle : " << featureAngle << nl diff --git a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L index 2fb1c77043..16e3b9efe3 100644 --- a/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L +++ b/applications/utilities/mesh/conversion/ansysToFoam/ansysToFoam.L @@ -235,7 +235,12 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.append("ANSYS input file"); - argList::addOption("scale", "scale factor"); + argList::addOption + ( + "scale", + "factor", + "geometry scaling factor - default is 1" + ); argList args(argc, argv); @@ -244,8 +249,7 @@ int main(int argc, char *argv[]) FatalError.exit(); } - scalar scaleFactor = 1.0; - args.optionReadIfPresent("scale", scaleFactor); + const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); # include "createTime.H" diff --git a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C index 02b758b569..2de1b840e9 100644 --- a/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C +++ b/applications/utilities/mesh/conversion/cfx4ToFoam/cfx4ToFoam.C @@ -49,7 +49,12 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.append("CFX geom file"); - argList::addOption("scale", "scale factor"); + argList::addOption + ( + "scale", + "factor", + "geometry scaling factor - default is 1" + ); argList args(argc, argv); @@ -58,8 +63,7 @@ int main(int argc, char *argv[]) FatalError.exit(); } - scalar scaleFactor = 1.0; - args.optionReadIfPresent("scale", scaleFactor); + const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); # include "createTime.H" diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L index 02da5e6829..6c3a0c315a 100644 --- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L @@ -761,10 +761,30 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.append("Fluent mesh file"); - argList::addOption("scale", "scale factor"); - argList::addOption("ignoreCellGroups", "cell group names"); - argList::addOption("ignoreFaceGroups", "face group names"); - argList::addBoolOption("cubit"); + argList::addOption + ( + "scale", + "factor", + "geometry scaling factor - default is 1" + ); + argList::addOption + ( + "ignoreCellGroups", + "names", + "specify cell groups to ignore" + ); + argList::addOption + ( + "ignoreFaceGroups", + "names", + "specify face groups to ignore" + ); + + argList::addBoolOption + ( + "cubit", + "special parsing of (incorrect) cubit files" + ); argList args(argc, argv); diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/README.txt b/applications/utilities/mesh/conversion/fluentMeshToFoam/README.txt index 1dcfe05a8e..43c0963746 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/README.txt +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/README.txt @@ -20,8 +20,7 @@ Notes for fluentMeshToFoam with zone preservation with the cellZones(), faceZones() and pointZones() member functions - Example (Members from polyMesh.H and ZoneMesh.H): - label thisCellZoneID = mesh.cellZones().findZoneID("thisZoneName"); - const labelList& thisCellZone = mesh.cellZones()[thisCellZoneID]; + const labelList& thisCellZone = mesh.cellZones()["thisZoneName"]; - Zone integrity is preserved during mesh modification and decompomposition. diff --git a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L index 8c954cd1cb..619374396f 100644 --- a/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L +++ b/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshToFoam.L @@ -866,9 +866,22 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.append("Fluent mesh file"); - argList::addOption("scale", "scale factor"); - argList::addBoolOption("writeSets"); - argList::addBoolOption("writeZones"); + argList::addOption + ( + "scale", + "factor", + "geometry scaling factor - default is 1" + ); + argList::addBoolOption + ( + "writeSets", + "write cell zones and patches as sets" + ); + argList::addBoolOption + ( + "writeZones", + "write cell zones as zones" + ); argList args(argc, argv); @@ -877,8 +890,7 @@ int main(int argc, char *argv[]) FatalError.exit(); } - scalar scaleFactor = 1.0; - args.optionReadIfPresent("scale", scaleFactor); + const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); const bool writeSets = args.optionFound("writeSets"); const bool writeZones = args.optionFound("writeZones"); @@ -1554,7 +1566,7 @@ int main(int argc, char *argv[]) // interior boundaries are handled via faceSets // cell zones will only be written if there is more than one - if (writeZones && cellGroupZoneID.size()>1) + if (writeZones && cellGroupZoneID.size() > 1) { Info<< "Adding Zones" << endl; List pz(0); diff --git a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C index fbb2c3b12f..09e34235e5 100644 --- a/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C +++ b/applications/utilities/mesh/conversion/foamToStarMesh/foamToStarMesh.C @@ -69,7 +69,7 @@ int main(int argc, char *argv[]) ( "scale", "factor", - "specify geometry scaling factor - default is 1000 ([m] to [mm])" + "geometry scaling factor - default is 1000 ([m] to [mm])" ); argList::addBoolOption ( diff --git a/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C b/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C index 1616173a83..28ced25e87 100644 --- a/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C +++ b/applications/utilities/mesh/conversion/foamToSurface/foamToSurface.C @@ -61,8 +61,8 @@ int main(int argc, char *argv[]) argList::addOption ( "scale", - "scale", - "specify geometry scaling factor" + "factor", + "geometry scaling factor - default is 1" ); argList::addBoolOption ( diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L index 5e3b62bec5..c1d2b44e82 100644 --- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L +++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L @@ -628,7 +628,12 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.append("GAMBIT file"); - argList::addOption("scale", "scale factor"); + argList::addOption + ( + "scale", + "factor", + "geometry scaling factor - default is 1" + ); argList args(argc, argv); @@ -637,8 +642,7 @@ int main(int argc, char *argv[]) FatalError.exit(); } - scalar scaleFactor = 1.0; - args.optionReadIfPresent("scale", scaleFactor); + const scalar scaleFactor = args.optionLookupOrDefault("scale", 1.0); # include "createTime.H" diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C index 1bcc998ae9..a3f607ba0b 100644 --- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C +++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C @@ -716,7 +716,11 @@ int main(int argc, char *argv[]) { argList::noParallel(); argList::validArgs.append(".msh file"); - argList::addBoolOption("keepOrientation"); + argList::addBoolOption + ( + "keepOrientation", + "retain raw orientation for prisms/hexs" + ); # include "setRootCase.H" # include "createTime.H" diff --git a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C index 5adeb68236..ab764547a3 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C +++ b/applications/utilities/mesh/conversion/kivaToFoam/kivaToFoam.C @@ -46,7 +46,7 @@ Description using namespace Foam; -// Supported KIVA versions +//- Supported KIVA versions enum kivaVersions { kiva3, @@ -59,37 +59,51 @@ enum kivaVersions int main(int argc, char *argv[]) { argList::noParallel(); - argList::addOption("file", "fileName"); - argList::addOption("version", "[kiva3|kiva3v]"); - argList::addOption("zHeadMin", "scalar"); + argList::addOption + ( + "file", + "name", + "specify alternative input file name - default is otape17" + ); + argList::addOption + ( + "version", + "version", + "specify kiva version [kiva3|kiva3v] - default is '3v'" + ); + argList::addOption + ( + "zHeadMin", + "scalar", + "minimum z-height for transferring liner faces to cylinder-head" + ); # include "setRootCase.H" # include "createTime.H" - fileName kivaFileName("otape17"); - args.optionReadIfPresent("file", kivaFileName); + const fileName kivaFileName = + args.optionLookupOrDefault("file", "otape17"); kivaVersions kivaVersion = kiva3v; if (args.optionFound("version")) { - const word kivaVersionName = args["version"]; + const word versionName = args["version"]; - if (kivaVersionName == "kiva3") + if (versionName == "kiva3") { kivaVersion = kiva3; } - else if (kivaVersionName == "kiva3v") + else if (versionName == "kiva3v") { kivaVersion = kiva3v; } else { FatalErrorIn("main(int argc, char *argv[])") - << "KIVA file version " << kivaVersionName << " not supported" + << "KIVA file version " << versionName << " not supported" << exit(FatalError); args.printUsage(); - FatalError.exit(1); } } diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H index 6c50c02fcd..d4356c2cdc 100644 --- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H +++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H @@ -315,7 +315,7 @@ for (label i=0; i \n - Specify an alternative dictionary for the block mesh description. + Specify alternative dictionary for the block mesh description. \*---------------------------------------------------------------------------*/ @@ -80,7 +80,7 @@ int main(int argc, char *argv[]) ( "dict", "file", - "specify an alternative dictionary for the blockMesh description" + "specify alternative dictionary for the blockMesh description" ); # include "addRegionOption.H" diff --git a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H index c8a25abeec..fa25d815ea 100644 --- a/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H +++ b/applications/utilities/mesh/generation/blockMesh/mergePatchPairs.H @@ -27,10 +27,7 @@ // Master patch const word masterPatchName(mergePatchPairs[pairI].first()); const polyPatch& masterPatch = - mesh.boundaryMesh() - [ - mesh.boundaryMesh().findPatchID(masterPatchName) - ]; + mesh.boundaryMesh()[masterPatchName]; labelList isf(masterPatch.size()); @@ -51,10 +48,7 @@ // Slave patch const word slavePatchName(mergePatchPairs[pairI].second()); const polyPatch& slavePatch = - mesh.boundaryMesh() - [ - mesh.boundaryMesh().findPatchID(slavePatchName) - ]; + mesh.boundaryMesh()[slavePatchName]; labelList osf(slavePatch.size()); diff --git a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C index d325f159f9..1d0ce53e73 100644 --- a/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C +++ b/applications/utilities/mesh/generation/extrudeMesh/extrudeMesh.C @@ -123,7 +123,7 @@ void createDummyFvMeshFiles(const polyMesh& mesh, const word& regionName) label findPatchID(const polyBoundaryMesh& patches, const word& name) { - label patchID = patches.findPatchID(name); + const label patchID = patches.findPatchID(name); if (patchID == -1) { diff --git a/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C b/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C index dfcfb91471..6a3b7dd7ea 100644 --- a/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C +++ b/applications/utilities/mesh/generation/extrudeToRegionMesh/extrudeToRegionMesh.C @@ -632,7 +632,7 @@ int main(int argc, char *argv[]) argList::validArgs.append("thickness"); #include "addRegionOption.H" - argList::validOptions.insert("overwrite", ""); + #include "addOverwriteOption.H" #include "setRootCase.H" #include "createTime.H" #include "createNamedMesh.H" @@ -849,8 +849,7 @@ int main(int argc, char *argv[]) nExtrudeFaces = 0; forAll(zoneNames, i) { - label zoneI = faceZones.findZoneID(zoneNames[i]); - const faceZone& fz = faceZones[zoneI]; + const faceZone& fz = faceZones[zoneNames[i]]; forAll(fz, j) { extrudeTopPatchID[nExtrudeFaces] = interRegionTopPatch[i]; diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 957010dc10..788b154a6e 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -143,11 +143,19 @@ castellatedMeshControls } } - // Optional angle to detect small-large cell situation perpendicular - // to the surface. Is the angle of face w.r.t the local surface - // normal. Use on flat(ish) surfaces only. Otherwise - // leave out or set to negative number. + //- Optional angle to detect small-large cell situation + // perpendicular to the surface. Is the angle of face w.r.t. + // the local surface normal. Use on flat(ish) surfaces only. + // Otherwise leave out or set to negative number. //perpendicularAngle 10; + + + //- Optional faceZone and (for closed surface) cellZone with + // how to select the cells that are in the cellZone + // (inside / outside / specified insidePoint) + //faceZone sphere; + //cellZone sphere; + //cellZoneInside inside; //outside/insidePoint } } diff --git a/applications/utilities/mesh/manipulation/cellSet/Make/files b/applications/utilities/mesh/manipulation/cellSet/Make/files deleted file mode 100644 index f814349548..0000000000 --- a/applications/utilities/mesh/manipulation/cellSet/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -cellSet.C - -EXE = $(FOAM_APPBIN)/cellSet - diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSet.C b/applications/utilities/mesh/manipulation/cellSet/cellSet.C deleted file mode 100644 index 3eafef872b..0000000000 --- a/applications/utilities/mesh/manipulation/cellSet/cellSet.C +++ /dev/null @@ -1,196 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 . - -Description - Selects a cell set through a dictionary. - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "polyMesh.H" -#include "topoSetSource.H" -#include "cellSet.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Main program: - -int main(int argc, char *argv[]) -{ -# include "setRootCase.H" -# include "createTime.H" -# include "createPolyMesh.H" - - Info<< "Reading cellSetDict\n" << endl; - - IOdictionary cellSetDict - ( - IOobject - ( - "cellSetDict", - runTime.system(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - - const word setName(cellSetDict.lookup("name")); - const word actionName(cellSetDict.lookup("action")); - - topoSetSource::setAction action = topoSetSource::toAction(actionName); - - - // Create topoSetSources - PtrList topoSetSources - ( - cellSetDict.lookup("topoSetSources"), - topoSetSource::iNew(mesh) - ); - - - // Load set to work - autoPtr currentSetPtr(NULL); - IOobject::readOption r; - - if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR)) - { - r = IOobject::NO_READ; - - currentSetPtr.reset - ( - new cellSet - ( - mesh, - setName, - mesh.nCells()/10+1 // Reasonable size estimate. - ) - ); - } - else - { - r = IOobject::MUST_READ; - - currentSetPtr.reset - ( - new cellSet - ( - mesh, - setName, - r - ) - ); - } - - topoSet& currentSet = currentSetPtr(); - - Info<< "Set:" << currentSet.name() - << " Size:" << currentSet.size() - << " Action:" << actionName - << endl; - - if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST)) - { - // currentSet has been read so can make copy. - //backup(mesh, setName, currentSet, setName + "_old"); - } - - if (action == topoSetSource::CLEAR) - { - // Already handled above by not reading - } - else if (action == topoSetSource::INVERT) - { - currentSet.invert(currentSet.maxSize(mesh)); - } - else if (action == topoSetSource::LIST) - { - currentSet.writeDebug(Info, mesh, 100); - Info<< endl; - } - else if (action == topoSetSource::SUBSET) - { - // Apply topoSetSources to it to handle new/add/delete - forAll(topoSetSources, topoSetSourceI) - { - // Backup current set. - autoPtr oldSet - ( - topoSet::New - ( - currentSet.type(), - mesh, - currentSet.name() + "_old2", - currentSet - ) - ); - - currentSet.clear(); - - topoSetSources[topoSetSourceI].applyToSet - ( - topoSetSource::NEW, - currentSet - ); - - // Combine new value of currentSet with old one. - currentSet.subset(oldSet); - } - } - else - { - // Apply topoSetSources to it to handle new/add/delete - forAll(topoSetSources, topoSetSourceI) - { - topoSetSources[topoSetSourceI].applyToSet(action, currentSet); - } - } - - - if (action != topoSetSource::LIST) - { - // Set has changed. - - // Sync across coupled patches. - currentSet.sync(mesh); - - Info<< "Writing " << currentSet.name() - << " (size " << currentSet.size() << ") to " - << currentSet.instance()/currentSet.local() - /currentSet.name() - << endl << endl; - - currentSet.write(); - } - - Info<< "\nEnd\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/cellSet/cellSetDict b/applications/utilities/mesh/manipulation/cellSet/cellSetDict deleted file mode 100644 index 1108d6c3d9..0000000000 --- a/applications/utilities/mesh/manipulation/cellSet/cellSetDict +++ /dev/null @@ -1,149 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object cellSetDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Name of set to operate on -name c0; - -// One of clear/new/invert/add/delete|subset/list -action new; - -// Actions to apply to cellSet. These are all the topoSetSource's ending -// in ..ToCell (see the meshTools library). - -topoSetSources -( - // Select by explicitly providing cell labels - labelToCell - { - value (12 13 56); // labels of cells - } - - // Copy elements from cellSet - cellToCell - { - set c1; - } - - // Cells in cell zone - zoneToCell - { - name ".*Zone"; // Name of cellZone, regular expressions allowed - } - - // Cells on master or slave side of faceZone - faceZoneToCell - { - name ".*Zone"; // Name of faceZone, regular expressions allowed - option master; // master/slave - } - - // Select based on faceSet - faceToCell - { - set f0; // Name of faceSet - - //option neighbour; // cell with neighbour in faceSet - //option owner; // ,, owner - option any; // cell with any face in faceSet - //option all; // cell with all faces in faceSet - } - - // Select based on pointSet - pointToCell - { - set p0; - option any; // cell with any point in pointSet - //option all; // cell with all points in pointSet - } - - // Select based on cellShape - shapeToCell - { - type hex; // hex/wedge/prism/pyr/tet/tetWedge/splitHex - } - - // Cells with cell centre within box - boxToCell - { - box (0 0 0) (1 1 1); - } - - // Cells with cell centre within box - // Is skewed, rotated box. Given as origin and three spanning vectors. - rotatedBoxToCell - { - origin (0.2 0.2 -10); - i (0.2 0.2 0); - j (-0.2 0.2 0); - k (10 10 10); - } - - // Cells with centre within cylinder - cylinderToCell - { - p1 (0.2 0.2 -10); // start point on cylinder axis - p2 (0.2 0.2 0); // end point on cylinder axis - radius 5.0; - } - - // Cells with centre within sphere - sphereToCell - { - centre (0.2 0.2 -10); - radius 5.0; - } - - // Cells with cellCentre nearest to coordinates - nearestToCell - { - points ((0 0 0) (1 1 1)(2 2 2)); - } - - // Select based on surface - surfaceToCell - { - file "www.avl.com-geometry.stl"; - outsidePoints ((-99 -99 -59)); // definition of outside - includeCut false; // cells cut by surface - includeInside false; // cells not on outside of surf - includeOutside false; // cells on outside of surf - nearDistance -1; // cells with centre near surf - // (set to -1 if not used) - curvature 0.9; // cells within nearDistance - // and near surf curvature - // (set to -100 if not used) - } - - // values of field within certain range - fieldToCell - { - fieldName U; // Note: uses mag(U) since volVectorField - min 0.1; - max 0.5; - } - - // Mesh region (non-face connected part of (subset of)mesh) - regionToCell - { - set c0; // name of cellSet giving mesh subset - insidePoint (1 2 3); // point inside region to select - } - -); - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C index c426128e31..8662f404c1 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkMesh.C @@ -48,9 +48,21 @@ int main(int argc, char *argv[]) { timeSelector::addOptions(); # include "addRegionOption.H" - argList::addBoolOption("noTopology"); - argList::addBoolOption("allGeometry"); - argList::addBoolOption("allTopology"); + argList::addBoolOption + ( + "noTopology", + "skip checking the mesh topology" + ); + argList::addBoolOption + ( + "allGeometry", + "include bounding box checks" + ); + argList::addBoolOption + ( + "allTopology", + "include extra topology checks" + ); # include "setRootCase.H" # include "createTime.H" diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index e7a116b834..b3c4ca35e7 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -107,7 +107,7 @@ void modifyOrAddFace label findPatchID(const polyMesh& mesh, const word& name) { - label patchI = mesh.boundaryMesh().findPatchID(name); + const label patchI = mesh.boundaryMesh().findPatchID(name); if (patchI == -1) { @@ -124,8 +124,14 @@ label findPatchID(const polyMesh& mesh, const word& name) int main(int argc, char *argv[]) { -# include "addOverwriteOption.H" -# include "addRegionOption.H" + argList::addNote + ( + "Makes internal faces into boundary faces.\n" + "Does not duplicate points, unlike mergeOrSplitBaffles." + ); + + #include "addOverwriteOption.H" + #include "addRegionOption.H" argList::validArgs.append("faceZone"); argList::validArgs.append("(masterPatch slavePatch)"); @@ -136,10 +142,23 @@ int main(int argc, char *argv[]) ); argList::addBoolOption("internalFacesOnly"); -# include "setRootCase.H" -# include "createTime.H" + argList::addOption + ( + "additionalPatches", + "(patch2 .. patchN)", + "specify additional patches for creating baffles" + ); + argList::addBoolOption + ( + "internalFacesOnly", + "do not convert boundary faces" + ); + + #include "setRootCase.H" + #include "createTime.H" runTime.functionObjects().off(); -# include "createNamedMesh.H" + #include "createNamedMesh.H" + const word oldInstance = mesh.pointsInstance(); const polyBoundaryMesh& patches = mesh.boundaryMesh(); diff --git a/applications/utilities/mesh/manipulation/createPatch/createPatch.C b/applications/utilities/mesh/manipulation/createPatch/createPatch.C index c3ea78d0a1..43652bbbea 100644 --- a/applications/utilities/mesh/manipulation/createPatch/createPatch.C +++ b/applications/utilities/mesh/manipulation/createPatch/createPatch.C @@ -672,17 +672,17 @@ int main(int argc, char *argv[]) { const dictionary& dict = patchSources[addedI]; - word patchName(dict.lookup("name")); - + const word patchName(dict.lookup("name")); label destPatchI = patches.findPatchID(patchName); if (destPatchI == -1) { - FatalErrorIn(args.executable()) << "patch " << patchName - << " not added. Problem." << abort(FatalError); + FatalErrorIn(args.executable()) + << "patch " << patchName << " not added. Problem." + << abort(FatalError); } - word sourceType(dict.lookup("constructFrom")); + const word sourceType(dict.lookup("constructFrom")); if (sourceType == "patches") { @@ -710,7 +710,7 @@ int main(int argc, char *argv[]) } else if (sourceType == "set") { - word setName(dict.lookup("set")); + const word setName(dict.lookup("set")); faceSet faces(mesh, setName); diff --git a/applications/utilities/mesh/manipulation/faceSet/Make/files b/applications/utilities/mesh/manipulation/faceSet/Make/files deleted file mode 100644 index 13398e1071..0000000000 --- a/applications/utilities/mesh/manipulation/faceSet/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -faceSet.C - -EXE = $(FOAM_APPBIN)/faceSet - diff --git a/applications/utilities/mesh/manipulation/faceSet/Make/options b/applications/utilities/mesh/manipulation/faceSet/Make/options deleted file mode 100644 index 54c035b8f5..0000000000 --- a/applications/utilities/mesh/manipulation/faceSet/Make/options +++ /dev/null @@ -1,5 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lmeshTools diff --git a/applications/utilities/mesh/manipulation/faceSet/faceSet.C b/applications/utilities/mesh/manipulation/faceSet/faceSet.C deleted file mode 100644 index 7c97b95ef5..0000000000 --- a/applications/utilities/mesh/manipulation/faceSet/faceSet.C +++ /dev/null @@ -1,196 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 . - -Description - Selects a face set through a dictionary. - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "polyMesh.H" -#include "topoSetSource.H" -#include "faceSet.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Main program: - -int main(int argc, char *argv[]) -{ -# include "setRootCase.H" -# include "createTime.H" -# include "createPolyMesh.H" - - Info<< "Reading faceSetDict\n" << endl; - - IOdictionary faceSetDict - ( - IOobject - ( - "faceSetDict", - runTime.system(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - - const word setName(faceSetDict.lookup("name")); - const word actionName(faceSetDict.lookup("action")); - - topoSetSource::setAction action = topoSetSource::toAction(actionName); - - - // Create topoSetSources - PtrList topoSetSources - ( - faceSetDict.lookup("topoSetSources"), - topoSetSource::iNew(mesh) - ); - - - // Load set to work - autoPtr currentSetPtr(NULL); - IOobject::readOption r; - - if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR)) - { - r = IOobject::NO_READ; - - currentSetPtr.reset - ( - new faceSet - ( - mesh, - setName, - mesh.nFaces()/10+1 // Reasonable size estimate. - ) - ); - } - else - { - r = IOobject::MUST_READ; - - currentSetPtr.reset - ( - new faceSet - ( - mesh, - setName, - r - ) - ); - } - - topoSet& currentSet = currentSetPtr(); - - Info<< "Set:" << currentSet.name() - << " Size:" << currentSet.size() - << " Action:" << actionName - << endl; - - if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST)) - { - // currentSet has been read so can make copy. - //backup(mesh, setName, currentSet, setName + "_old"); - } - - if (action == topoSetSource::CLEAR) - { - // Already handled above by not reading - } - else if (action == topoSetSource::INVERT) - { - currentSet.invert(currentSet.maxSize(mesh)); - } - else if (action == topoSetSource::LIST) - { - currentSet.writeDebug(Info, mesh, 100); - Info<< endl; - } - else if (action == topoSetSource::SUBSET) - { - // Apply topoSetSources to it to handle new/add/delete - forAll(topoSetSources, topoSetSourceI) - { - // Backup current set. - autoPtr oldSet - ( - topoSet::New - ( - currentSet.type(), - mesh, - currentSet.name() + "_old2", - currentSet - ) - ); - - currentSet.clear(); - - topoSetSources[topoSetSourceI].applyToSet - ( - topoSetSource::NEW, - currentSet - ); - - // Combine new value of currentSet with old one. - currentSet.subset(oldSet); - } - } - else - { - // Apply topoSetSources to it to handle new/add/delete - forAll(topoSetSources, topoSetSourceI) - { - topoSetSources[topoSetSourceI].applyToSet(action, currentSet); - } - } - - - if (action != topoSetSource::LIST) - { - // Set has changed. - - // Sync across coupled patches. - currentSet.sync(mesh); - - Info<< "Writing " << currentSet.name() - << " (size " << currentSet.size() << ") to " - << currentSet.instance()/currentSet.local() - /currentSet.name() - << endl << endl; - - currentSet.write(); - } - - Info<< "\nEnd\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/faceSet/faceSetDict b/applications/utilities/mesh/manipulation/faceSet/faceSetDict deleted file mode 100644 index fd0ea0c09d..0000000000 --- a/applications/utilities/mesh/manipulation/faceSet/faceSetDict +++ /dev/null @@ -1,82 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object faceSetDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Name of set to operate on -name f0; - -// One of clear/new/invert/add/delete|subset/list -action new; - -// Actions to apply to pointSet. These are all the topoSetSource's ending -// in ..ToFace (see the meshTools library). -topoSetSources -( - // Copy elements from faceSet - faceToFace - { - set f1; - } - - // Select based on cellSet - cellToFace - { - set c0; - option all; // All faces of cells - //option both; // Only faces whose owner&neighbour are in cellSet - } - - // Select based on pointSet - pointToFace - { - set p0; - option any; // Faces using any point in pointSet - //option all // Faces with all points in pointSet - } - - // Select by explicitly providing face labels - labelToFace - { - value (12 13 56); // labels of faces - } - - // All faces of patch - patchToFace - { - name ".*Wall"; // Name of patch, regular expressions allowed - } - - // All faces of faceZone - zoneToFace - { - name ".*Zone1"; // Name of faceZone, regular expressions allowed - } - - // Faces with face centre within box - boxToFace - { - box (0 0 0) (1 1 1); - } - - // Faces with normal to within certain angle aligned with vector. - normalToFace - { - normal (0 0 1); // Vector - cos 0.01; // Tolerance (max cos of angle) - } -); - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H b/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H index 4098a89e6e..01f173f10c 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H +++ b/applications/utilities/mesh/manipulation/mergeMeshes/createTimes.H @@ -1,15 +1,22 @@ Info<< nl << "Create Times" << endl; + const fileName masterCasePath = masterCase.path(); + const fileName masterCaseName = masterCase.name(); + Time runTimeMaster ( Time::controlDictName, - rootDirMaster, - caseDirMaster + masterCasePath, + masterCaseName ); + const fileName addCasePath = addCase.path(); + const fileName addCaseName = addCase.name(); + Time runTimeToAdd ( Time::controlDictName, - rootDirToAdd, - caseDirToAdd + addCasePath, + addCaseName ); + diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C b/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C index 502f1b7dd6..af09f07933 100644 --- a/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C +++ b/applications/utilities/mesh/manipulation/mergeMeshes/mergeMeshes.C @@ -32,16 +32,74 @@ Description using namespace Foam; +void getRootCase(fileName& casePath) +{ + casePath.clean(); + + if (casePath.empty() || casePath == ".") + { + // handle degenerate form and '.' + casePath = cwd(); + } + else if (casePath[0] != '/' && casePath.name() == "..") + { + // avoid relative cases ending in '..' - makes for very ugly names + casePath = cwd()/casePath; + casePath.clean(); + } +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // Main program: int main(int argc, char *argv[]) { - argList::noParallel(); -# include "setRoots.H" -# include "createTimes.H" + argList::addNote + ( + "merge two meshes" + ); - Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << endl; + argList::noParallel(); + argList::validArgs.append("masterCase"); + argList::addOption + ( + "masterRegion", + "name", + "specify alternative mesh region for the master mesh" + ); + + argList::validArgs.append("addCase"); + argList::addOption + ( + "addRegion", + "name", + "specify alternative mesh region for the additional mesh" + ); + + argList args(argc, argv); + if (!args.check()) + { + FatalError.exit(); + } + + fileName masterCase = args[1]; + word masterRegion = polyMesh::defaultRegion; + args.optionReadIfPresent("masterRegion", masterRegion); + + fileName addCase = args[2]; + word addRegion = polyMesh::defaultRegion; + args.optionReadIfPresent("addRegion", addRegion); + + getRootCase(masterCase); + getRootCase(addCase); + + Info<< "Master: " << masterCase << " region " << masterRegion << nl + << "mesh to add: " << addCase << " region " << addRegion << endl; + + #include "createTimes.H" + + Info<< "Reading master mesh for time = " << runTimeMaster.timeName() << nl; Info<< "Create mesh\n" << endl; mergePolyMesh masterMesh @@ -55,7 +113,7 @@ int main(int argc, char *argv[]) ); - Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << endl; + Info<< "Reading mesh to add for time = " << runTimeToAdd.timeName() << nl; Info<< "Create mesh\n" << endl; polyMesh meshToAdd diff --git a/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H b/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H deleted file mode 100644 index 3d1fdd0132..0000000000 --- a/applications/utilities/mesh/manipulation/mergeMeshes/setRoots.H +++ /dev/null @@ -1,32 +0,0 @@ - argList::validArgs.clear(); - - argList::validArgs.append("master root"); - argList::validArgs.append("master case"); - argList::addOption("masterRegion", "name"); - - argList::validArgs.append("root to add"); - argList::validArgs.append("case to add"); - argList::addOption("addRegion", "name"); - - argList args(argc, argv); - - if (!args.check()) - { - FatalError.exit(); - } - - fileName rootDirMaster = args[1]; - fileName caseDirMaster = args[2]; - word masterRegion = polyMesh::defaultRegion; - args.optionReadIfPresent("masterRegion", masterRegion); - - fileName rootDirToAdd = args[3]; - fileName caseDirToAdd = args[4]; - word addRegion = polyMesh::defaultRegion; - args.optionReadIfPresent("addRegion", addRegion); - - Info<< "Master: " << rootDirMaster << " " << caseDirMaster - << " region " << masterRegion << nl - << "mesh to add: " << rootDirToAdd << " " << caseDirToAdd - << " region " << addRegion << endl; - diff --git a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C index d7a24a2bf9..399fcb0421 100644 --- a/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C +++ b/applications/utilities/mesh/manipulation/mergeOrSplitBaffles/mergeOrSplitBaffles.C @@ -221,15 +221,30 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces) int main(int argc, char *argv[]) { -# include "addOverwriteOption.H" -# include "addRegionOption.H" - argList::addBoolOption("split"); - argList::addBoolOption("detectOnly"); + argList::addNote + ( + "Detect faces that share points (baffles).\n" + "Merge them or duplicate the points." + ); -# include "setRootCase.H" -# include "createTime.H" + #include "addOverwriteOption.H" + #include "addRegionOption.H" + argList::addBoolOption + ( + "detectOnly", + "find baffles only, but do not merge or split them" + ); + argList::addBoolOption + ( + "split", + "topologically split duplicate surfaces" + ); + + #include "setRootCase.H" + #include "createTime.H" runTime.functionObjects().off(); -# include "createNamedMesh.H" + #include "createNamedMesh.H" + const word oldInstance = mesh.pointsInstance(); const bool split = args.optionFound("split"); @@ -248,12 +263,10 @@ int main(int argc, char *argv[]) if (detectOnly) { findBaffles(mesh, boundaryFaces); - return 0; } - // Read objects in time directory IOobjectList objects(mesh, runTime.timeName()); diff --git a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C index 2cb7ef6c5b..55a2238757 100644 --- a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C +++ b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C @@ -110,7 +110,6 @@ labelList parseVertices(const string& line) int main(int argc, char *argv[]) { argList::noParallel(); - argList::validArgs.clear(); argList::validArgs.append("OBJ file"); argList::validArgs.append("output VTK file"); argList args(argc, argv); diff --git a/applications/utilities/mesh/manipulation/pointSet/Make/files b/applications/utilities/mesh/manipulation/pointSet/Make/files deleted file mode 100644 index 321ed23bf4..0000000000 --- a/applications/utilities/mesh/manipulation/pointSet/Make/files +++ /dev/null @@ -1,4 +0,0 @@ -pointSet.C - -EXE = $(FOAM_APPBIN)/pointSet - diff --git a/applications/utilities/mesh/manipulation/pointSet/Make/options b/applications/utilities/mesh/manipulation/pointSet/Make/options deleted file mode 100644 index 54c035b8f5..0000000000 --- a/applications/utilities/mesh/manipulation/pointSet/Make/options +++ /dev/null @@ -1,5 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lmeshTools diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSet.C b/applications/utilities/mesh/manipulation/pointSet/pointSet.C deleted file mode 100644 index 8219ec41b6..0000000000 --- a/applications/utilities/mesh/manipulation/pointSet/pointSet.C +++ /dev/null @@ -1,196 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 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 . - -Description - Selects a point set through a dictionary. - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "Time.H" -#include "polyMesh.H" -#include "topoSetSource.H" -#include "pointSet.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Main program: - -int main(int argc, char *argv[]) -{ -# include "setRootCase.H" -# include "createTime.H" -# include "createPolyMesh.H" - - Info<< "Reading pointSetDict\n" << endl; - - IOdictionary pointSetDict - ( - IOobject - ( - "pointSetDict", - runTime.system(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - - const word setName(pointSetDict.lookup("name")); - const word actionName(pointSetDict.lookup("action")); - - topoSetSource::setAction action = topoSetSource::toAction(actionName); - - - // Create topoSetSources - PtrList topoSetSources - ( - pointSetDict.lookup("topoSetSources"), - topoSetSource::iNew(mesh) - ); - - - // Load set to work - autoPtr currentSetPtr(NULL); - IOobject::readOption r; - - if ((action == topoSetSource::NEW) || (action == topoSetSource::CLEAR)) - { - r = IOobject::NO_READ; - - currentSetPtr.reset - ( - new pointSet - ( - mesh, - setName, - mesh.nPoints()/10+1 // Reasonable size estimate. - ) - ); - } - else - { - r = IOobject::MUST_READ; - - currentSetPtr.reset - ( - new pointSet - ( - mesh, - setName, - r - ) - ); - } - - topoSet& currentSet = currentSetPtr(); - - Info<< "Set:" << currentSet.name() - << " Size:" << currentSet.size() - << " Action:" << actionName - << endl; - - if ((r == IOobject::MUST_READ) && (action != topoSetSource::LIST)) - { - // currentSet has been read so can make copy. - //backup(mesh, setName, currentSet, setName + "_old"); - } - - if (action == topoSetSource::CLEAR) - { - // Already handled above by not reading - } - else if (action == topoSetSource::INVERT) - { - currentSet.invert(currentSet.maxSize(mesh)); - } - else if (action == topoSetSource::LIST) - { - currentSet.writeDebug(Info, mesh, 100); - Info<< endl; - } - else if (action == topoSetSource::SUBSET) - { - // Apply topoSetSources to it to handle new/add/delete - forAll(topoSetSources, topoSetSourceI) - { - // Backup current set. - autoPtr oldSet - ( - topoSet::New - ( - currentSet.type(), - mesh, - currentSet.name() + "_old2", - currentSet - ) - ); - - currentSet.clear(); - - topoSetSources[topoSetSourceI].applyToSet - ( - topoSetSource::NEW, - currentSet - ); - - // Combine new value of currentSet with old one. - currentSet.subset(oldSet); - } - } - else - { - // Apply topoSetSources to it to handle new/add/delete - forAll(topoSetSources, topoSetSourceI) - { - topoSetSources[topoSetSourceI].applyToSet(action, currentSet); - } - } - - - if (action != topoSetSource::LIST) - { - // Set has changed. - - // Sync across coupled patches. - currentSet.sync(mesh); - - Info<< "Writing " << currentSet.name() - << " (size " << currentSet.size() << ") to " - << currentSet.instance()/currentSet.local() - /currentSet.name() - << endl << endl; - - currentSet.write(); - } - - Info<< "\nEnd\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/pointSet/pointSetDict b/applications/utilities/mesh/manipulation/pointSet/pointSetDict deleted file mode 100644 index 7d4dd656ae..0000000000 --- a/applications/utilities/mesh/manipulation/pointSet/pointSetDict +++ /dev/null @@ -1,84 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.6 | -| \\ / A nd | Web: http://www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - object pointSetDict; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Name of set to operate on -name p0; - -// One of clear/new/invert/add/delete|subset/list -action new; - -// Actions to apply to pointSet. These are all the topoSetSource's ending -// in ..ToPoint (see the meshTools library). -topoSetSources -( - // Copy elements from pointSet - pointToPoint - { - set p1; - } - - // Select based on cellSet - cellToPoint - { - set c0; - option all; // all points of cell - } - - // Select based on faceSet - faceToPoint - { - set f0; // name of faceSet - option all; // all points of face - } - - // Select by explicitly providing point labels - labelToPoint - { - value (12 13 56); // labels of points - } - - // All points in pointzone - zoneToPoint - { - name ".*Zone"; // name of pointZone, regular expressions allowed - } - - // Points nearest to coordinates - nearestToPoint - { - points ((0 0 0) (1 1 1)); - } - - // Points with coordinate within box - boxToPoint - { - box (0 0 0) (1 1 1); - } - - // Select based on surface - surfaceToPoint - { - file "www.avl.com-geometry.stl"; - nearDistance 0.1; // points near to surface - includeInside false; // points on inside of surface - // (requires closed surface with consistent - // normals) - includeOutside false; // ,, outside ,, - } -); - -// ************************************************************************* // diff --git a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C index 783848d09b..ba3170d281 100644 --- a/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C +++ b/applications/utilities/mesh/manipulation/refineMesh/refineMesh.C @@ -290,18 +290,26 @@ label twoDNess(const polyMesh& mesh) int main(int argc, char *argv[]) { -# include "addOverwriteOption.H" - argList::addBoolOption("dict"); + argList::addNote + ( + "refine cells in multiple directions" + ); -# include "setRootCase.H" -# include "createTime.H" + #include "addOverwriteOption.H" + argList::addBoolOption + ( + "dict", + "refine according to system/refineMeshDict" + ); + + #include "setRootCase.H" + #include "createTime.H" runTime.functionObjects().off(); -# include "createPolyMesh.H" + #include "createPolyMesh.H" const word oldInstance = mesh.pointsInstance(); printEdgeStats(mesh); - // // Read/construct control dictionary // diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C index bfb9f4a436..495e07f290 100644 --- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C +++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C @@ -365,9 +365,21 @@ autoPtr reorderMesh int main(int argc, char *argv[]) { - argList::addBoolOption("blockOrder"); - argList::addBoolOption("orderPoints"); - argList::addBoolOption("writeMaps"); + argList::addBoolOption + ( + "blockOrder", + "order cells into regions (using decomposition)" + ); + argList::addBoolOption + ( + "orderPoints", + "order points into internal and boundary points" + ); + argList::addBoolOption + ( + "writeMaps", + "write cellMap, faceMap, pointMap in polyMesh/" + ); # include "addOverwriteOption.H" # include "addTimeOptions.H" diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C index d8c216c662..308319f2e6 100644 --- a/applications/utilities/mesh/manipulation/setSet/setSet.C +++ b/applications/utilities/mesh/manipulation/setSet/setSet.C @@ -439,6 +439,7 @@ bool doCommand const word& actionName, const bool writeVTKFile, const bool writeCurrentTime, + const bool noSync, Istream& is ) { @@ -581,7 +582,7 @@ bool doCommand // Set will have been modified. // Synchronize for coupled patches. - currentSet.sync(mesh); + if (!noSync) currentSet.sync(mesh); // Write if (writeVTKFile) @@ -828,7 +829,17 @@ int main(int argc, char *argv[]) # include "addRegionOption.H" argList::addBoolOption("noVTK", "do not write VTK files"); argList::addBoolOption("loop", "execute batch commands for all timesteps"); - argList::addOption("batch", "file"); + argList::addOption + ( + "batch", + "file", + "process in batch mode, using input from specified file" + ); + argList::addBoolOption + ( + "noSync", + "do not synchronise selection across coupled patches" + ); # include "setRootCase.H" # include "createTime.H" @@ -837,6 +848,7 @@ int main(int argc, char *argv[]) const bool writeVTK = !args.optionFound("noVTK"); const bool loop = args.optionFound("loop"); const bool batch = args.optionFound("batch"); + const bool noSync = args.optionFound("noSync"); if (loop && !batch) { @@ -1003,7 +1015,8 @@ int main(int argc, char *argv[]) setName, actionName, writeVTK, - loop, // if in looping mode dump sets to time directory + loop, // if in looping mode dump sets to time directory + noSync, is ); diff --git a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C index 8a30d3bdf8..5a2cdfdccc 100644 --- a/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C +++ b/applications/utilities/mesh/manipulation/setsToZones/setsToZones.C @@ -57,14 +57,23 @@ using namespace Foam; int main(int argc, char *argv[]) { - argList::addBoolOption("noFlipMap"); + argList::addNote + ( + "add point/face/cell Zones from similar named point/face/cell Sets" + ); -# include "addRegionOption.H" -# include "addTimeOptions.H" -# include "setRootCase.H" -# include "createTime.H" + argList::addBoolOption + ( + "noFlipMap", + "ignore orientation of faceSet" + ); - bool noFlipMap = args.optionFound("noFlipMap"); + #include "addRegionOption.H" + #include "addTimeOptions.H" + #include "setRootCase.H" + #include "createTime.H" + + const bool noFlipMap = args.optionFound("noFlipMap"); // Get times list instantList Times = runTime.times(); @@ -73,11 +82,11 @@ int main(int argc, char *argv[]) label endTime = Times.size(); // check -time and -latestTime options -# include "checkTimeOption.H" + #include "checkTimeOption.H" runTime.setTime(Times[startTime], startTime); -# include "createNamedPolyMesh.H" + #include "createNamedPolyMesh.H" // Search for list of objects for the time of the mesh word setsInstance = runTime.findInstance @@ -153,9 +162,19 @@ int main(int argc, char *argv[]) DynamicList