From 6b15244de34e25bfb81c5429c416f9bd717d9f74 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 11 Jun 2018 11:40:40 +0200 Subject: [PATCH 1/5] STYLE: Enum instead of NamedEnum for fileOperation --- .../fileOperation/fileOperation.C | 44 +++++++++---------- .../fileOperation/fileOperation.H | 4 +- 2 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C index e66c6fc019..d9f25fd2e2 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C +++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.C @@ -43,43 +43,39 @@ namespace Foam defineTypeNameAndDebug(fileOperation, 0); defineRunTimeSelectionTable(fileOperation, word); - template<> - const char* Foam::NamedEnum - < - fileOperation::pathType, - 12 - >::names[] = - { - "notFound", - "absolute", - "objectPath", - "writeObject", - "uncollatedProc", - "globalProc", - "localProc", - "parentObjectPath", - "findInstance", - "uncollatedProcInstance", - "globalProcInstance", - "localProcInstance" - }; - const NamedEnum fileOperation::pathTypeNames_; - word fileOperation::defaultFileHandler ( - debug::optimisationSwitches().lookupOrAddDefault + debug::optimisationSwitches().lookupOrAddDefault ( "fileHandler", //Foam::fileOperations::uncollatedFileOperation::typeName, - word("uncollated"), + "uncollated", false, false ) ); } + Foam::word Foam::fileOperation::processorsBaseDir = "processors"; +const Foam::Enum +Foam::fileOperation::pathTypeNames_ +({ + { fileOperation::NOTFOUND, "notFound" }, + { fileOperation::ABSOLUTE, "absolute" }, + { fileOperation::OBJECT, "objectPath" }, + { fileOperation::WRITEOBJECT, "writeObject" }, + { fileOperation::PROCUNCOLLATED, "uncollatedProc" }, + { fileOperation::PROCBASEOBJECT, "globalProc" }, + { fileOperation::PROCOBJECT, "localProc" }, + { fileOperation::PARENTOBJECT, "parentObjectPath" }, + { fileOperation::FINDINSTANCE, "findInstance" }, + { fileOperation::PROCUNCOLLATEDINSTANCE, "uncollatedProcInstance" }, + { fileOperation::PROCBASEINSTANCE, "globalProcInstance" }, + { fileOperation::PROCINSTANCE, "localProcInstance" } +}); + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // diff --git a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.H b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.H index 6f1f2c64f0..971cf72853 100644 --- a/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.H +++ b/src/OpenFOAM/global/fileOperations/fileOperation/fileOperation.H @@ -47,7 +47,7 @@ Description #include "labelList.H" #include "Switch.H" #include "tmpNrc.H" -#include "NamedEnum.H" +#include "Enum.H" #include "Tuple2.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,7 +93,7 @@ public: PROCBASEINSTANCE, // as PROCBASEOBJECT but with instance PROCINSTANCE // as PROCOBJECT but with instance }; - static const NamedEnum pathTypeNames_; + static const Enum pathTypeNames_; typedef Tuple2> dirIndex; typedef List dirIndexList; From 5aa955c9d28d72b9d4e0c2a53a57f906bfa81289 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 11 Jun 2018 11:53:29 +0200 Subject: [PATCH 2/5] GIT: include submodules in develop-pre-release branch --- .gitmodules | 2 +- modules/avalanche | 1 + modules/catalyst | 1 + modules/cfmesh | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) create mode 160000 modules/avalanche create mode 160000 modules/catalyst create mode 160000 modules/cfmesh diff --git a/.gitmodules b/.gitmodules index d0186d99a3..866de836a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,6 @@ [submodule "avalanche"] path = modules/avalanche url = https://develop.openfoam.com/Community/avalanche.git -[submodule "modules/catalyst"] +[submodule "catalyst"] path = modules/catalyst url = https://develop.openfoam.com/Community/catalyst.git diff --git a/modules/avalanche b/modules/avalanche new file mode 160000 index 0000000000..6e6e105844 --- /dev/null +++ b/modules/avalanche @@ -0,0 +1 @@ +Subproject commit 6e6e105844897d4bf780bbc8d14031bc827e4b04 diff --git a/modules/catalyst b/modules/catalyst new file mode 160000 index 0000000000..eaa7f6836a --- /dev/null +++ b/modules/catalyst @@ -0,0 +1 @@ +Subproject commit eaa7f6836a1950fe8d40c13952aa85a1062f7f91 diff --git a/modules/cfmesh b/modules/cfmesh new file mode 160000 index 0000000000..288f05e08f --- /dev/null +++ b/modules/cfmesh @@ -0,0 +1 @@ +Subproject commit 288f05e08f07e693d4222e7b84ea12430947e5bf From dc521b95dfbb967ff3b94d63f9b70f70293ea239 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 30 May 2018 12:03:17 +0200 Subject: [PATCH 3/5] STYLE: consistent use of '= delete' --- .../compressibleInterPhaseTransportModel.H | 8 ++++---- .../dynamicCode/codedPoints0MotionSolverTemplate.H | 13 ++++++++----- .../Circulators/CirculatorBase/CirculatorBase.H | 3 ++- src/OpenFOAM/global/debug/simpleRegIOobject.H | 3 +-- .../meshes/polyMesh/syncTools/dummyTransform.H | 4 +++- .../kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.H | 11 ++++++----- .../powerLawLopesdaCosta/powerLawLopesdaCosta.H | 9 +++++---- .../ChemistryCombustion/ChemistryCombustion.H | 6 ++++-- .../codedPoints0/codedPoints0MotionSolver.H | 10 ++++------ .../polyMeshFilter/polyMeshFilterSettings.H | 2 +- src/engine/engineTime/freePiston/freePiston.H | 11 +++++------ .../PhaseLimitStabilization.H | 11 +++++------ .../waxSolventViscosity/waxSolventViscosity.C | 6 ------ .../waxSolventViscosity/waxSolventViscosity.H | 8 ++++---- .../waxSolventEvaporation/waxSolventEvaporation.C | 2 +- .../waxSolventEvaporation/waxSolventEvaporation.H | 10 +++++----- .../structuredRenumber/OppositeFaceCellWave.H | 3 +-- .../BasicChemistryModel/BasicChemistryModel.H | 6 ++++-- 18 files changed, 63 insertions(+), 63 deletions(-) diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H index b758ce3f9a..72eabf12d1 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H @@ -92,14 +92,14 @@ class compressibleInterPhaseTransportModel // Private Member Functions - //- Disallow default bitwise copy construct + //- No copy construct compressibleInterPhaseTransportModel ( const compressibleInterPhaseTransportModel& - ); + ) = delete; - //- Disallow default bitwise assignment - void operator=(const compressibleInterPhaseTransportModel&); + //- No copy assignment + void operator=(const compressibleInterPhaseTransportModel&) = delete; public: diff --git a/etc/codeTemplates/dynamicCode/codedPoints0MotionSolverTemplate.H b/etc/codeTemplates/dynamicCode/codedPoints0MotionSolverTemplate.H index 0a6129c501..67bcf4e67e 100644 --- a/etc/codeTemplates/dynamicCode/codedPoints0MotionSolverTemplate.H +++ b/etc/codeTemplates/dynamicCode/codedPoints0MotionSolverTemplate.H @@ -54,11 +54,14 @@ class ${typeName}Points0MotionSolver { // Private Member Functions - //- Disallow default bitwise copy construct - ${typeName}Points0MotionSolver(const ${typeName}Points0MotionSolver&); + //- No copy construct + ${typeName}Points0MotionSolver + ( + const ${typeName}Points0MotionSolver& + ) = delete; - //- Disallow default bitwise assignment - void operator=(const ${typeName}Points0MotionSolver&); + //- No copy assignment + void operator=(const ${typeName}Points0MotionSolver&) = delete; public: @@ -88,7 +91,7 @@ public: //- Solve for motion virtual void solve() - {}; + {} }; diff --git a/src/OpenFOAM/containers/Circulators/CirculatorBase/CirculatorBase.H b/src/OpenFOAM/containers/Circulators/CirculatorBase/CirculatorBase.H index d1ab166bab..e9d503c6e5 100644 --- a/src/OpenFOAM/containers/Circulators/CirculatorBase/CirculatorBase.H +++ b/src/OpenFOAM/containers/Circulators/CirculatorBase/CirculatorBase.H @@ -60,7 +60,8 @@ public: // Constructors //- Construct null - CirculatorBase(){}; + CirculatorBase() + {} }; diff --git a/src/OpenFOAM/global/debug/simpleRegIOobject.H b/src/OpenFOAM/global/debug/simpleRegIOobject.H index c7ede5e818..f1530ab244 100644 --- a/src/OpenFOAM/global/debug/simpleRegIOobject.H +++ b/src/OpenFOAM/global/debug/simpleRegIOobject.H @@ -66,8 +66,7 @@ public: //- Destructor - virtual ~simpleRegIOobject() - {}; + virtual ~simpleRegIOobject() = default; // Member Functions diff --git a/src/OpenFOAM/meshes/polyMesh/syncTools/dummyTransform.H b/src/OpenFOAM/meshes/polyMesh/syncTools/dummyTransform.H index 18aff56892..c7e54bdf53 100644 --- a/src/OpenFOAM/meshes/polyMesh/syncTools/dummyTransform.H +++ b/src/OpenFOAM/meshes/polyMesh/syncTools/dummyTransform.H @@ -51,10 +51,12 @@ public: const bool forward, List& fld ) const - {}; + {} + template void operator()(const coupledPolyPatch& cpp, Field& fld) const {} + template class Container> void operator()(const coupledPolyPatch& cpp, Container& map) const {} diff --git a/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.H b/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.H index a9f2affd6b..d1366d26ee 100644 --- a/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.H +++ b/src/atmosphericModels/kEpsilonLopesdaCosta/kEpsilonLopesdaCosta.H @@ -84,9 +84,11 @@ class kEpsilonLopesdaCosta { // Private Member Functions - // Disallow default bitwise copy construct and assignment - kEpsilonLopesdaCosta(const kEpsilonLopesdaCosta&); - void operator=(const kEpsilonLopesdaCosta&); + //- No copy construct + kEpsilonLopesdaCosta(const kEpsilonLopesdaCosta&) = delete; + + //- No copy assignment + void operator=(const kEpsilonLopesdaCosta&) = delete; protected: @@ -175,8 +177,7 @@ public: //- Destructor - virtual ~kEpsilonLopesdaCosta() - {} + virtual ~kEpsilonLopesdaCosta() = default; // Member Functions diff --git a/src/atmosphericModels/porosityModels/powerLawLopesdaCosta/powerLawLopesdaCosta.H b/src/atmosphericModels/porosityModels/powerLawLopesdaCosta/powerLawLopesdaCosta.H index f19677c808..4957f2641b 100644 --- a/src/atmosphericModels/porosityModels/powerLawLopesdaCosta/powerLawLopesdaCosta.H +++ b/src/atmosphericModels/porosityModels/powerLawLopesdaCosta/powerLawLopesdaCosta.H @@ -146,11 +146,12 @@ class powerLawLopesdaCosta const vectorField& U ) const; - //- Disallow default bitwise copy construct - powerLawLopesdaCosta(const powerLawLopesdaCosta&); - //- Disallow default bitwise assignment - void operator=(const powerLawLopesdaCosta&); + //- No copy construct + powerLawLopesdaCosta(const powerLawLopesdaCosta&) = delete; + + //- No copy assignment + void operator=(const powerLawLopesdaCosta&) = delete; public: diff --git a/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H b/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H index 20beb790e4..8a1d78aca1 100644 --- a/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H +++ b/src/combustionModels/CombustionModel/ChemistryCombustion/ChemistryCombustion.H @@ -56,8 +56,10 @@ class ChemistryCombustion // Private Member Functions //- Construct as copy (not implemented) - ChemistryCombustion(const ChemistryCombustion&) = - delete; + ChemistryCombustion + ( + const ChemistryCombustion& + ) = delete; //- No copy assignment void operator=(const ChemistryCombustion&) = delete; diff --git a/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.H b/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.H index f8fa5e75d4..d095d9481b 100644 --- a/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.H +++ b/src/dynamicMesh/motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.H @@ -117,13 +117,11 @@ protected: virtual const dictionary& codeDict() const; -private: + //- No copy assignment construct + codedPoints0MotionSolver(const codedPoints0MotionSolver&) = delete; - //- Disallow default bitwise copy construct - codedPoints0MotionSolver(const codedPoints0MotionSolver&); - - //- Disallow default bitwise assignment - void operator=(const codedPoints0MotionSolver&); + //- No copy assignment + void operator=(const codedPoints0MotionSolver&) = delete; public: diff --git a/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H b/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H index 93bc4bd3b9..8a0419363e 100644 --- a/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H +++ b/src/dynamicMesh/polyMeshFilter/polyMeshFilterSettings.H @@ -111,7 +111,7 @@ public: //- Destructor - ~polyMeshFilterSettings(){}; + ~polyMeshFilterSettings() = default; // Member Functions diff --git a/src/engine/engineTime/freePiston/freePiston.H b/src/engine/engineTime/freePiston/freePiston.H index 47fff4348d..d01ead612b 100644 --- a/src/engine/engineTime/freePiston/freePiston.H +++ b/src/engine/engineTime/freePiston/freePiston.H @@ -81,11 +81,11 @@ class freePiston // Private Member Functions - //- Disallow default bitwise copy construct - freePiston(const freePiston&); + //- No copy construct + freePiston(const freePiston&) = delete; - //- Disallow default bitwise assignment - void operator=(const freePiston&); + //- No copy assignment + void operator=(const freePiston&) = delete; public: @@ -108,8 +108,7 @@ public: ); //- Destructor - virtual ~freePiston() - {} + virtual ~freePiston() = default; // Member Functions diff --git a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H index a066303f47..fbde975d84 100644 --- a/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H +++ b/src/fvOptions/sources/derived/phaseLimitStabilization/PhaseLimitStabilization.H @@ -89,11 +89,11 @@ class PhaseLimitStabilization // Private Member Functions - //- Disallow default bitwise copy construct - PhaseLimitStabilization(const PhaseLimitStabilization&); + //- No copy construct + PhaseLimitStabilization(const PhaseLimitStabilization&) = delete; - //- Disallow default bitwise assignment - void operator=(const PhaseLimitStabilization&); + //- No copy assignment + void operator=(const PhaseLimitStabilization&) = delete; public: @@ -115,8 +115,7 @@ public: //- Destructor - virtual ~PhaseLimitStabilization() - {} + virtual ~PhaseLimitStabilization() = default; // Member Functions diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C index b3c4af2864..4d4660cce7 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C @@ -161,12 +161,6 @@ waxSolventViscosity::waxSolventViscosity {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -waxSolventViscosity::~waxSolventViscosity() -{} - - // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // void waxSolventViscosity::correct diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H index e437671772..517a17452b 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H @@ -59,10 +59,10 @@ class waxSolventViscosity //- Correct the mixture viscosity void correctMu(); - //- Disallow default bitwise copy construct - waxSolventViscosity(const waxSolventViscosity&); + //- No copy construct + waxSolventViscosity(const waxSolventViscosity&) = delete; - //- Disallow default bitwise assignment + //- No copy assignment void operator=(const waxSolventViscosity&) = delete; @@ -101,7 +101,7 @@ public: //- Destructor - virtual ~waxSolventViscosity(); + virtual ~waxSolventViscosity() = default; // Member Functions diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C index 0228c4a54c..06d976e1b4 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C @@ -127,7 +127,7 @@ waxSolventEvaporation::waxSolventEvaporation deltaMin_(readScalar(coeffDict_.lookup("deltaMin"))), L_(readScalar(coeffDict_.lookup("L"))), TbFactor_(coeffDict_.lookupOrDefault("TbFactor", 1.1)), - YInfZero_(coeffDict_.lookupOrDefault("YInfZero", false)), + YInfZero_(coeffDict_.lookupOrDefault("YInfZero", false)), activityCoeff_ ( Function1::New("activityCoeff", coeffDict_) diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.H b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.H index 94d1a57e42..bec7d6e23f 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.H +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.H @@ -58,11 +58,11 @@ class waxSolventEvaporation { // Private member functions - //- Disallow default bitwise copy construct - waxSolventEvaporation(const waxSolventEvaporation&); + //- No copy construct + waxSolventEvaporation(const waxSolventEvaporation&) = delete; - //- Disallow default bitwise assignment - void operator=(const waxSolventEvaporation&); + //- No copy assignment + void operator=(const waxSolventEvaporation&) = delete; protected: @@ -92,7 +92,7 @@ protected: const scalar TbFactor_; //- Switch to treat YInf as zero - Switch YInfZero_; + bool YInfZero_; //- Activity coefficient as a function of solvent mole fraction autoPtr> activityCoeff_; diff --git a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H index 1270107082..584361e95d 100644 --- a/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H +++ b/src/renumber/renumberMethods/structuredRenumber/OppositeFaceCellWave.H @@ -108,8 +108,7 @@ public: //- Destructor - virtual ~OppositeFaceCellWave() - {}; + virtual ~OppositeFaceCellWave() = default; // Member Functions diff --git a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H index 9fc7e43cc5..757498ffd0 100644 --- a/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H +++ b/src/thermophysicalModels/chemistryModel/chemistryModel/BasicChemistryModel/BasicChemistryModel.H @@ -60,8 +60,10 @@ class BasicChemistryModel // Private Member Functions //- Construct as copy (not implemented) - BasicChemistryModel(const BasicChemistryModel&) = - delete; + BasicChemistryModel + ( + const BasicChemistryModel& + ) = delete; //- No copy assignment void operator=(const BasicChemistryModel&) = delete; From 3bcbb1615b907c8b81ff5fcf274ff2ac83137316 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Tue, 12 Jun 2018 08:16:06 +0200 Subject: [PATCH 4/5] ENH: improve uniformity of Random::position