mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use restricted dictionary lookup for utilities (issue #762)
- get<label>, get<scalar> instead of readLabel, readScalar, etc.
This commit is contained in:
@ -92,7 +92,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
wordList polyMeshPatches
|
||||
(
|
||||
faMeshDefinition.lookup("polyMeshPatches")
|
||||
faMeshDefinition.get<wordList>("polyMeshPatches")
|
||||
);
|
||||
|
||||
const dictionary& bndDict = faMeshDefinition.subDict("boundary");
|
||||
@ -107,9 +107,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
faPatches[patchI].name_ = faPatchNames[patchI];
|
||||
|
||||
faPatches[patchI].type_ = word(curPatchDict.lookup("type"));
|
||||
faPatches[patchI].type_ = curPatchDict.get<word>("type");
|
||||
|
||||
const word ownName = curPatchDict.lookup("ownerPolyPatch");
|
||||
const word ownName(curPatchDict.get<word>("ownerPolyPatch"));
|
||||
|
||||
faPatches[patchI].ownPolyPatchID_ =
|
||||
mesh.boundaryMesh().findPatchID(ownName);
|
||||
@ -121,7 +121,7 @@ int main(int argc, char *argv[])
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
const word neiName = curPatchDict.lookup("neighbourPolyPatch");
|
||||
const word neiName(curPatchDict.get<word>("neighbourPolyPatch"));
|
||||
|
||||
faPatches[patchI].ngbPolyPatchID_ =
|
||||
mesh.boundaryMesh().findPatchID(neiName);
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"));
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -164,7 +164,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
~cv2DControls();
|
||||
~cv2DControls() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -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())
|
||||
{
|
||||
|
||||
@ -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()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -139,7 +139,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~cellSizeAndAlignmentControl();
|
||||
virtual ~cellSizeAndAlignmentControl() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -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
|
||||
|
||||
@ -90,7 +90,7 @@ public:
|
||||
);
|
||||
|
||||
//- Destructor
|
||||
~fileControl();
|
||||
~fileControl() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -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 "
|
||||
|
||||
@ -106,9 +106,7 @@ protected:
|
||||
label priority_;
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private Member Functions
|
||||
// Protected Member Functions
|
||||
|
||||
//- No copy construct
|
||||
cellSizeFunction(const cellSizeFunction&) = delete;
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -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()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -64,7 +64,7 @@ Foam::fieldFromFile::fieldFromFile
|
||||
cellSizeCalcTypeDict.optionalSubDict
|
||||
(
|
||||
typeName + "Coeffs"
|
||||
).lookup("fieldFile")
|
||||
).get<word>("fieldFile")
|
||||
),
|
||||
cellSizeMultipleCoeff_
|
||||
(
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -128,7 +128,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~surfaceCellSizeFunction();
|
||||
virtual ~surfaceCellSizeFunction() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -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
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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];
|
||||
|
||||
|
||||
@ -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
|
||||
)
|
||||
)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -151,7 +151,7 @@ public:
|
||||
);
|
||||
|
||||
//- Destructor
|
||||
~conformationSurfaces();
|
||||
~conformationSurfaces() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -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()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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_)
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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++;
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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()),
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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>())
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -14,7 +14,7 @@
|
||||
|
||||
plane mirrorPlane(mirrorMeshDict);
|
||||
|
||||
scalar planeTolerance
|
||||
const scalar planeTolerance
|
||||
(
|
||||
readScalar(mirrorMeshDict.lookup("planeTolerance"))
|
||||
mirrorMeshDict.get<scalar>("planeTolerance")
|
||||
);
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -175,7 +175,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
forAll(patchEntries, patchi)
|
||||
{
|
||||
const entry& e = patchEntries[patchi];
|
||||
const word type(e.dict().lookup("type"));
|
||||
const word type(e.dict().get<word>("type"));
|
||||
const word& name = e.keyword();
|
||||
|
||||
if
|
||||
@ -270,7 +270,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
forAll(patchEntries, patchi)
|
||||
{
|
||||
const entry& e = patchEntries[patchi];
|
||||
const word type(e.dict().lookup("type"));
|
||||
const word type(e.dict().get<word>("type"));
|
||||
const word& name = e.keyword();
|
||||
|
||||
if (type == processorPolyPatch::typeName)
|
||||
|
||||
@ -13,17 +13,17 @@ IOdictionary conversionProperties
|
||||
|
||||
scalar startTime
|
||||
(
|
||||
readScalar(conversionProperties.lookup("startTime"))
|
||||
conversionProperties.get<scalar>("startTime")
|
||||
);
|
||||
|
||||
word vComp
|
||||
(
|
||||
conversionProperties.lookup("vector")
|
||||
conversionProperties.get<word>("vector")
|
||||
);
|
||||
|
||||
word format
|
||||
(
|
||||
conversionProperties.lookup("format")
|
||||
conversionProperties.get<word>("format")
|
||||
);
|
||||
|
||||
if ((format != "ascii") && (format != "ieeei4r8"))
|
||||
@ -37,7 +37,7 @@ if ((format != "ascii") && (format != "ieeei4r8"))
|
||||
|
||||
word cells
|
||||
(
|
||||
conversionProperties.lookup("cells")
|
||||
conversionProperties.get<word>("cells")
|
||||
);
|
||||
|
||||
if
|
||||
|
||||
@ -365,7 +365,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
||||
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||
wordList groupNames;
|
||||
|
||||
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
|
||||
sizes[patchi] = patchDict.get<label>("nFaces");
|
||||
names[patchi] = patchEntries[patchi].keyword();
|
||||
|
||||
if
|
||||
|
||||
@ -9,10 +9,10 @@ IOdictionary propsDict
|
||||
)
|
||||
);
|
||||
|
||||
const word cloudName(propsDict.lookup("cloud"));
|
||||
const word cloudName(propsDict.get<word>("cloud"));
|
||||
|
||||
label sampleFrequency(readLabel(propsDict.lookup("sampleFrequency")));
|
||||
const label sampleFrequency(propsDict.get<label>("sampleFrequency"));
|
||||
|
||||
label maxPositions(readLabel(propsDict.lookup("maxPositions")));
|
||||
const label maxPositions(propsDict.get<label>("maxPositions"));
|
||||
|
||||
word setFormat(propsDict.lookupOrDefault<word>("setFormat", "vtk"));
|
||||
const word setFormat(propsDict.lookupOrDefault<word>("setFormat", "vtk"));
|
||||
|
||||
@ -10,11 +10,11 @@
|
||||
)
|
||||
);
|
||||
|
||||
const label nIntervals(readLabel(pdfDictionary.lookup("nIntervals")));
|
||||
const label nIntervals(pdfDictionary.get<label>("nIntervals"));
|
||||
|
||||
const label nSamples(readLabel(pdfDictionary.lookup("nSamples")));
|
||||
const label nSamples(pdfDictionary.get<label>("nSamples"));
|
||||
|
||||
const bool writeData(readBool(pdfDictionary.lookup("writeData")));
|
||||
const bool writeData(pdfDictionary.get<bool>("writeData"));
|
||||
|
||||
|
||||
const fileName pdfPath = runTime.path()/"pdf";
|
||||
|
||||
@ -223,12 +223,12 @@ Foam::channelIndex::channelIndex
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
symmetric_(readBool(dict.lookup("symmetric"))),
|
||||
symmetric_(dict.get<bool>("symmetric")),
|
||||
dir_(vectorComponentsNames_.lookup("component", dict))
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
const wordList patchNames(dict.lookup("patches"));
|
||||
const wordList patchNames(dict.get<wordList>("patches"));
|
||||
|
||||
label nFaces = 0;
|
||||
|
||||
|
||||
@ -12,6 +12,6 @@
|
||||
)
|
||||
);
|
||||
|
||||
scalar Ea(readScalar(boxTurbDict.lookup("Ea")));
|
||||
scalar Ea(boxTurbDict.get<scalar>("Ea"));
|
||||
|
||||
scalar k0(readScalar(boxTurbDict.lookup("k0")));
|
||||
scalar k0(boxTurbDict.get<scalar>("k0"));
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -28,8 +28,6 @@ License
|
||||
#include "polyMesh.H"
|
||||
#include "processorPolyPatch.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
@ -67,13 +65,13 @@ Foam::IOPtrList<Foam::entry> Foam::boundaryInfo::readBoundaryDict
|
||||
forAll(boundaryPatchList, patchI)
|
||||
{
|
||||
const dictionary& dict = boundaryPatchList[patchI].dict();
|
||||
const word pType = dict.lookup("type");
|
||||
const word pType = dict.get<word>("type");
|
||||
bool procPatch = pType == processorPolyPatch::typeName;
|
||||
|
||||
bool addPatch = true;
|
||||
if (!procPatch)
|
||||
{
|
||||
label nFaces = readLabel(dict.lookup("nFaces"));
|
||||
label nFaces = dict.get<label>("nFaces");
|
||||
reduce(nFaces, sumOp<label>());
|
||||
if (nFaces == 0)
|
||||
{
|
||||
@ -114,15 +112,14 @@ Foam::boundaryInfo::boundaryInfo(const Time& runTime, const word& regionName)
|
||||
const dictionary& dict = boundaryDict_[patchI].dict();
|
||||
|
||||
names_[patchI] = dict.dictName();
|
||||
dict.lookup("type") >> types_[patchI];
|
||||
dict.read("type", types_[patchI]);
|
||||
if (polyPatch::constraintType(types_[patchI]))
|
||||
{
|
||||
constraint_[patchI] = true;
|
||||
}
|
||||
|
||||
if (dict.found("inGroups"))
|
||||
if (dict.readIfPresent("inGroups", groups_[patchI]))
|
||||
{
|
||||
dict.lookup("inGroups") >> groups_[patchI];
|
||||
allGroupNames_.insert(groups_[patchI]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ Foam::word Foam::solverTemplate::readFromDict
|
||||
}
|
||||
|
||||
IOdictionary dict(dictHeader);
|
||||
return dict.lookup(entryName);
|
||||
return dict.get<word>(entryName);
|
||||
}
|
||||
|
||||
|
||||
@ -87,18 +87,17 @@ Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates
|
||||
dictionary fieldTemplates = solverDict.subDict("fluidFields");
|
||||
|
||||
const fileName turbModelDir(baseDir/"models"/"turbulence");
|
||||
word turbulenceModel("laminar"); // default to laminar
|
||||
|
||||
const dictionary fieldModels(solverDict.subDict("fluidModels"));
|
||||
|
||||
word turbulenceType = "none";
|
||||
word turbulenceModel("laminar"); // default to laminar
|
||||
word turbulenceType("none");
|
||||
|
||||
if (fieldModels.readIfPresent("turbulenceModel", turbulenceType))
|
||||
{
|
||||
word simulationType(word::null);
|
||||
|
||||
if (turbulenceType == "turbulenceModel")
|
||||
{
|
||||
IOdictionary turbulenceProperties
|
||||
IOdictionary turbPropDict
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
@ -112,26 +111,26 @@ Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates
|
||||
)
|
||||
);
|
||||
|
||||
turbulenceProperties.lookup("simulationType") >> simulationType;
|
||||
const word modelType(turbPropDict.get<word>("simulationType"));
|
||||
|
||||
if (simulationType == "laminar")
|
||||
if (modelType == "laminar")
|
||||
{
|
||||
// Leave turbulenceModel as laminar
|
||||
}
|
||||
else if (simulationType == "RAS")
|
||||
else if (modelType == "RAS")
|
||||
{
|
||||
turbulenceProperties.subDict(simulationType).lookup("RASModel")
|
||||
>> turbulenceModel;
|
||||
turbPropDict.subDict(modelType)
|
||||
.read("RASModel", turbulenceModel);
|
||||
}
|
||||
else if (simulationType == "LES")
|
||||
else if (modelType == "LES")
|
||||
{
|
||||
turbulenceProperties.subDict(simulationType).lookup("LESModel")
|
||||
>> turbulenceModel;
|
||||
turbPropDict.subDict(modelType)
|
||||
.read("LESModel", turbulenceModel);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unhandled turbulence model option " << simulationType
|
||||
<< "Unhandled turbulence model option " << modelType
|
||||
<< ". Valid options are laminar, RAS, LES"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -139,7 +138,7 @@ Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Unhandled turbulence model option " << simulationType
|
||||
<< "Unhandled turbulence model option " << turbulenceType
|
||||
<< ". Valid options are turbulenceModel"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -259,7 +258,7 @@ Foam::solverTemplate::solverTemplate
|
||||
solverType_ = solverTypeNames_.lookup("solverType", solverDict);
|
||||
Info<< solverTypeNames_[solverType_];
|
||||
|
||||
multiRegion_ = readBool(solverDict.lookup("multiRegion"));
|
||||
multiRegion_ = solverDict.get<bool>("multiRegion");
|
||||
if (multiRegion_)
|
||||
{
|
||||
Info<< ", multi-region";
|
||||
|
||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
||||
// Read control dictionary
|
||||
const IOdictionary agglomDict(dictIO);
|
||||
|
||||
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
|
||||
const bool writeAgglom(agglomDict.get<bool>("writeFacesAgglomeration"));
|
||||
|
||||
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
|
||||
|
||||
|
||||
@ -95,10 +95,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
const shapeSelector::shapeType surfType
|
||||
(
|
||||
shapeSelector::shapeTypeNames.read(dict.lookup("type"))
|
||||
shapeSelector::shapeTypeNames.lookup("type", dict)
|
||||
);
|
||||
const vector centre(dict.lookup("centre"));
|
||||
const word fieldName(dict.lookup("field"));
|
||||
const vector centre(dict.get<vector>("centre"));
|
||||
const word fieldName(dict.get<word>("field"));
|
||||
|
||||
Info<< "Reading field " << fieldName << "\n" << endl;
|
||||
volScalarField alpha1
|
||||
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
case shapeSelector::shapeType::PLANE:
|
||||
{
|
||||
const vector direction(dict.lookup("direction"));
|
||||
const vector direction(dict.get<vector>("direction"));
|
||||
|
||||
f = -(mesh.points() - centre) & (direction/mag(direction));
|
||||
f0 = 0.0;
|
||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
case shapeSelector::shapeType::SPHERE:
|
||||
{
|
||||
const scalar radius(readScalar(dict.lookup("radius")));
|
||||
const scalar radius(dict.get<scalar>("radius"));
|
||||
|
||||
f = -mag(mesh.points() - centre);
|
||||
f0 = -radius;
|
||||
@ -140,8 +140,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
case shapeSelector::shapeType::CYLINDER:
|
||||
{
|
||||
const scalar radius(readScalar(dict.lookup("radius")));
|
||||
const vector direction(dict.lookup("direction"));
|
||||
const scalar radius(dict.get<scalar>("radius"));
|
||||
const vector direction(dict.get<vector>("direction"));
|
||||
|
||||
f = -sqrt
|
||||
(
|
||||
@ -153,10 +153,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
case shapeSelector::shapeType::SIN:
|
||||
{
|
||||
const scalar period(readScalar(dict.lookup("period")));
|
||||
const scalar amplitude(readScalar(dict.lookup("amplitude")));
|
||||
const vector up(dict.lookup("up"));
|
||||
const vector direction(dict.lookup("direction"));
|
||||
const scalar period(dict.get<scalar>("period"));
|
||||
const scalar amplitude(dict.get<scalar>("amplitude"));
|
||||
const vector up(dict.get<vector>("up"));
|
||||
const vector direction(dict.get<vector>("direction"));
|
||||
|
||||
const scalarField xx
|
||||
(
|
||||
|
||||
@ -124,8 +124,8 @@ Foam::tabulatedWallFunctions::SpaldingsLaw::SpaldingsLaw
|
||||
)
|
||||
:
|
||||
tabulatedWallFunction(dict, mesh, typeName),
|
||||
kappa_(readScalar(coeffDict_.lookup("kappa"))),
|
||||
E_(readScalar(coeffDict_.lookup("E")))
|
||||
kappa_(coeffDict_.get<scalar>("kappa")),
|
||||
E_(coeffDict_.get<scalar>("E"))
|
||||
{
|
||||
invertFunction();
|
||||
|
||||
@ -136,12 +136,6 @@ Foam::tabulatedWallFunctions::SpaldingsLaw::SpaldingsLaw
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tabulatedWallFunctions::SpaldingsLaw::~SpaldingsLaw()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::scalar Foam::tabulatedWallFunctions::SpaldingsLaw::yPlus
|
||||
|
||||
@ -105,8 +105,9 @@ public:
|
||||
// Constructors
|
||||
SpaldingsLaw(const dictionary& dict, const polyMesh& mesh);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~SpaldingsLaw();
|
||||
virtual ~SpaldingsLaw() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -54,13 +54,7 @@ Foam::searchableSurfaceModifiers::autoPatch::autoPatch
|
||||
)
|
||||
:
|
||||
searchableSurfaceModifier(geometry, dict),
|
||||
featureAngle_(readScalar(dict.lookup("featureAngle")))
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::searchableSurfaceModifiers::autoPatch::~autoPatch()
|
||||
featureAngle_(dict.get<scalar>("featureAngle"))
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -59,8 +59,6 @@ class autoPatch
|
||||
const scalar featureAngle_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -70,7 +68,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
autoPatch(const searchableSurfaces&, const dictionary&);
|
||||
autoPatch(const searchableSurfaces& geometry, const dictionary& dict);
|
||||
|
||||
//- Clone
|
||||
autoPtr<searchableSurfaceModifier> clone() const
|
||||
@ -81,7 +79,7 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~autoPatch();
|
||||
virtual ~autoPatch() = default;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -226,7 +226,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const dictionary& surfDict = meshSubsetDict.subDict("surface");
|
||||
|
||||
fileName surfName(surfDict.lookup("name"));
|
||||
const fileName surfName(surfDict.get<fileName>("name"));
|
||||
|
||||
const bool outside(surfDict.get<bool>("outside"));
|
||||
|
||||
@ -282,8 +282,8 @@ int main(int argc, char *argv[])
|
||||
const dictionary& planeDict = meshSubsetDict.subDict("plane");
|
||||
|
||||
const plane pl(planeDict);
|
||||
const scalar distance(readScalar(planeDict.lookup("distance")));
|
||||
const scalar cosAngle(readScalar(planeDict.lookup("cosAngle")));
|
||||
const scalar distance(planeDict.get<scalar>("distance"));
|
||||
const scalar cosAngle(planeDict.get<scalar>("cosAngle"));
|
||||
|
||||
// Select all triangles that are close to the plane and
|
||||
// whose normal aligns with the plane as well.
|
||||
|
||||
@ -82,12 +82,11 @@ int main(int argc, char *argv[])
|
||||
dictionary control(controlFile);
|
||||
|
||||
|
||||
scalar P(readScalar(control.lookup("P")));
|
||||
scalar T0(readScalar(control.lookup("T0")));
|
||||
const word fuelName(control.lookup("fuel"));
|
||||
scalar n(readScalar(control.lookup("n")));
|
||||
scalar m(readScalar(control.lookup("m")));
|
||||
|
||||
const scalar P(control.get<scalar>("P"));
|
||||
const scalar T0(control.get<scalar>("T0"));
|
||||
const word fuelName(control.get<word>("fuel"));
|
||||
const scalar n(control.get<scalar>("n"));
|
||||
const scalar m(control.get<scalar>("m"));
|
||||
|
||||
Info<< nl << "Reading thermodynamic data dictionary" << endl;
|
||||
|
||||
|
||||
@ -85,10 +85,10 @@ int main(int argc, char *argv[])
|
||||
dictionary control(controlFile);
|
||||
|
||||
|
||||
scalar P(readScalar(control.lookup("P")));
|
||||
const word fuelName(control.lookup("fuel"));
|
||||
scalar n(readScalar(control.lookup("n")));
|
||||
scalar m(readScalar(control.lookup("m")));
|
||||
const scalar P(control.get<scalar>("P"));
|
||||
const word fuelName(control.get<word>("fuel"));
|
||||
const scalar n(control.get<scalar>("n"));
|
||||
const scalar m(control.get<scalar>("m"));
|
||||
|
||||
|
||||
Info<< nl << "Reading thermodynamic data dictionary" << endl;
|
||||
|
||||
@ -81,8 +81,8 @@ int main(int argc, char *argv[])
|
||||
dictionary control(controlFile);
|
||||
|
||||
|
||||
scalar P(readScalar(control.lookup("P")));
|
||||
scalar T0(readScalar(control.lookup("T0")));
|
||||
const scalar P(control.get<scalar>("P"));
|
||||
const scalar T0(control.get<scalar>("T0"));
|
||||
mixture rMix(control.lookup("reactants"));
|
||||
mixture pMix(control.lookup("products"));
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ Foam::LESModel<BasicTurbulenceModel>::New
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
).subDict("LES").lookup("LESModel")
|
||||
).subDict("LES").get<word>("LESModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting LES turbulence model " << modelType << endl;
|
||||
|
||||
@ -138,7 +138,7 @@ Foam::RASModel<BasicTurbulenceModel>::New
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
).subDict("RAS").lookup("RASModel")
|
||||
).subDict("RAS").get<word>("RASModel")
|
||||
);
|
||||
|
||||
Info<< "Selecting RAS turbulence model " << modelType << endl;
|
||||
|
||||
@ -32,8 +32,8 @@ IOdictionary turbulenceProperties
|
||||
);
|
||||
const dictionary& MaxwellCoeffs =
|
||||
turbulenceProperties.subDict("laminar").subDict("MaxwellCoeffs");
|
||||
const scalar nu1 = readScalar(MaxwellCoeffs.lookup("nuM"));
|
||||
const scalar lambda = readScalar(MaxwellCoeffs.lookup("lambda"));
|
||||
const scalar nu1 = MaxwellCoeffs.get<scalar>("nuM");
|
||||
const scalar lambda = MaxwellCoeffs.get<scalar>("lambda");
|
||||
|
||||
const scalar rho = 1;
|
||||
|
||||
@ -52,7 +52,7 @@ IOdictionary fvOptions
|
||||
const dictionary& gradPDict =
|
||||
fvOptions.subDict("momentumSource").subDict("injectionRateSuSp");
|
||||
const scalar K =
|
||||
Tuple2<vector, scalar>(gradPDict.lookup("U")).first().x();
|
||||
gradPDict.get<Tuple2<vector, scalar>>("U").first().x();
|
||||
|
||||
dictionary probes(IFstream(runTime.system()/"probes")());
|
||||
const point location = pointField(probes.lookup("probeLocations"))[0];
|
||||
|
||||
Reference in New Issue
Block a user