STYLE: use writeEntry(), beginBlock(), endBlock() methods

- use dictionary::get<..> instead of lookup in a few more places
This commit is contained in:
Mark Olesen
2020-04-23 16:17:38 +02:00
parent 81bd0aa09f
commit 79048eb68f
106 changed files with 421 additions and 410 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2019 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -308,8 +308,7 @@ int main(int argc, char *argv[])
<< exit(FatalError);
}
fileName sourceCasePath(dict.lookup("sourceCase"));
sourceCasePath.expand();
fileName sourceCasePath(dict.get<fileName>("sourceCase").expand());
fileName sourceRootDir = sourceCasePath.path();
fileName sourceCaseDir = sourceCasePath.name();
if (Pstream::parRun())
@ -758,8 +757,7 @@ int main(int argc, char *argv[])
else
{
// Read from surface
fileName surfName(dict.lookup("surface"));
surfName.expand();
fileName surfName(dict.get<fileName>("surface").expand());
Info<< "Extruding surfaceMesh read from file " << surfName << nl
<< endl;

View File

@ -6,6 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2012-2016 OpenFOAM Foundation
Copyright (C) 2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -50,7 +51,7 @@ Foam::faceSelections::faceZoneSelection::faceZoneSelection
)
:
faceSelection(name, mesh, dict),
zoneName_(dict_.lookup("zoneName"))
zoneName_(dict_.get<word>("zoneName"))
{}

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2016-2018 OpenCFD Ltd.
Copyright (C) 2016-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -54,7 +54,7 @@ Description
#include "IOPtrList.H"
#include "polyTopoChange.H"
#include "polyModifyFace.H"
#include "wordReList.H"
#include "wordRes.H"
#include "processorMeshes.H"
#include "IOdictionary.H"

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2016 OpenFOAM Foundation
Copyright (C) 2015-2018 OpenCFD Ltd.
Copyright (C) 2015-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -378,16 +378,17 @@ int main(int argc, char *argv[])
"from the body reference frame to the global "
"reference frame, i.e.:" << nl
<< "globalVector = orientation & bodyLocalVector"
<< endl;
<< nl;
Info<< nl
<< "Entries for sixDoFRigidBodyDisplacement boundary condition:"
<< nl
<< " mass " << m << token::END_STATEMENT << nl
<< " centreOfMass " << cM << token::END_STATEMENT << nl
<< " momentOfInertia " << eVal << token::END_STATEMENT << nl
<< " orientation " << eVec.T() << token::END_STATEMENT
<< endl;
<< nl;
Info()
.writeEntry("mass", m)
.writeEntry("centreOfMass", cM)
.writeEntry("momentOfInertia", eVal)
.writeEntry("orientation", eVec.T());
}
if (calcAroundRefPt)

View File

@ -275,7 +275,7 @@ Foam::searchableSurfaceModifiers::cut::cut
)
:
searchableSurfaceModifier(geometry, dict),
cutterNames_(dict_.lookup("cutters"))
cutterNames_(dict_.get<wordRes>("cutters"))
{}