ENH: use restricted dictionary lookup for utilities (issue #762)

- get<label>, get<scalar> instead of readLabel, readScalar, etc.
This commit is contained in:
Mark Olesen
2018-07-24 08:08:30 +02:00
parent d362c2235b
commit d58c142404
90 changed files with 475 additions and 659 deletions

View File

@ -357,13 +357,13 @@ int main(int argc, char *argv[])
)
);
fileName surfName(refineDict.lookup("surface"));
fileName surfName(refineDict.get<fileName>("surface"));
pointField outsidePts(refineDict.lookup("outsidePoints"));
bool useSurface(readBool(refineDict.lookup("useSurface")));
bool selectCut(readBool(refineDict.lookup("selectCut")));
bool selectInside(readBool(refineDict.lookup("selectInside")));
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
scalar nearDist(readScalar(refineDict.lookup("nearDistance")));
const bool useSurface(refineDict.get<bool>("useSurface"));
const bool selectCut(refineDict.get<bool>("selectCut"));
const bool selectInside(refineDict.get<bool>("selectInside"));
const bool selectOutside(refineDict.get<bool>("selectOutside"));
const scalar nearDist(refineDict.get<scalar>("nearDistance"));
if (useSurface)

View File

@ -677,22 +677,22 @@ int main(int argc, char *argv[])
)
);
fileName surfName(refineDict.lookup("surface"));
fileName surfName(refineDict.get<fileName>("surface"));
surfName.expand();
label nCutLayers(readLabel(refineDict.lookup("nCutLayers")));
label cellLimit(readLabel(refineDict.lookup("cellLimit")));
bool selectCut(readBool(refineDict.lookup("selectCut")));
bool selectInside(readBool(refineDict.lookup("selectInside")));
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
bool selectHanging(readBool(refineDict.lookup("selectHanging")));
const label nCutLayers(refineDict.get<label>("nCutLayers"));
const label cellLimit(refineDict.get<label>("cellLimit"));
const bool selectCut(refineDict.get<bool>("selectCut"));
const bool selectInside(refineDict.get<bool>("selectInside"));
const bool selectOutside(refineDict.get<bool>("selectOutside"));
const bool selectHanging(refineDict.get<bool>("selectHanging"));
scalar minEdgeLen(readScalar(refineDict.lookup("minEdgeLen")));
scalar maxEdgeLen(readScalar(refineDict.lookup("maxEdgeLen")));
scalar curvature(readScalar(refineDict.lookup("curvature")));
scalar curvDist(readScalar(refineDict.lookup("curvatureDistance")));
const scalar minEdgeLen(refineDict.get<scalar>("minEdgeLen"));
const scalar maxEdgeLen(refineDict.get<scalar>("maxEdgeLen"));
const scalar curvature(refineDict.get<scalar>("curvature"));
const scalar curvDist(refineDict.get<scalar>("curvatureDistance"));
pointField outsidePts(refineDict.lookup("outsidePoints"));
label refinementLimit(readLabel(refineDict.lookup("splitLevel")));
bool writeMesh(readBool(refineDict.lookup("writeMesh")));
const label refinementLimit(refineDict.get<label>("splitLevel"));
const bool writeMesh(refineDict.get<bool>("writeMesh"));
Info<< "Cells to be used for meshing (0=false, 1=true):" << nl
<< " cells cut by surface : " << selectCut << nl

View File

@ -1505,7 +1505,7 @@ int main(int argc, char *argv[])
autoPtr<extrudeModel> model(extrudeModel::New(dict));
// Region
const word shellRegionName(dict.lookup("region"));
const word shellRegionName(dict.get<word>("region"));
// Faces to extrude - either faceZones or faceSets (boundary faces only)
wordList zoneNames;
@ -1534,7 +1534,7 @@ int main(int argc, char *argv[])
mappedPatchBase::sampleMode sampleMode =
mappedPatchBase::sampleModeNames_[dict.lookup("sampleMode")];
mappedPatchBase::sampleModeNames_.lookup("sampleMode", dict);
const bool oneD(dict.get<bool>("oneD"));
bool oneDNonManifoldEdges(false);
@ -1542,7 +1542,7 @@ int main(int argc, char *argv[])
if (oneD)
{
oneDNonManifoldEdges = dict.lookupOrDefault("nonManifold", false);
dict.lookup("oneDPolyPatchType") >> oneDPatchType;
oneDPatchType = dict.get<word>("oneDPolyPatchType");
}
const bool adaptMesh(dict.get<bool>("adaptMesh"));

View File

