STYLE: make polyMesh constructor explicit

- use polyMesh::defaultRegion instead of fvMesh::defaultRegion and
  others via static inheritance. (92 vs ~25 occurrences)
This commit is contained in:
Mark Olesen
2021-05-11 08:48:18 +02:00
parent 3bc8ab2839
commit 2a438385a3
23 changed files with 30 additions and 30 deletions

View File

@ -7,7 +7,7 @@
( (
IOobject IOobject
( (
dynamicFvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::MUST_READ IOobject::MUST_READ

View File

@ -7,7 +7,7 @@
( (
IOobject IOobject
( (
dynamicFvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::MUST_READ IOobject::MUST_READ

View File

@ -47,7 +47,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::MUST_READ IOobject::MUST_READ

View File

@ -212,7 +212,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::NO_READ, IOobject::NO_READ,

View File

@ -56,7 +56,7 @@ public:
// Constructors // Constructors
//- Construct from IOobject //- Construct from IOobject
fluentFvMesh(const IOobject& io); explicit fluentFvMesh(const IOobject& io);
// Member functions // Member functions

View File

@ -59,7 +59,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
fluentFvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.constant(), runTime.constant(),
runTime runTime
) )

View File

@ -233,7 +233,7 @@ int main(int argc, char *argv[])
} }
else else
{ {
regionName = fvMesh::defaultRegion; regionName = polyMesh::defaultRegion;
Info<< "Create mesh for time = " Info<< "Create mesh for time = "
<< runTimeExtruded.timeName() << nl << endl; << runTimeExtruded.timeName() << nl << endl;
} }
@ -787,7 +787,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
extrudedMesh::defaultRegion, polyMesh::defaultRegion,
runTimeExtruded.constant(), runTimeExtruded.constant(),
runTimeExtruded runTimeExtruded
), ),

View File

@ -73,7 +73,7 @@ int main(int argc, char *argv[])
( (
IOobject IOobject
( (
mirrorFvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.constant(), runTime.constant(),
runTime runTime
), ),

View File

@ -2905,7 +2905,7 @@ int main(int argc, char *argv[])
const word& regionName = regionNames[regioni]; const word& regionName = regionNames[regioni];
const fileName meshSubDir const fileName meshSubDir
( (
regionName == fvMesh::defaultRegion regionName == polyMesh::defaultRegion
? fileName(polyMesh::meshSubDir) ? fileName(polyMesh::meshSubDir)
: regionNames[regioni]/polyMesh::meshSubDir : regionNames[regioni]/polyMesh::meshSubDir
); );

View File

@ -499,7 +499,7 @@ int main(int argc, char *argv[])
fileName regionPrefix; fileName regionPrefix;
if (regionName != fvMesh::defaultRegion) if (regionName != polyMesh::defaultRegion)
{ {
regionPrefix = regionName; regionPrefix = regionName;
} }

View File

@ -89,7 +89,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H" #include "setRootCase.H"
#include "createTime.H" #include "createTime.H"
wordList regionNames(1, fvMesh::defaultRegion); wordList regionNames(1, polyMesh::defaultRegion);
if (!args.readIfPresent("region", regionNames.first())) if (!args.readIfPresent("region", regionNames.first()))
{ {
args.readIfPresent("regions", regionNames); args.readIfPresent("regions", regionNames);

View File

@ -291,7 +291,7 @@ int main(int argc, char *argv[])
const fileName caseDirSource = casePath.name(); const fileName caseDirSource = casePath.name();
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl; Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
word sourceRegion = fvMesh::defaultRegion; word sourceRegion = polyMesh::defaultRegion;
if (args.found("sourceRegion")) if (args.found("sourceRegion"))
{ {
sourceRegion = args["sourceRegion"]; sourceRegion = args["sourceRegion"];
@ -299,7 +299,7 @@ int main(int argc, char *argv[])
} }
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl; Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
word targetRegion = fvMesh::defaultRegion; word targetRegion = polyMesh::defaultRegion;
if (args.found("targetRegion")) if (args.found("targetRegion"))
{ {
targetRegion = args["targetRegion"]; targetRegion = args["targetRegion"];

View File

@ -219,14 +219,14 @@ int main(int argc, char *argv[])
const fileName caseDirSource = casePath.name(); const fileName caseDirSource = casePath.name();
Info<< "Source: " << rootDirSource << " " << caseDirSource << endl; Info<< "Source: " << rootDirSource << " " << caseDirSource << endl;
word sourceRegion = fvMesh::defaultRegion; word sourceRegion = polyMesh::defaultRegion;
if (args.readIfPresent("sourceRegion", sourceRegion)) if (args.readIfPresent("sourceRegion", sourceRegion))
{ {
Info<< "Source region: " << sourceRegion << endl; Info<< "Source region: " << sourceRegion << endl;
} }
Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl; Info<< "Target: " << rootDirTarget << " " << caseDirTarget << endl;
word targetRegion = fvMesh::defaultRegion; word targetRegion = polyMesh::defaultRegion;
if (args.readIfPresent("targetRegion", targetRegion)) if (args.readIfPresent("targetRegion", targetRegion))
{ {
Info<< "Target region: " << targetRegion << endl; Info<< "Target region: " << targetRegion << endl;

View File

@ -33,7 +33,7 @@ Foam::fvMesh mesh
( (
Foam::IOobject Foam::IOobject
( (
Foam::fvMesh::defaultRegion, Foam::polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
Foam::IOobject::MUST_READ Foam::IOobject::MUST_READ

View File

@ -6,7 +6,7 @@
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
Copyright (C) 2011-2017, 2020 OpenFOAM Foundation Copyright (C) 2011-2017, 2020 OpenFOAM Foundation
Copyright (C) 2018-2020 OpenCFD Ltd. Copyright (C) 2018-2021 OpenCFD Ltd.
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
This file is part of OpenFOAM. This file is part of OpenFOAM.
@ -325,7 +325,7 @@ public:
// Constructors // Constructors
//- Read construct from IOobject //- Read construct from IOobject
polyMesh(const IOobject& io, const bool doInit = true); explicit polyMesh(const IOobject& io, const bool doInit = true);
//- Construct from IOobject or as zero-sized mesh //- Construct from IOobject or as zero-sized mesh
// Boundary is added using addPatches() member function // Boundary is added using addPatches() member function

View File

@ -154,7 +154,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New
( (
IOobject IOobject
( (
dynamicFvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::MUST_READ IOobject::MUST_READ
@ -168,7 +168,7 @@ Foam::autoPtr<Foam::dynamicFvMesh> Foam::dynamicFvMesh::New
( (
IOobject IOobject
( (
dynamicFvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::MUST_READ IOobject::MUST_READ

View File

@ -1,4 +1,4 @@
Foam::word regionName = Foam::fvMesh::defaultRegion; Foam::word regionName = Foam::polyMesh::defaultRegion;
if (args.readIfPresent("region", regionName)) if (args.readIfPresent("region", regionName))
{ {

View File

@ -1756,7 +1756,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
( (
IOobject IOobject
( (
fvMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
IOobject::NO_READ IOobject::NO_READ

View File

@ -7,7 +7,7 @@
( (
IOobject IOobject
( (
engineMesh::defaultRegion, polyMesh::defaultRegion,
runTime.timeName(), runTime.timeName(),
runTime, runTime,
Foam::IOobject::MUST_READ Foam::IOobject::MUST_READ

View File

@ -103,7 +103,7 @@ bool Foam::simplifiedMeshes::columnFvMeshInfo::setPatchEntries
( (
runTime, runTime,
runTime.timeName(), runTime.timeName(),
(regionName_ == fvMesh::defaultRegion ? "" : regionName_) (regionName_ == polyMesh::defaultRegion ? "" : regionName_)
); );
if (objects.empty()) if (objects.empty())
@ -411,7 +411,7 @@ Foam::simplifiedMeshes::columnFvMeshInfo::columnFvMeshInfo
regionName_(regionName), regionName_(regionName),
regionPrefix_ regionPrefix_
( (
regionName_ == fvMesh::defaultRegion regionName_ == polyMesh::defaultRegion
? "" ? ""
: regionName_ + '/' : regionName_ + '/'
), ),

View File

@ -149,7 +149,7 @@ public:
columnFvMesh columnFvMesh
( (
const Time& runTime, const Time& runTime,
const word& regionName = fvMesh::defaultRegion const word& regionName = polyMesh::defaultRegion
); );
}; };

View File

@ -663,7 +663,7 @@ bool Foam::functionObjects::streamLineBase::writeToFile()
( (
time_.globalPath()/functionObject::outputPrefix/"sets"/name() time_.globalPath()/functionObject::outputPrefix/"sets"/name()
); );
if (mesh_.name() != fvMesh::defaultRegion) if (mesh_.name() != polyMesh::defaultRegion)
{ {
vtkPath = vtkPath/mesh_.name(); vtkPath = vtkPath/mesh_.name();
} }

View File

@ -104,7 +104,7 @@ Foam::sampledSets::sampledSets
mesh_.time().globalPath()/functionObject::outputPrefix/name mesh_.time().globalPath()/functionObject::outputPrefix/name
); );
if (mesh_.name() != fvMesh::defaultRegion) if (mesh_.name() != polyMesh::defaultRegion)
{ {
outputPath_ = outputPath_/mesh_.name(); outputPath_ = outputPath_/mesh_.name();
} }
@ -137,7 +137,7 @@ Foam::sampledSets::sampledSets
mesh_.time().globalPath()/functionObject::outputPrefix/name mesh_.time().globalPath()/functionObject::outputPrefix/name
); );
if (mesh_.name() != fvMesh::defaultRegion) if (mesh_.name() != polyMesh::defaultRegion)
{ {
outputPath_ = outputPath_/mesh_.name(); outputPath_ = outputPath_/mesh_.name();
} }