@ -90,8 +90,8 @@ Foam::extrude2DMesh::extrude2DMesh
dict_(dict),
//patchDict_(dict.subDict("patchInfo")),
model_(model),
modelType_(dict.lookup("extrudeModel")),
patchType_(dict.lookup("patchType")),
modelType_(dict.get<word>("extrudeModel")),
patchType_(dict.get<word>("patchType")),
frontPatchi_(-1),
backPatchi_(-1)
{
@ -99,12 +99,6 @@ Foam::extrude2DMesh::extrude2DMesh
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::extrude2DMesh::~extrude2DMesh()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::extrude2DMesh::addFrontBackPatches()

View File

@ -77,6 +77,7 @@ class extrude2DMesh
const word patchType_;
label frontPatchi_;
label backPatchi_;
// Private Member Functions
@ -109,7 +110,7 @@ public:
//- Destructor
~extrude2DMesh();
~extrude2DMesh() = default;
// Member Functions

View File

@ -27,7 +27,6 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::cv2DControls::cv2DControls
(
const dictionary& controlDict,
@ -39,43 +38,61 @@ Foam::cv2DControls::cv2DControls
motionControl_(controlDict.subDict("motionControl")),
conformationControl_(controlDict.subDict("surfaceConformation")),
minCellSize_(readScalar(motionControl_.lookup("minCellSize"))),
minCellSize_(motionControl_.get<scalar>("minCellSize")),
minCellSize2_(Foam::sqr(minCellSize_)),
maxQuadAngle_(readScalar(conformationControl_.lookup("maxQuadAngle"))),
maxQuadAngle_(conformationControl_.get<scalar>("maxQuadAngle")),
nearWallAlignedDist_
(
readScalar(motionControl_.lookup("nearWallAlignedDist"))*minCellSize_
motionControl_.get<scalar>("nearWallAlignedDist") * minCellSize_
),
nearWallAlignedDist2_(Foam::sqr(nearWallAlignedDist_)),
insertSurfaceNearestPointPairs_
(
conformationControl_.lookup("insertSurfaceNearestPointPairs")
conformationControl_.get<Switch>
(
"insertSurfaceNearestPointPairs"
)
),
mirrorPoints_
(
conformationControl_.get<Switch>
(
"mirrorPoints"
)
),
mirrorPoints_(conformationControl_.lookup("mirrorPoints")),
insertSurfaceNearPointPairs_
(
conformationControl_.lookup("insertSurfaceNearPointPairs")
conformationControl_.get<Switch>
(
"insertSurfaceNearPointPairs"
)
),
objOutput_(motionControl_.lookupOrDefault<Switch>("objOutput", false)),
objOutput_
(
motionControl_.lookupOrDefault<Switch>("objOutput", false)
),
meshedSurfaceOutput_
(
motionControl_.lookupOrDefault<Switch>("meshedSurfaceOutput", false)
),
randomiseInitialGrid_(conformationControl_.lookup("randomiseInitialGrid")),
randomiseInitialGrid_
(
conformationControl_.get<Switch>("randomiseInitialGrid")
),
randomPerturbation_
(
readScalar(conformationControl_.lookup("randomPerturbation"))
conformationControl_.get<scalar>("randomPerturbation")
),
maxBoundaryConformingIter_
(
readLabel(conformationControl_.lookup("maxBoundaryConformingIter"))
conformationControl_.get<label>("maxBoundaryConformingIter")
),
span_
@ -87,39 +104,29 @@ Foam::cv2DControls::cv2DControls
minEdgeLen_
(
readScalar(conformationControl_.lookup("minEdgeLenCoeff"))
*minCellSize_
conformationControl_.get<scalar>("minEdgeLenCoeff") * minCellSize_
),
minEdgeLen2_(Foam::sqr(minEdgeLen_)),
maxNotchLen_
(
readScalar(conformationControl_.lookup("maxNotchLenCoeff"))
*minCellSize_
conformationControl_.get<scalar>("maxNotchLenCoeff") * minCellSize_
),
maxNotchLen2_(Foam::sqr(maxNotchLen_)),
minNearPointDist_
(
readScalar(conformationControl_.lookup("minNearPointDistCoeff"))
*minCellSize_
conformationControl_.get<scalar>("minNearPointDistCoeff")*minCellSize_
),
minNearPointDist2_(Foam::sqr(minNearPointDist_)),
ppDist_
(
readScalar(conformationControl_.lookup("pointPairDistanceCoeff"))
*minCellSize_
conformationControl_.get<scalar>("pointPairDistanceCoeff")*minCellSize_
)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cv2DControls::~cv2DControls()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::cv2DControls::write(Ostream& os) const

View File

@ -164,7 +164,7 @@ public:
//- Destructor
~cv2DControls();
~cv2DControls() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -801,14 +801,14 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
allBackgroundMeshBounds_(Pstream::nProcs()),
globalBackgroundBounds_(),
mergeDist_(1e-6*mesh_.bounds().mag()),
spanScale_(readScalar(coeffsDict.lookup("spanScale"))),
spanScale_(coeffsDict.get<scalar>("spanScale")),
minCellSizeLimit_
(
coeffsDict.lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
),
minLevels_(readLabel(coeffsDict.lookup("minLevels"))),
volRes_(readLabel(coeffsDict.lookup("sampleResolution"))),
maxCellWeightCoeff_(readScalar(coeffsDict.lookup("maxCellWeightCoeff")))
minLevels_(coeffsDict.get<label>("minLevels")),
volRes_(coeffsDict.get<label>("sampleResolution")),
maxCellWeightCoeff_(coeffsDict.get<scalar>("maxCellWeightCoeff"))
{
if (!Pstream::parRun())
{

View File

@ -72,7 +72,7 @@ Foam::cellSizeAndAlignmentControl::New
const scalar& defaultCellSize
)
{
const word controlType(controlFunctionDict.lookup("type"));
const word controlType(controlFunctionDict.get<word>("type"));
Info<< indent << "Selecting cellSizeAndAlignmentControl "
<< controlType << endl;
@ -103,10 +103,4 @@ Foam::cellSizeAndAlignmentControl::New
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellSizeAndAlignmentControl::~cellSizeAndAlignmentControl()
{}
// ************************************************************************* //

View File

@ -139,7 +139,7 @@ public:
//- Destructor
virtual ~cellSizeAndAlignmentControl();
virtual ~cellSizeAndAlignmentControl() = default;
// Member Functions

View File

@ -70,10 +70,10 @@ Foam::fileControl::fileControl
geometryToConformTo,
defaultCellSize
),
pointsFile_(controlFunctionDict.lookup("pointsFile")),
sizesFile_(controlFunctionDict.lookup("sizesFile")),
alignmentsFile_(controlFunctionDict.lookup("alignmentsFile")),
maxPriority_(readLabel(controlFunctionDict.lookup("priority")))
pointsFile_(controlFunctionDict.get<fileName>("pointsFile")),
sizesFile_(controlFunctionDict.get<fileName>("sizesFile")),
alignmentsFile_(controlFunctionDict.get<fileName>("alignmentsFile")),
maxPriority_(controlFunctionDict.get<label>("priority"))
{
Info<< indent << "Loading " << name << " from file:" << nl
<< indent << " priority : " << maxPriority_ << nl
@ -84,12 +84,6 @@ Foam::fileControl::fileControl
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::fileControl::~fileControl()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
//
//Foam::scalar Foam::fileControl::cellSize(const point& pt) const

View File

@ -90,7 +90,7 @@ public:
);
//- Destructor
~fileControl();
~fileControl() = default;
// Member Functions

View File

@ -63,9 +63,9 @@ Foam::cellSizeFunction::cellSizeFunction
defaultCellSize_(defaultCellSize),
regionIndices_(regionIndices),
sideMode_(),
priority_(readLabel(cellSizeFunctionDict.lookup("priority", true)))
priority_(cellSizeFunctionDict.get<label>("priority", true))
{
word mode = cellSizeFunctionDict.lookup("mode", true);
const word mode = cellSizeFunctionDict.get<word>("mode", true);
if (surface_.hasVolumeType())
{
@ -125,7 +125,7 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
{
const word functionName
(
cellSizeFunctionDict.lookup("cellSizeFunction")
cellSizeFunctionDict.get<word>("cellSizeFunction")
);
Info<< indent << "Selecting cellSizeFunction "

View File

@ -106,9 +106,7 @@ protected:
label priority_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
cellSizeFunction(const cellSizeFunction&) = delete;

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,20 +29,18 @@ License
#include "triSurfaceFields.H"
#include "volumeType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(linearDistance, 0);
addToRunTimeSelectionTable(cellSizeFunction, linearDistance, dictionary);
defineTypeNameAndDebug(linearDistance, 0);
addToRunTimeSelectionTable(cellSizeFunction, linearDistance, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
linearDistance::linearDistance
Foam::linearDistance::linearDistance
(
const dictionary& initialPointsDict,
const searchableSurface& surface,
@ -60,12 +58,11 @@ linearDistance::linearDistance
),
distanceCellSize_
(
readScalar(coeffsDict().lookup("distanceCellSizeCoeff"))
*defaultCellSize
coeffsDict().get<scalar>("distanceCellSizeCoeff") * defaultCellSize
),
distance_
(
readScalar(coeffsDict().lookup("distanceCoeff"))*defaultCellSize
coeffsDict().get<scalar>("distanceCoeff") * defaultCellSize
),
distanceSqr_(sqr(distance_))
{}
@ -73,7 +70,7 @@ linearDistance::linearDistance
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
scalar linearDistance::sizeFunction
Foam::scalar Foam::linearDistance::sizeFunction
(
const point& pt,
scalar d,
@ -83,7 +80,7 @@ scalar linearDistance::sizeFunction
const scalar interpolatedSize
= surfaceCellSizeFunction_().interpolate(pt, index);
scalar gradient
const scalar gradient
= (distanceCellSize_ - interpolatedSize)
/distance_;
@ -95,7 +92,7 @@ scalar linearDistance::sizeFunction
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool linearDistance::sizeLocations
bool Foam::linearDistance::sizeLocations
(
const pointIndexHit& hitPt,
const vector& n,
@ -111,9 +108,9 @@ bool linearDistance::sizeLocations
shapeSizes.resize(2);
shapePts[0] = pt - n*distance_;
shapeSizes[0] = distanceCellSize_;
shapePts[1] = pt + n*distance_;
shapeSizes[0] = distanceCellSize_;
shapeSizes[1] = distanceCellSize_;
}
else if (sideMode_ == smInside)
@ -137,7 +134,7 @@ bool linearDistance::sizeLocations
}
bool linearDistance::cellSize(const point& pt, scalar& size) const
bool Foam::linearDistance::cellSize(const point& pt, scalar& size) const
{
size = 0;
@ -211,7 +208,7 @@ bool linearDistance::cellSize(const point& pt, scalar& size) const
}
bool linearDistance::setCellSize(const pointField& pts)
bool Foam::linearDistance::setCellSize(const pointField& pts)
{
// labelHashSet surfaceAlreadyHit(surfaceCellSize_.size());
@ -249,8 +246,4 @@ bool linearDistance::setCellSize(const pointField& pts)
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -88,8 +88,7 @@ public:
//- Destructor
virtual ~linearDistance()
{}
virtual ~linearDistance() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,20 +27,18 @@ License
#include "addToRunTimeSelectionTable.H"
#include "volumeType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(linearSpatial, 0);
addToRunTimeSelectionTable(cellSizeFunction, linearSpatial, dictionary);
defineTypeNameAndDebug(linearSpatial, 0);
addToRunTimeSelectionTable(cellSizeFunction, linearSpatial, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
linearSpatial::linearSpatial
Foam::linearSpatial::linearSpatial
(
const dictionary& initialPointsDict,
const searchableSurface& surface,
@ -56,22 +54,28 @@ linearSpatial::linearSpatial
defaultCellSize,
regionIndices
),
referencePoint_(coeffsDict().lookup("referencePoint")),
referencePoint_
(
coeffsDict().get<point>("referencePoint")
),
referenceCellSize_
(
readScalar(coeffsDict().lookup("referenceCellSizeCoeff"))
*defaultCellSize
coeffsDict().get<scalar>("referenceCellSizeCoeff") * defaultCellSize
),
direction_(coeffsDict().lookup("direction")),
cellSizeGradient_(readScalar(coeffsDict().lookup("cellSizeGradient")))
{
direction_ /= mag(direction_);
}
direction_
(
coeffsDict().get<vector>("direction").normalise()
),
cellSizeGradient_
(
coeffsDict().get<scalar>("cellSizeGradient")
)
{}
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
scalar linearSpatial::sizeFunction(const point& pt) const
Foam::scalar Foam::linearSpatial::sizeFunction(const point& pt) const
{
return
referenceCellSize_
@ -82,7 +86,7 @@ scalar linearSpatial::sizeFunction(const point& pt) const
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool linearSpatial::sizeLocations
bool Foam::linearSpatial::sizeLocations
(
const pointIndexHit& hitPt,
const vector& n,
@ -104,7 +108,7 @@ bool linearSpatial::sizeLocations
}
bool linearSpatial::cellSize
bool Foam::linearSpatial::cellSize
(
const point& pt,
scalar& size
@ -169,12 +173,7 @@ bool linearSpatial::cellSize
}
return functionApplied;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -92,8 +92,7 @@ public:
//- Destructor
virtual ~linearSpatial()
{}
virtual ~linearSpatial() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -29,22 +29,22 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(surfaceOffsetLinearDistance, 0);
addToRunTimeSelectionTable
(
cellSizeFunction,
surfaceOffsetLinearDistance,
dictionary
);
namespace Foam
{
defineTypeNameAndDebug(surfaceOffsetLinearDistance, 0);
addToRunTimeSelectionTable
(
cellSizeFunction,
surfaceOffsetLinearDistance,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
Foam::surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
(
const dictionary& initialPointsDict,
const searchableSurface& surface,
@ -62,47 +62,33 @@ surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
),
distanceCellSize_
(
readScalar(coeffsDict().lookup("distanceCellSizeCoeff"))
*defaultCellSize
coeffsDict().get<scalar>("distanceCellSizeCoeff") * defaultCellSize
),
surfaceOffset_
(
readScalar(coeffsDict().lookup("surfaceOffsetCoeff"))*defaultCellSize
coeffsDict().get<scalar>("surfaceOffsetCoeff") * defaultCellSize
),
totalDistance_(),
totalDistanceSqr_()
{
if
(
coeffsDict().found("totalDistanceCoeff")
|| coeffsDict().found("linearDistanceCoeff")
)
if (coeffsDict().found("totalDistanceCoeff"))
{
if
(
coeffsDict().found("totalDistanceCoeff")
&& coeffsDict().found("linearDistanceCoeff")
)
totalDistance_ =
coeffsDict().get<scalar>("totalDistanceCoeff") * defaultCellSize;
if (coeffsDict().found("linearDistanceCoeff"))
{
FatalErrorInFunction
<< "totalDistanceCoeff and linearDistanceCoeff found, "
<< "specify one or other, not both."
<< nl << exit(FatalError) << endl;
}
if (coeffsDict().found("totalDistanceCoeff"))
{
totalDistance_ =
readScalar(coeffsDict().lookup("totalDistanceCoeff"))
*defaultCellSize;
}
else
{
totalDistance_ =
readScalar(coeffsDict().lookup("linearDistanceCoeff"))
*defaultCellSize
+ surfaceOffset_;
}
}
else if (coeffsDict().found("linearDistanceCoeff"))
{
totalDistance_ =
coeffsDict().get<scalar>("linearDistanceCoeff") * defaultCellSize
+ surfaceOffset_;
}
else
{
@ -117,7 +103,7 @@ surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
scalar surfaceOffsetLinearDistance::sizeFunction
Foam::scalar Foam::surfaceOffsetLinearDistance::sizeFunction
(
const point& pt,
scalar d,
@ -144,7 +130,7 @@ scalar surfaceOffsetLinearDistance::sizeFunction
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool surfaceOffsetLinearDistance::sizeLocations
bool Foam::surfaceOffsetLinearDistance::sizeLocations
(
const pointIndexHit& hitPt,
const vector& n,
@ -197,7 +183,7 @@ bool surfaceOffsetLinearDistance::sizeLocations
}
bool surfaceOffsetLinearDistance::cellSize
bool Foam::surfaceOffsetLinearDistance::cellSize
(
const point& pt,
scalar& size
@ -275,8 +261,4 @@ bool surfaceOffsetLinearDistance::cellSize
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,19 +27,17 @@ License
#include "addToRunTimeSelectionTable.H"
#include "volumeType.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(uniformDistance, 0);
addToRunTimeSelectionTable(cellSizeFunction, uniformDistance, dictionary);
defineTypeNameAndDebug(uniformDistance, 0);
addToRunTimeSelectionTable(cellSizeFunction, uniformDistance, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
uniformDistance::uniformDistance
Foam::uniformDistance::uniformDistance
(
const dictionary& initialPointsDict,
const searchableSurface& surface,
@ -57,7 +55,7 @@ uniformDistance::uniformDistance
),
distance_
(
readScalar(coeffsDict().lookup("distanceCoeff"))*defaultCellSize
coeffsDict().get<scalar>("distanceCoeff") * defaultCellSize
),
distanceSqr_(sqr(distance_))
{}
@ -66,7 +64,7 @@ uniformDistance::uniformDistance
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool uniformDistance::sizeLocations
bool Foam::uniformDistance::sizeLocations
(
const pointIndexHit& hitPt,
const vector& n,
@ -85,9 +83,9 @@ bool uniformDistance::sizeLocations
shapeSizes.resize(2);
shapePts[0] = pt - n*distance_;
shapeSizes[0] = distanceCellSize;
shapePts[1] = pt + n*distance_;
shapeSizes[0] = distanceCellSize;
shapeSizes[1] = distanceCellSize;
}
else if (sideMode_ == smInside)
@ -111,7 +109,7 @@ bool uniformDistance::sizeLocations
}
bool uniformDistance::cellSize
bool Foam::uniformDistance::cellSize
(
const point& pt,
scalar& size
@ -187,7 +185,7 @@ bool uniformDistance::cellSize
}
bool uniformDistance::setCellSize
bool Foam::uniformDistance::setCellSize
(
const pointField& pts
)
@ -222,8 +220,4 @@ bool uniformDistance::setCellSize
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -79,8 +79,7 @@ public:
//- Destructor
virtual ~uniformDistance()
{}
virtual ~uniformDistance() = default;
// Member Functions

View File

@ -120,11 +120,11 @@ Foam::automatic::automatic
curvatureCellSizeCoeff_
(
readScalar(coeffsDict_.lookup("curvatureCellSizeCoeff"))
coeffsDict_.get<scalar>("curvatureCellSizeCoeff")
),
maximumCellSize_
(
readScalar(coeffsDict_.lookup("maximumCellSizeCoeff"))*defaultCellSize
coeffsDict_.get<scalar>("maximumCellSizeCoeff") * defaultCellSize
)
{}

View File

@ -62,7 +62,7 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
{
const word calculationType
(
cellSizeCalculationTypeDict.lookup("cellSizeCalculationType")
cellSizeCalculationTypeDict.get<word>("cellSizeCalculationType")
);
Info<< indent << "Selecting cellSizeCalculationType "
@ -87,10 +87,4 @@ Foam::autoPtr<Foam::cellSizeCalculationType> Foam::cellSizeCalculationType::New
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::cellSizeCalculationType::~cellSizeCalculationType()
{}
// ************************************************************************* //

View File

@ -52,9 +52,10 @@ class triSurfaceMesh;
class cellSizeCalculationType
{
protected:
// Protected Data
const dictionary& cellSizeCalculationTypeDict_;
//- Reference to the triSurfaceMesh
@ -63,9 +64,7 @@ protected:
const scalar& defaultCellSize_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
cellSizeCalculationType(const cellSizeCalculationType&) = delete;
@ -120,7 +119,7 @@ public:
//- Destructor
virtual ~cellSizeCalculationType();
virtual ~cellSizeCalculationType() = default;
// Member Functions

View File

@ -64,7 +64,7 @@ Foam::fieldFromFile::fieldFromFile
cellSizeCalcTypeDict.optionalSubDict
(
typeName + "Coeffs"
).lookup("fieldFile")
).get<word>("fieldFile")
),
cellSizeMultipleCoeff_
(

View File

@ -61,8 +61,8 @@ private:
//- Dictionary of coefficients for automatic cell sizing
const dictionary& coeffsDict_;
//- Name of the triSurfaceScalarField file to load in. Must be in
// constant/triSurface
//- Name of the triSurfaceScalarField file to load in.
// Must be in constant/triSurface
const word fileName_;
//- Multiply all the point sizes by this value
@ -87,8 +87,7 @@ public:
//- Destructor
virtual ~fieldFromFile()
{}
virtual ~fieldFromFile() = default;
// Member Functions

View File

@ -67,7 +67,7 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
{
const word functionName
(
surfaceCellSizeFunctionDict.lookup("surfaceCellSizeFunction")
surfaceCellSizeFunctionDict.get<word>("surfaceCellSizeFunction")
);
Info<< indent << "Selecting surfaceCellSizeFunction "
@ -92,10 +92,4 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::surfaceCellSizeFunction::~surfaceCellSizeFunction()
{}
// ************************************************************************* //

View File

@ -128,7 +128,7 @@ public:
//- Destructor
virtual ~surfaceCellSizeFunction();
virtual ~surfaceCellSizeFunction() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -58,7 +58,7 @@ Foam::uniformValue::uniformValue
),
surfaceCellSize_
(
readScalar(coeffsDict().lookup("surfaceCellSizeCoeff"))*defaultCellSize
coeffsDict().get<scalar>("surfaceCellSizeCoeff") * defaultCellSize
)
{}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,7 +49,6 @@ class uniformValue
:
public surfaceCellSizeFunction
{
private:
// Private data
@ -75,8 +74,7 @@ public:
//- Destructor
virtual ~uniformValue()
{}
virtual ~uniformValue() = default;
// Member Functions

View File

@ -516,10 +516,8 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
const dictionary& motionControlDict
= foamyHexMeshControls().foamyHexMeshDict().subDict("motionControl");
label nMaxIter = readLabel
(
motionControlDict.lookup("maxRefinementIterations")
);
const label nMaxIter =
motionControlDict.get<label>("maxRefinementIterations");
Info<< "Maximum number of refinement iterations : " << nMaxIter << endl;
@ -553,11 +551,10 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
}
}
label maxSmoothingIterations = readLabel
meshAlignmentSmoother.smoothAlignments
(
motionControlDict.lookup("maxSmoothingIterations")
motionControlDict.get<label>("maxSmoothingIterations")
);
meshAlignmentSmoother.smoothAlignments(maxSmoothingIterations);
Info<< "Background cell size and alignment mesh:" << endl;
cellSizeMesh.printInfo(Info);

View File

@ -751,12 +751,12 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
forAll(patches, p)
{
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
label totalPatchSize = patchDicts[p].get<label>("nFaces");
if
(
patchDicts.set(p)
&& word(patchDicts[p].lookup("type")) == processorPolyPatch::typeName
&& patchDicts[p].get<word>("type") == processorPolyPatch::typeName
)
{
// Do not create empty processor patches
@ -837,7 +837,7 @@ void Foam::conformalVoronoiMesh::checkCellSizing()
= dict.subDict("meshQualityControls");
const scalar maxNonOrtho =
readScalar(meshQualityDict.lookup("maxNonOrtho", true));
meshQualityDict.get<scalar>("maxNonOrtho", true);
label nWrongFaces = 0;
@ -1710,18 +1710,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
const label nPatches = patchNames.size();
labelList procNeighbours(nPatches, label(-1));
labelList procNeighbours(nPatches);
forAll(procNeighbours, patchi)
{
if (patchDicts[patchi].found("neighbProcNo"))
{
procNeighbours[patchi] =
(
patchDicts[patchi].found("neighbProcNo")
? readLabel(patchDicts[patchi].lookup("neighbProcNo"))
: -1
);
}
procNeighbours[patchi] =
patchDicts[patchi].lookupOrDefault<label>("neighbProcNo", -1);
}
List<DynamicList<face>> patchFaces(nPatches, DynamicList<face>(0));
@ -2343,11 +2336,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
if (patchFaces[nbI].size() > 0)
{
const label neighbour =
(
patchDicts[nbI].found("neighbProcNo")
? readLabel(patchDicts[nbI].lookup("neighbProcNo"))
: -1
);
patchDicts[nbI].lookupOrDefault<label>("neighbProcNo", -1);
faceList procPatchFaces = patchFaces[nbI];

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -154,7 +154,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
forAll(dualPatchStarts, patchi)
{
dualPatchStarts[patchi] =
readLabel(patchDicts[patchi].lookup("startFace"));
patchDicts[patchi].get<label>("startFace");
}
}
@ -415,7 +415,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
(
patchDicts.set(patchi)
&& (
word(patchDicts[patchi].lookup("type"))
patchDicts[patchi].get<word>("type")
== processorPolyPatch::typeName
)
)
@ -426,8 +426,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
0, //patchStarts[p],
patchi,
mesh.boundaryMesh(),
readLabel(patchDicts[patchi].lookup("myProcNo")),
readLabel(patchDicts[patchi].lookup("neighbProcNo")),
patchDicts[patchi].get<label>("myProcNo"),
patchDicts[patchi].get<label>("neighbProcNo"),
coupledPolyPatch::COINCIDENTFULLMATCH
);
}
@ -435,7 +435,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
{
patches[patchi] = polyPatch::New
(
patchDicts[patchi].lookup("type"),
patchDicts[patchi].get<word>("type"),
patchNames[patchi],
0, //patchSizes[p],
0, //patchStarts[p],
@ -469,16 +469,16 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
(
patchDicts.set(patchi)
&& (
word(patchDicts[patchi].lookup("type"))
patchDicts[patchi].get<word>("type")
== processorPolyPatch::typeName
)
)
{
const label procNeighb =
readLabel(patchDicts[patchi].lookup("neighbProcNo"));
patchDicts[patchi].get<label>("neighbProcNo");
procPatchSizes[Pstream::myProcNo()][procNeighb]
= readLabel(patchDicts[patchi].lookup("nFaces"));
= patchDicts[patchi].get<label>("nFaces");
}
}
@ -631,8 +631,8 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
SubList<face>
(
faces,
readLabel(patchDicts[patchi].lookup("nFaces")),
readLabel(patchDicts[patchi].lookup("startFace"))
patchDicts[patchi].get<label>("nFaces"),
patchDicts[patchi].get<label>("startFace")
),
points
)
@ -654,9 +654,10 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
if (isA<processorPolyPatch>(pp))
{
const label nPatchFaces =
readLabel(patchDicts[patchi].lookup("nFaces"));
patchDicts[patchi].get<label>("nFaces");
const label patchStartFace =
readLabel(patchDicts[patchi].lookup("startFace"));
patchDicts[patchi].get<label>("startFace");
labelList patchFaceMap(nPatchFaces, label(-1));
labelList patchFaceRotation(nPatchFaces, label(0));
@ -769,7 +770,7 @@ void Foam::conformalVoronoiMesh::writeMesh
);
}
const label nInternalFaces = readLabel(patchDicts[0].lookup("startFace"));
const label nInternalFaces = patchDicts[0].get<label>("startFace");
reorderPoints(points, boundaryPts, faces, nInternalFaces);
@ -815,13 +816,13 @@ void Foam::conformalVoronoiMesh::writeMesh
forAll(patches, p)
{
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
label totalPatchSize = patchDicts[p].get<label>("nFaces");
if
(
patchDicts.set(p)
&& (
word(patchDicts[p].lookup("type"))
patchDicts[p].get<word>("type")
== processorPolyPatch::typeName
)
)

View File

@ -133,12 +133,15 @@ void Foam::conformationSurfaces::readFeatures
label& featureIndex
)
{
word featureMethod =
const word featureMethod =
featureDict.lookupOrDefault<word>("featureMethod", "none");
if (featureMethod == "extendedFeatureEdgeMesh")
{
fileName feMeshName(featureDict.lookup("extendedFeatureEdgeMesh"));
fileName feMeshName
(
featureDict.get<fileName>("extendedFeatureEdgeMesh")
);
Info<< " features: " << feMeshName << endl;
@ -213,12 +216,15 @@ void Foam::conformationSurfaces::readFeatures
label& featureIndex
)
{
word featureMethod =
const word featureMethod =
featureDict.lookupOrDefault<word>("featureMethod", "none");
if (featureMethod == "extendedFeatureEdgeMesh")
{
fileName feMeshName(featureDict.lookup("extendedFeatureEdgeMesh"));
fileName feMeshName
(
featureDict.get<fileName>("extendedFeatureEdgeMesh")
);
Info<< " features: " << feMeshName << ", id: " << featureIndex
<< endl;
@ -271,7 +277,7 @@ Foam::conformationSurfaces::conformationSurfaces
rndGen_(rndGen),
allGeometry_(allGeometry),
features_(),
locationInMesh_(surfaceConformationDict.lookup("locationInMesh")),
locationInMesh_(surfaceConformationDict.get<point>("locationInMesh")),
surfaces_(),
allGeometryToSurfaces_(),
normalVolumeTypes_(),
@ -298,13 +304,11 @@ Foam::conformationSurfaces::conformationSurfaces
// Count number of surfaces.
label surfI = 0;
forAll(allGeometry.names(), geomI)
for (const word& geomName : allGeometry_.names())
{
const word& geomName = allGeometry_.names()[geomI];
if (surfacesDict.found(geomName))
{
surfI++;
++surfI;
}
}
@ -596,12 +600,6 @@ Foam::conformationSurfaces::conformationSurfaces
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::conformationSurfaces::~conformationSurfaces()
{}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
bool Foam::conformationSurfaces::overlaps(const treeBoundBox& bb) const

View File

@ -151,7 +151,7 @@ public:
);
//- Destructor
~conformationSurfaces();
~conformationSurfaces() = default;
// Member Functions

View File

@ -54,7 +54,7 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
const dictionary& relaxationDict
)
{
const word modelType(relaxationDict.lookup("faceAreaWeightModel"));
const word modelType(relaxationDict.get<word>("faceAreaWeightModel"));
Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl;
@ -74,10 +74,4 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::faceAreaWeightModel::~faceAreaWeightModel()
{}
// ************************************************************************* //

View File

@ -64,9 +64,8 @@ protected:
//- Method coeffs dictionary
dictionary coeffDict_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
faceAreaWeightModel(const faceAreaWeightModel&) = delete;
@ -115,7 +114,7 @@ public:
//- Destructor
virtual ~faceAreaWeightModel();
virtual ~faceAreaWeightModel() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -28,35 +28,37 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(piecewiseLinearRamp, 0);
addToRunTimeSelectionTable
(
faceAreaWeightModel,
piecewiseLinearRamp,
dictionary
);
namespace Foam
{
defineTypeNameAndDebug(piecewiseLinearRamp, 0);
addToRunTimeSelectionTable
(
faceAreaWeightModel,
piecewiseLinearRamp,
dictionary
);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
piecewiseLinearRamp::piecewiseLinearRamp
Foam::piecewiseLinearRamp::piecewiseLinearRamp
(
const dictionary& faceAreaWeightDict
)
:
faceAreaWeightModel(typeName, faceAreaWeightDict),
lAF_(readScalar(coeffDict().lookup("lowerAreaFraction"))),
uAF_(readScalar(coeffDict().lookup("upperAreaFraction")))
lAF_(coeffDict().get<scalar>("lowerAreaFraction")),
uAF_(coeffDict().get<scalar>("upperAreaFraction"))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
scalar piecewiseLinearRamp::faceAreaWeight(scalar faceAreaFraction) const
Foam::scalar
Foam::piecewiseLinearRamp::faceAreaWeight(scalar faceAreaFraction) const
{
if (faceAreaFraction < lAF_)
{
@ -66,15 +68,9 @@ scalar piecewiseLinearRamp::faceAreaWeight(scalar faceAreaFraction) const
{
return faceAreaFraction/((uAF_ - lAF_)) - lAF_/(uAF_ - lAF_);
}
else
{
return 1;
}
return 1;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -43,14 +43,13 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class piecewiseLinearRamp Declaration
Class piecewiseLinearRamp Declaration
\*---------------------------------------------------------------------------*/
class piecewiseLinearRamp
:
public faceAreaWeightModel
{
private:
// Private data
@ -61,6 +60,7 @@ private:
//- Face area fraction above which a which of 1 is returned
scalar uAF_;
public:
//- Runtime type information
@ -76,8 +76,7 @@ public:
//- Destructor
virtual ~piecewiseLinearRamp()
{}
virtual ~piecewiseLinearRamp() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -55,15 +55,13 @@ void Foam::autoDensity::writeOBJ
pointField bbPoints(bb.points());
forAll(bbPoints, i)
for (const point& pt : bbPoints)
{
meshTools::writeOBJ(str, bbPoints[i]);
meshTools::writeOBJ(str, pt);
}
forAll(treeBoundBox::edges, i)
for (const edge& e : treeBoundBox::edges)
{
const edge& e = treeBoundBox::edges[i];
str << "l " << e[0] + 1 << ' ' << e[1] + 1 << nl;
}
}
@ -884,9 +882,9 @@ autoDensity::autoDensity
(
detailsDict().lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
),
minLevels_(readLabel(detailsDict().lookup("minLevels"))),
maxSizeRatio_(readScalar(detailsDict().lookup("maxSizeRatio"))),
volRes_(readLabel(detailsDict().lookup("sampleResolution"))),
minLevels_(detailsDict().get<label>("minLevels")),
maxSizeRatio_(detailsDict().get<scalar>("maxSizeRatio")),
volRes_(detailsDict().get<label>("sampleResolution")),
surfRes_
(
detailsDict().lookupOrDefault<label>("surfaceSampleResolution", volRes_)

View File

@ -26,19 +26,18 @@ License
#include "bodyCentredCubic.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(bodyCentredCubic, 0);
addToRunTimeSelectionTable(initialPointsMethod, bodyCentredCubic, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
bodyCentredCubic::bodyCentredCubic
Foam::bodyCentredCubic::bodyCentredCubic
(
const dictionary& initialPointsDict,
const Time& runTime,
@ -58,18 +57,18 @@ bodyCentredCubic::bodyCentredCubic
cellShapeControls,
decomposition
),
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
initialCellSize_(detailsDict().get<scalar>("initialCellSize")),
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().get<scalar>("randomPerturbationCoeff")
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
List<Vb::Point> bodyCentredCubic::initialPoints() const
Foam::List<Vb::Point> Foam::bodyCentredCubic::initialPoints() const
{
boundBox bb;
@ -196,8 +195,4 @@ List<Vb::Point> bodyCentredCubic::initialPoints() const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,7 +51,6 @@ class bodyCentredCubic
:
public initialPointsMethod
{
private:
// Private data
@ -86,8 +85,7 @@ public:
//- Destructor
virtual ~bodyCentredCubic()
{}
virtual ~bodyCentredCubic() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,19 +26,17 @@ License
#include "faceCentredCubic.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(faceCentredCubic, 0);
addToRunTimeSelectionTable(initialPointsMethod, faceCentredCubic, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
faceCentredCubic::faceCentredCubic
Foam::faceCentredCubic::faceCentredCubic
(
const dictionary& initialPointsDict,
const Time& runTime,
@ -58,18 +56,18 @@ faceCentredCubic::faceCentredCubic
cellShapeControls,
decomposition
),
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
initialCellSize_(detailsDict().get<scalar>("initialCellSize")),
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().get<scalar>("randomPerturbationCoeff")
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
List<Vb::Point> faceCentredCubic::initialPoints() const
Foam::List<Vb::Point> Foam::faceCentredCubic::initialPoints() const
{
boundBox bb;
@ -257,8 +255,4 @@ List<Vb::Point> faceCentredCubic::initialPoints() const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,7 +51,6 @@ class faceCentredCubic
:
public initialPointsMethod
{
private:
// Private data
@ -86,8 +85,7 @@ public:
//- Destructor
virtual ~faceCentredCubic()
{}
virtual ~faceCentredCubic() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,19 +26,18 @@ License
#include "pointFile.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(pointFile, 0);
addToRunTimeSelectionTable(initialPointsMethod, pointFile, dictionary);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(pointFile, 0);
addToRunTimeSelectionTable(initialPointsMethod, pointFile, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
pointFile::pointFile
Foam::pointFile::pointFile
(
const dictionary& initialPointsDict,
const Time& runTime,
@ -58,12 +57,12 @@ pointFile::pointFile
cellShapeControls,
decomposition
),
pointFileName_(detailsDict().lookup("pointFile")),
insideOutsideCheck_(detailsDict().lookup("insideOutsideCheck")),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
pointFileName_(detailsDict().get<fileName>("pointFile")),
insideOutsideCheck_(detailsDict().get<Switch>("insideOutsideCheck")),
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().get<scalar>("randomPerturbationCoeff")
)
{
Info<< " Inside/Outside check is " << insideOutsideCheck_.c_str()
@ -73,7 +72,7 @@ pointFile::pointFile
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
List<Vb::Point> pointFile::initialPoints() const
Foam::List<Vb::Point> Foam::pointFile::initialPoints() const
{
pointField points;
{
@ -232,8 +231,4 @@ List<Vb::Point> pointFile::initialPoints() const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -92,8 +92,7 @@ public:
//- Destructor
virtual ~pointFile()
{}
virtual ~pointFile() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -27,20 +27,18 @@ License
#include "addToRunTimeSelectionTable.H"
#include "triSurfaceMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(rayShooting, 0);
addToRunTimeSelectionTable(initialPointsMethod, rayShooting, dictionary);
defineTypeNameAndDebug(rayShooting, 0);
addToRunTimeSelectionTable(initialPointsMethod, rayShooting, dictionary);
}
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void rayShooting::splitLine
void Foam::rayShooting::splitLine
(
const line<point, point>& l,
const scalar& pert,
@ -117,7 +115,7 @@ void rayShooting::splitLine
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
rayShooting::rayShooting
Foam::rayShooting::rayShooting
(
const dictionary& initialPointsDict,
const Time& runTime,
@ -137,17 +135,17 @@ rayShooting::rayShooting
cellShapeControls,
decomposition
),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().get<scalar>("randomPerturbationCoeff")
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
List<Vb::Point> rayShooting::initialPoints() const
Foam::List<Vb::Point> Foam::rayShooting::initialPoints() const
{
// Loop over surface faces
const searchableSurfaces& surfaces = geometryToConformTo().geometry();
@ -275,8 +273,4 @@ List<Vb::Point> rayShooting::initialPoints() const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,7 +49,6 @@ class rayShooting
:
public initialPointsMethod
{
private:
// Private data
@ -91,8 +90,7 @@ public:
//- Destructor
virtual ~rayShooting()
{}
virtual ~rayShooting() = default;
// Member Functions

View File

@ -26,19 +26,18 @@ License
#include "uniformGrid.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(uniformGrid, 0);
addToRunTimeSelectionTable(initialPointsMethod, uniformGrid, dictionary);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(uniformGrid, 0);
addToRunTimeSelectionTable(initialPointsMethod, uniformGrid, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
uniformGrid::uniformGrid
Foam::uniformGrid::uniformGrid
(
const dictionary& initialPointsDict,
const Time& runTime,
@ -58,18 +57,18 @@ uniformGrid::uniformGrid
cellShapeControls,
decomposition
),
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
initialCellSize_(detailsDict().get<scalar>("initialCellSize")),
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
randomPerturbationCoeff_
(
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
detailsDict().get<scalar>("randomPerturbationCoeff")
)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
List<Vb::Point> uniformGrid::initialPoints() const
Foam::List<Vb::Point> Foam::uniformGrid::initialPoints() const
{
boundBox bb;
@ -176,8 +175,4 @@ List<Vb::Point> uniformGrid::initialPoints() const
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,7 +51,6 @@ class uniformGrid
:
public initialPointsMethod
{
private:
// Private data
@ -86,8 +85,7 @@ public:
//- Destructor
virtual ~uniformGrid()
{}
virtual ~uniformGrid() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,27 +26,25 @@ License
#include "adaptiveLinear.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(adaptiveLinear, 0);
addToRunTimeSelectionTable(relaxationModel, adaptiveLinear, dictionary);
defineTypeNameAndDebug(adaptiveLinear, 0);
addToRunTimeSelectionTable(relaxationModel, adaptiveLinear, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
adaptiveLinear::adaptiveLinear
Foam::adaptiveLinear::adaptiveLinear
(
const dictionary& relaxationDict,
const Time& runTime
)
:
relaxationModel(typeName, relaxationDict, runTime),
relaxationStart_(readScalar(coeffDict().lookup("relaxationStart"))),
relaxationEnd_(readScalar(coeffDict().lookup("relaxationEnd"))),
relaxationStart_(coeffDict().get<scalar>("relaxationStart")),
relaxationEnd_(coeffDict().get<scalar>("relaxationEnd")),
lastTimeValue_(runTime_.time().timeOutputValue()),
relaxation_(relaxationStart_)
{}
@ -54,7 +52,7 @@ adaptiveLinear::adaptiveLinear
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
scalar adaptiveLinear::relaxation()
Foam::scalar Foam::adaptiveLinear::relaxation()
{
if (runTime_.time().timeOutputValue() > lastTimeValue_)
{
@ -80,8 +78,4 @@ scalar adaptiveLinear::relaxation()
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -52,7 +52,6 @@ class adaptiveLinear
:
public relaxationModel
{
private:
// Private data
@ -88,8 +87,7 @@ public:
//- Destructor
virtual ~adaptiveLinear()
{}
virtual ~adaptiveLinear() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -26,30 +26,29 @@ License
#include "rampHoldFall.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(rampHoldFall, 0);
addToRunTimeSelectionTable(relaxationModel, rampHoldFall, dictionary);
}
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineTypeNameAndDebug(rampHoldFall, 0);
addToRunTimeSelectionTable(relaxationModel, rampHoldFall, dictionary);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
rampHoldFall::rampHoldFall
Foam::rampHoldFall::rampHoldFall
(
const dictionary& relaxationDict,
const Time& runTime
)
:
relaxationModel(typeName, relaxationDict, runTime),
rampStartRelaxation_(readScalar(coeffDict().lookup("rampStartRelaxation"))),
holdRelaxation_(readScalar(coeffDict().lookup("holdRelaxation"))),
fallEndRelaxation_(readScalar(coeffDict().lookup("fallEndRelaxation"))),
rampEndFraction_(readScalar(coeffDict().lookup("rampEndFraction"))),
fallStartFraction_(readScalar(coeffDict().lookup("fallStartFraction"))),
rampStartRelaxation_(coeffDict().get<scalar>("rampStartRelaxation")),
holdRelaxation_(coeffDict().get<scalar>("holdRelaxation")),
fallEndRelaxation_(coeffDict().get<scalar>("fallEndRelaxation")),
rampEndFraction_(coeffDict().get<scalar>("rampEndFraction")),
fallStartFraction_(coeffDict().get<scalar>("fallStartFraction")),
rampGradient_((holdRelaxation_ - rampStartRelaxation_)/(rampEndFraction_)),
fallGradient_
(
@ -60,7 +59,7 @@ rampHoldFall::rampHoldFall
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
scalar rampHoldFall::relaxation()
Foam::scalar Foam::rampHoldFall::relaxation()
{
scalar t = runTime_.time().timeOutputValue();
@ -98,6 +97,5 @@ scalar rampHoldFall::relaxation()
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -51,7 +51,6 @@ class rampHoldFall
:
public relaxationModel
{
private:
// Private data
@ -93,8 +92,7 @@ public:
//- Destructor
virtual ~rampHoldFall()
{}
virtual ~rampHoldFall() = default;
// Member Functions

View File

@ -58,7 +58,7 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
const Time& runTime
)
{
const word modelType(relaxationDict.lookup("relaxationModel"));
const word modelType(relaxationDict.get<word>("relaxationModel"));
Info<< nl << "Selecting relaxationModel " << modelType << endl;
@ -78,10 +78,4 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::relaxationModel::~relaxationModel()
{}
// ************************************************************************* //

View File

@ -66,9 +66,8 @@ protected:
//- Method coeffs dictionary
dictionary coeffDict_;
private:
// Private Member Functions
// Protected Member Functions
//- No copy construct
relaxationModel(const relaxationModel&) = delete;
@ -120,7 +119,7 @@ public:
//- Destructor
virtual ~relaxationModel();
virtual ~relaxationModel() = default;
// Member Functions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -32,15 +32,13 @@ License
namespace Foam
{
defineTypeNameAndDebug(triSurfaceMeshFeatures, 0);
addToRunTimeSelectionTable
(
searchableSurfaceFeatures,
triSurfaceMeshFeatures,
dict
);
defineTypeNameAndDebug(triSurfaceMeshFeatures, 0);
addToRunTimeSelectionTable
(
searchableSurfaceFeatures,
triSurfaceMeshFeatures,
dict
);
}
@ -53,7 +51,7 @@ Foam::triSurfaceMeshFeatures::triSurfaceMeshFeatures
)
:
searchableSurfaceFeatures(surface, dict),
includedAngle_(readScalar(dict.lookup("includedAngle"))),
includedAngle_(dict.get<scalar>("includedAngle")),
mode_
(
extendedFeatureEdgeMesh::sideVolumeTypeNames_
@ -70,19 +68,11 @@ Foam::triSurfaceMeshFeatures::triSurfaceMeshFeatures
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::triSurfaceMeshFeatures::~triSurfaceMeshFeatures()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::autoPtr<Foam::extendedFeatureEdgeMesh>
Foam::triSurfaceMeshFeatures::features() const
{
autoPtr<extendedFeatureEdgeMesh> features;
const triSurfaceMesh& surfMesh = refCast<const triSurfaceMesh>(surface());
surfaceFeatures sFeat(surfMesh, includedAngle_);
@ -94,18 +84,14 @@ Foam::triSurfaceMeshFeatures::features() const
(mode_ == extendedFeatureEdgeMesh::BOTH ? true : false)
);
features.reset
(
new extendedFeatureEdgeMesh
(
sFeat,
surface().db(),
surface().name() + ".extendedFeatureEdgeMesh",
surfBaffleRegions
)
);
return features;
return autoPtr<extendedFeatureEdgeMesh>::New
(
sFeat,
surface().db(),
surface().name() + ".extendedFeatureEdgeMesh",
surfBaffleRegions
);
}

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -85,7 +85,7 @@ public:
//- Destructor
virtual ~triSurfaceMeshFeatures();
virtual ~triSurfaceMeshFeatures() = default;
// Member Functions

View File

@ -150,10 +150,8 @@ Foam::CV2D::CV2D
),
z_
(
Foam::point
(
cvMeshDict.subDict("surfaceConformation").lookup("locationInMesh")
).z()
cvMeshDict.subDict("surfaceConformation")
.get<Foam::point>("locationInMesh").z()
),
startOfInternalPoints_(0),
startOfSurfacePointPairs_(0),
@ -187,10 +185,8 @@ void Foam::CV2D::insertPoints
label nVert = startOfInternalPoints_;
// Add the points and index them
forAll(points, i)
for (const point2D& p : points)
{
const point2D& p = points[i];
if (qSurf_.wellInside(toPoint3D(p), nearness))
{
insert(toPoint(p))->index() = nVert++;

View File

@ -152,7 +152,7 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D
)
:
cv2Dmesh_(cv2Dmesh),
shortEdgeFilterFactor_(readScalar(dict.lookup("shortEdgeFilterFactor"))),
shortEdgeFilterFactor_(dict.get<scalar>("shortEdgeFilterFactor")),
edgeAttachedToBoundaryFactor_
(
dict.lookupOrDefault<scalar>("edgeAttachedToBoundaryFactor", 2.0)
@ -226,8 +226,7 @@ Foam::shortEdgeFilter2D::~shortEdgeFilter2D()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void
Foam::shortEdgeFilter2D::filter()
void Foam::shortEdgeFilter2D::filter()
{
// These are global indices.
const pointField& points = ms_.points();

View File

@ -66,7 +66,7 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
const dictionary& dict
)
{
const word sampleType(dict.lookup("type"));
const word sampleType(dict.get<word>("type"));
auto cstrIter = dictionaryConstructorTablePtr_->cfind(sampleType);

View File

@ -61,7 +61,7 @@ Foam::faceSelections::searchableSurfaceSelection::searchableSurfaceSelection
(
searchableSurface::New
(
word(dict.lookup("surface")),
dict.get<word>("surface"),
IOobject
(
dict.lookupOrDefault("name", mesh.objectRegistry::db().name()),

View File

@ -557,10 +557,9 @@ int main(int argc, char *argv[])
PtrList<dictionary> patchSources(dict.lookup("patches"));
wordHashSet addedPatchNames;
forAll(patchSources, addedI)
for (const dictionary& dict : patchSources)
{
const dictionary& dict = patchSources[addedI];
addedPatchNames.insert(dict.lookup("name"));
addedPatchNames.insert(dict.get<word>("name"));
}
@ -595,11 +594,9 @@ int main(int argc, char *argv[])
}
}
forAll(patchSources, addedI)
for (const dictionary& dict : patchSources)
{
const dictionary& dict = patchSources[addedI];
word patchName(dict.lookup("name"));
const word patchName(dict.get<word>("name"));
label destPatchi = patches.findPatchID(patchName);
@ -671,11 +668,9 @@ int main(int argc, char *argv[])
polyTopoChange meshMod(mesh);
forAll(patchSources, addedI)
for (const dictionary& dict : patchSources)
{
const dictionary& dict = patchSources[addedI];
const word patchName(dict.lookup("name"));
const word patchName(dict.get<word>("name"));
label destPatchi = patches.findPatchID(patchName);
if (destPatchi == -1)
@ -685,16 +680,13 @@ int main(int argc, char *argv[])
<< abort(FatalError);
}
const word sourceType(dict.lookup("constructFrom"));
const word sourceType(dict.get<word>("constructFrom"));
if (sourceType == "patches")
{
labelHashSet patchSources
(
patches.patchSet
(
wordReList(dict.lookup("patches"))
)
patches.patchSet(dict.get<wordRes>("patches"))
);
// Repatch faces of the patches.
@ -719,7 +711,7 @@ int main(int argc, char *argv[])
}
else if (sourceType == "set")
{
const word setName(dict.lookup("set"));
const word setName(dict.get<word>("set"));
faceSet faces(mesh, setName);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
\\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -45,7 +45,6 @@ Usage
- \par -dict \<dictionary\>
Specify a dictionary to read actions from.
Note
- can only handle pairwise boundary faces. So three faces using
the same points is not handled (is illegal mesh anyway)
@ -201,10 +200,10 @@ labelList patchFaces(const polyMesh& mesh, const labelList& patchIDs)
}
}
if (faceIDs.size() != sz)
{
FatalErrorInFunction << exit(FatalError);
}
if (faceIDs.size() != sz)
{
FatalErrorInFunction << exit(FatalError);
}
return faceIDs;
}
@ -332,8 +331,11 @@ int main(int argc, char *argv[])
if (dict.found("detect"))
{
wordReList patchNames(dict.subDict("detect").lookup("patches"));
detectPatchIDs = patches.patchSet(patchNames).sortedToc();
detectPatchIDs = patches.patchSet
(
dict.subDict("detect").get<wordRes>("patches")
).sortedToc();
Info<< "Detecting baffles on " << detectPatchIDs.size()
<< " patches with "
<< returnReduce(patchSize(mesh, detectPatchIDs), sumOp<label>())
@ -341,8 +343,11 @@ int main(int argc, char *argv[])
}
if (dict.found("merge"))
{
wordReList patchNames(dict.subDict("merge").lookup("patches"));
mergePatchIDs = patches.patchSet(patchNames).sortedToc();
mergePatchIDs = patches.patchSet
(
dict.subDict("merge").get<wordRes>("patches")
).sortedToc();
Info<< "Detecting baffles on " << mergePatchIDs.size()
<< " patches with "
<< returnReduce(patchSize(mesh, mergePatchIDs), sumOp<label>())
@ -350,8 +355,11 @@ int main(int argc, char *argv[])
}
if (dict.found("split"))
{
wordReList patchNames(dict.subDict("split").lookup("patches"));
splitPatchIDs = patches.patchSet(patchNames).sortedToc();
splitPatchIDs = patches.patchSet
(
dict.subDict("split").get<wordRes>("patches")
).sortedToc();
Info<< "Detecting baffles on " << splitPatchIDs.size()
<< " patches with "
<< returnReduce(patchSize(mesh, splitPatchIDs), sumOp<label>())

View File

@ -46,9 +46,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
{
plane mirrorPlane(mirrorMeshDict_);
scalar planeTolerance
const scalar planeTolerance
(
readScalar(mirrorMeshDict_.lookup("planeTolerance"))
mirrorMeshDict_.get<scalar>("planeTolerance")
);
const pointField& oldPoints = points();

View File

@ -14,7 +14,7 @@
plane mirrorPlane(mirrorMeshDict);
scalar planeTolerance
const scalar planeTolerance
(
readScalar(mirrorMeshDict.lookup("planeTolerance"))
mirrorMeshDict.get<scalar>("planeTolerance")
);

View File

@ -244,7 +244,7 @@ int main(int argc, char *argv[])
if (refineDict.size())
{
const word setName(refineDict.lookup("set"));
const word setName(refineDict.get<word>("set"));
cellSet cells(mesh, setName);