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
|
wordList polyMeshPatches
|
||||||
(
|
(
|
||||||
faMeshDefinition.lookup("polyMeshPatches")
|
faMeshDefinition.get<wordList>("polyMeshPatches")
|
||||||
);
|
);
|
||||||
|
|
||||||
const dictionary& bndDict = faMeshDefinition.subDict("boundary");
|
const dictionary& bndDict = faMeshDefinition.subDict("boundary");
|
||||||
@ -107,9 +107,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
faPatches[patchI].name_ = faPatchNames[patchI];
|
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_ =
|
faPatches[patchI].ownPolyPatchID_ =
|
||||||
mesh.boundaryMesh().findPatchID(ownName);
|
mesh.boundaryMesh().findPatchID(ownName);
|
||||||
@ -121,7 +121,7 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const word neiName = curPatchDict.lookup("neighbourPolyPatch");
|
const word neiName(curPatchDict.get<word>("neighbourPolyPatch"));
|
||||||
|
|
||||||
faPatches[patchI].ngbPolyPatchID_ =
|
faPatches[patchI].ngbPolyPatchID_ =
|
||||||
mesh.boundaryMesh().findPatchID(neiName);
|
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"));
|
pointField outsidePts(refineDict.lookup("outsidePoints"));
|
||||||
bool useSurface(readBool(refineDict.lookup("useSurface")));
|
const bool useSurface(refineDict.get<bool>("useSurface"));
|
||||||
bool selectCut(readBool(refineDict.lookup("selectCut")));
|
const bool selectCut(refineDict.get<bool>("selectCut"));
|
||||||
bool selectInside(readBool(refineDict.lookup("selectInside")));
|
const bool selectInside(refineDict.get<bool>("selectInside"));
|
||||||
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
|
const bool selectOutside(refineDict.get<bool>("selectOutside"));
|
||||||
scalar nearDist(readScalar(refineDict.lookup("nearDistance")));
|
const scalar nearDist(refineDict.get<scalar>("nearDistance"));
|
||||||
|
|
||||||
|
|
||||||
if (useSurface)
|
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();
|
surfName.expand();
|
||||||
label nCutLayers(readLabel(refineDict.lookup("nCutLayers")));
|
const label nCutLayers(refineDict.get<label>("nCutLayers"));
|
||||||
label cellLimit(readLabel(refineDict.lookup("cellLimit")));
|
const label cellLimit(refineDict.get<label>("cellLimit"));
|
||||||
bool selectCut(readBool(refineDict.lookup("selectCut")));
|
const bool selectCut(refineDict.get<bool>("selectCut"));
|
||||||
bool selectInside(readBool(refineDict.lookup("selectInside")));
|
const bool selectInside(refineDict.get<bool>("selectInside"));
|
||||||
bool selectOutside(readBool(refineDict.lookup("selectOutside")));
|
const bool selectOutside(refineDict.get<bool>("selectOutside"));
|
||||||
bool selectHanging(readBool(refineDict.lookup("selectHanging")));
|
const bool selectHanging(refineDict.get<bool>("selectHanging"));
|
||||||
|
|
||||||
scalar minEdgeLen(readScalar(refineDict.lookup("minEdgeLen")));
|
const scalar minEdgeLen(refineDict.get<scalar>("minEdgeLen"));
|
||||||
scalar maxEdgeLen(readScalar(refineDict.lookup("maxEdgeLen")));
|
const scalar maxEdgeLen(refineDict.get<scalar>("maxEdgeLen"));
|
||||||
scalar curvature(readScalar(refineDict.lookup("curvature")));
|
const scalar curvature(refineDict.get<scalar>("curvature"));
|
||||||
scalar curvDist(readScalar(refineDict.lookup("curvatureDistance")));
|
const scalar curvDist(refineDict.get<scalar>("curvatureDistance"));
|
||||||
pointField outsidePts(refineDict.lookup("outsidePoints"));
|
pointField outsidePts(refineDict.lookup("outsidePoints"));
|
||||||
label refinementLimit(readLabel(refineDict.lookup("splitLevel")));
|
const label refinementLimit(refineDict.get<label>("splitLevel"));
|
||||||
bool writeMesh(readBool(refineDict.lookup("writeMesh")));
|
const bool writeMesh(refineDict.get<bool>("writeMesh"));
|
||||||
|
|
||||||
Info<< "Cells to be used for meshing (0=false, 1=true):" << nl
|
Info<< "Cells to be used for meshing (0=false, 1=true):" << nl
|
||||||
<< " cells cut by surface : " << selectCut << nl
|
<< " cells cut by surface : " << selectCut << nl
|
||||||
|
|||||||
@ -1505,7 +1505,7 @@ int main(int argc, char *argv[])
|
|||||||
autoPtr<extrudeModel> model(extrudeModel::New(dict));
|
autoPtr<extrudeModel> model(extrudeModel::New(dict));
|
||||||
|
|
||||||
// Region
|
// Region
|
||||||
const word shellRegionName(dict.lookup("region"));
|
const word shellRegionName(dict.get<word>("region"));
|
||||||
|
|
||||||
// Faces to extrude - either faceZones or faceSets (boundary faces only)
|
// Faces to extrude - either faceZones or faceSets (boundary faces only)
|
||||||
wordList zoneNames;
|
wordList zoneNames;
|
||||||
@ -1534,7 +1534,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
mappedPatchBase::sampleMode sampleMode =
|
mappedPatchBase::sampleMode sampleMode =
|
||||||
mappedPatchBase::sampleModeNames_[dict.lookup("sampleMode")];
|
mappedPatchBase::sampleModeNames_.lookup("sampleMode", dict);
|
||||||
|
|
||||||
const bool oneD(dict.get<bool>("oneD"));
|
const bool oneD(dict.get<bool>("oneD"));
|
||||||
bool oneDNonManifoldEdges(false);
|
bool oneDNonManifoldEdges(false);
|
||||||
@ -1542,7 +1542,7 @@ int main(int argc, char *argv[])
|
|||||||
if (oneD)
|
if (oneD)
|
||||||
{
|
{
|
||||||
oneDNonManifoldEdges = dict.lookupOrDefault("nonManifold", false);
|
oneDNonManifoldEdges = dict.lookupOrDefault("nonManifold", false);
|
||||||
dict.lookup("oneDPolyPatchType") >> oneDPatchType;
|
oneDPatchType = dict.get<word>("oneDPolyPatchType");
|
||||||
}
|
}
|
||||||
|
|
||||||
const bool adaptMesh(dict.get<bool>("adaptMesh"));
|
const bool adaptMesh(dict.get<bool>("adaptMesh"));
|
||||||
|
|||||||
@ -90,8 +90,8 @@ Foam::extrude2DMesh::extrude2DMesh
|
|||||||
dict_(dict),
|
dict_(dict),
|
||||||
//patchDict_(dict.subDict("patchInfo")),
|
//patchDict_(dict.subDict("patchInfo")),
|
||||||
model_(model),
|
model_(model),
|
||||||
modelType_(dict.lookup("extrudeModel")),
|
modelType_(dict.get<word>("extrudeModel")),
|
||||||
patchType_(dict.lookup("patchType")),
|
patchType_(dict.get<word>("patchType")),
|
||||||
frontPatchi_(-1),
|
frontPatchi_(-1),
|
||||||
backPatchi_(-1)
|
backPatchi_(-1)
|
||||||
{
|
{
|
||||||
@ -99,12 +99,6 @@ Foam::extrude2DMesh::extrude2DMesh
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::extrude2DMesh::~extrude2DMesh()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::extrude2DMesh::addFrontBackPatches()
|
void Foam::extrude2DMesh::addFrontBackPatches()
|
||||||
|
|||||||
@ -77,6 +77,7 @@ class extrude2DMesh
|
|||||||
const word patchType_;
|
const word patchType_;
|
||||||
|
|
||||||
label frontPatchi_;
|
label frontPatchi_;
|
||||||
|
|
||||||
label backPatchi_;
|
label backPatchi_;
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
@ -109,7 +110,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~extrude2DMesh();
|
~extrude2DMesh() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -27,7 +27,6 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
Foam::cv2DControls::cv2DControls
|
Foam::cv2DControls::cv2DControls
|
||||||
(
|
(
|
||||||
const dictionary& controlDict,
|
const dictionary& controlDict,
|
||||||
@ -39,43 +38,61 @@ Foam::cv2DControls::cv2DControls
|
|||||||
motionControl_(controlDict.subDict("motionControl")),
|
motionControl_(controlDict.subDict("motionControl")),
|
||||||
conformationControl_(controlDict.subDict("surfaceConformation")),
|
conformationControl_(controlDict.subDict("surfaceConformation")),
|
||||||
|
|
||||||
minCellSize_(readScalar(motionControl_.lookup("minCellSize"))),
|
minCellSize_(motionControl_.get<scalar>("minCellSize")),
|
||||||
minCellSize2_(Foam::sqr(minCellSize_)),
|
minCellSize2_(Foam::sqr(minCellSize_)),
|
||||||
|
|
||||||
maxQuadAngle_(readScalar(conformationControl_.lookup("maxQuadAngle"))),
|
maxQuadAngle_(conformationControl_.get<scalar>("maxQuadAngle")),
|
||||||
|
|
||||||
nearWallAlignedDist_
|
nearWallAlignedDist_
|
||||||
(
|
(
|
||||||
readScalar(motionControl_.lookup("nearWallAlignedDist"))*minCellSize_
|
motionControl_.get<scalar>("nearWallAlignedDist") * minCellSize_
|
||||||
),
|
),
|
||||||
nearWallAlignedDist2_(Foam::sqr(nearWallAlignedDist_)),
|
nearWallAlignedDist2_(Foam::sqr(nearWallAlignedDist_)),
|
||||||
|
|
||||||
insertSurfaceNearestPointPairs_
|
insertSurfaceNearestPointPairs_
|
||||||
(
|
(
|
||||||
conformationControl_.lookup("insertSurfaceNearestPointPairs")
|
conformationControl_.get<Switch>
|
||||||
|
(
|
||||||
|
"insertSurfaceNearestPointPairs"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
mirrorPoints_
|
||||||
|
(
|
||||||
|
conformationControl_.get<Switch>
|
||||||
|
(
|
||||||
|
"mirrorPoints"
|
||||||
|
)
|
||||||
),
|
),
|
||||||
mirrorPoints_(conformationControl_.lookup("mirrorPoints")),
|
|
||||||
insertSurfaceNearPointPairs_
|
insertSurfaceNearPointPairs_
|
||||||
(
|
(
|
||||||
conformationControl_.lookup("insertSurfaceNearPointPairs")
|
conformationControl_.get<Switch>
|
||||||
|
(
|
||||||
|
"insertSurfaceNearPointPairs"
|
||||||
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
objOutput_(motionControl_.lookupOrDefault<Switch>("objOutput", false)),
|
objOutput_
|
||||||
|
(
|
||||||
|
motionControl_.lookupOrDefault<Switch>("objOutput", false)
|
||||||
|
),
|
||||||
|
|
||||||
meshedSurfaceOutput_
|
meshedSurfaceOutput_
|
||||||
(
|
(
|
||||||
motionControl_.lookupOrDefault<Switch>("meshedSurfaceOutput", false)
|
motionControl_.lookupOrDefault<Switch>("meshedSurfaceOutput", false)
|
||||||
),
|
),
|
||||||
|
|
||||||
randomiseInitialGrid_(conformationControl_.lookup("randomiseInitialGrid")),
|
randomiseInitialGrid_
|
||||||
|
(
|
||||||
|
conformationControl_.get<Switch>("randomiseInitialGrid")
|
||||||
|
),
|
||||||
randomPerturbation_
|
randomPerturbation_
|
||||||
(
|
(
|
||||||
readScalar(conformationControl_.lookup("randomPerturbation"))
|
conformationControl_.get<scalar>("randomPerturbation")
|
||||||
),
|
),
|
||||||
|
|
||||||
maxBoundaryConformingIter_
|
maxBoundaryConformingIter_
|
||||||
(
|
(
|
||||||
readLabel(conformationControl_.lookup("maxBoundaryConformingIter"))
|
conformationControl_.get<label>("maxBoundaryConformingIter")
|
||||||
),
|
),
|
||||||
|
|
||||||
span_
|
span_
|
||||||
@ -87,39 +104,29 @@ Foam::cv2DControls::cv2DControls
|
|||||||
|
|
||||||
minEdgeLen_
|
minEdgeLen_
|
||||||
(
|
(
|
||||||
readScalar(conformationControl_.lookup("minEdgeLenCoeff"))
|
conformationControl_.get<scalar>("minEdgeLenCoeff") * minCellSize_
|
||||||
*minCellSize_
|
|
||||||
),
|
),
|
||||||
minEdgeLen2_(Foam::sqr(minEdgeLen_)),
|
minEdgeLen2_(Foam::sqr(minEdgeLen_)),
|
||||||
|
|
||||||
maxNotchLen_
|
maxNotchLen_
|
||||||
(
|
(
|
||||||
readScalar(conformationControl_.lookup("maxNotchLenCoeff"))
|
conformationControl_.get<scalar>("maxNotchLenCoeff") * minCellSize_
|
||||||
*minCellSize_
|
|
||||||
),
|
),
|
||||||
maxNotchLen2_(Foam::sqr(maxNotchLen_)),
|
maxNotchLen2_(Foam::sqr(maxNotchLen_)),
|
||||||
|
|
||||||
minNearPointDist_
|
minNearPointDist_
|
||||||
(
|
(
|
||||||
readScalar(conformationControl_.lookup("minNearPointDistCoeff"))
|
conformationControl_.get<scalar>("minNearPointDistCoeff")*minCellSize_
|
||||||
*minCellSize_
|
|
||||||
),
|
),
|
||||||
minNearPointDist2_(Foam::sqr(minNearPointDist_)),
|
minNearPointDist2_(Foam::sqr(minNearPointDist_)),
|
||||||
|
|
||||||
ppDist_
|
ppDist_
|
||||||
(
|
(
|
||||||
readScalar(conformationControl_.lookup("pointPairDistanceCoeff"))
|
conformationControl_.get<scalar>("pointPairDistanceCoeff")*minCellSize_
|
||||||
*minCellSize_
|
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::cv2DControls::~cv2DControls()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::cv2DControls::write(Ostream& os) const
|
void Foam::cv2DControls::write(Ostream& os) const
|
||||||
|
|||||||
@ -164,7 +164,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~cv2DControls();
|
~cv2DControls() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -801,14 +801,14 @@ Foam::backgroundMeshDecomposition::backgroundMeshDecomposition
|
|||||||
allBackgroundMeshBounds_(Pstream::nProcs()),
|
allBackgroundMeshBounds_(Pstream::nProcs()),
|
||||||
globalBackgroundBounds_(),
|
globalBackgroundBounds_(),
|
||||||
mergeDist_(1e-6*mesh_.bounds().mag()),
|
mergeDist_(1e-6*mesh_.bounds().mag()),
|
||||||
spanScale_(readScalar(coeffsDict.lookup("spanScale"))),
|
spanScale_(coeffsDict.get<scalar>("spanScale")),
|
||||||
minCellSizeLimit_
|
minCellSizeLimit_
|
||||||
(
|
(
|
||||||
coeffsDict.lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
|
coeffsDict.lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
|
||||||
),
|
),
|
||||||
minLevels_(readLabel(coeffsDict.lookup("minLevels"))),
|
minLevels_(coeffsDict.get<label>("minLevels")),
|
||||||
volRes_(readLabel(coeffsDict.lookup("sampleResolution"))),
|
volRes_(coeffsDict.get<label>("sampleResolution")),
|
||||||
maxCellWeightCoeff_(readScalar(coeffsDict.lookup("maxCellWeightCoeff")))
|
maxCellWeightCoeff_(coeffsDict.get<scalar>("maxCellWeightCoeff"))
|
||||||
{
|
{
|
||||||
if (!Pstream::parRun())
|
if (!Pstream::parRun())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -72,7 +72,7 @@ Foam::cellSizeAndAlignmentControl::New
|
|||||||
const scalar& defaultCellSize
|
const scalar& defaultCellSize
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word controlType(controlFunctionDict.lookup("type"));
|
const word controlType(controlFunctionDict.get<word>("type"));
|
||||||
|
|
||||||
Info<< indent << "Selecting cellSizeAndAlignmentControl "
|
Info<< indent << "Selecting cellSizeAndAlignmentControl "
|
||||||
<< controlType << endl;
|
<< controlType << endl;
|
||||||
@ -103,10 +103,4 @@ Foam::cellSizeAndAlignmentControl::New
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::cellSizeAndAlignmentControl::~cellSizeAndAlignmentControl()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -139,7 +139,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~cellSizeAndAlignmentControl();
|
virtual ~cellSizeAndAlignmentControl() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -70,10 +70,10 @@ Foam::fileControl::fileControl
|
|||||||
geometryToConformTo,
|
geometryToConformTo,
|
||||||
defaultCellSize
|
defaultCellSize
|
||||||
),
|
),
|
||||||
pointsFile_(controlFunctionDict.lookup("pointsFile")),
|
pointsFile_(controlFunctionDict.get<fileName>("pointsFile")),
|
||||||
sizesFile_(controlFunctionDict.lookup("sizesFile")),
|
sizesFile_(controlFunctionDict.get<fileName>("sizesFile")),
|
||||||
alignmentsFile_(controlFunctionDict.lookup("alignmentsFile")),
|
alignmentsFile_(controlFunctionDict.get<fileName>("alignmentsFile")),
|
||||||
maxPriority_(readLabel(controlFunctionDict.lookup("priority")))
|
maxPriority_(controlFunctionDict.get<label>("priority"))
|
||||||
{
|
{
|
||||||
Info<< indent << "Loading " << name << " from file:" << nl
|
Info<< indent << "Loading " << name << " from file:" << nl
|
||||||
<< indent << " priority : " << maxPriority_ << nl
|
<< indent << " priority : " << maxPriority_ << nl
|
||||||
@ -84,12 +84,6 @@ Foam::fileControl::fileControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::fileControl::~fileControl()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
//
|
//
|
||||||
//Foam::scalar Foam::fileControl::cellSize(const point& pt) const
|
//Foam::scalar Foam::fileControl::cellSize(const point& pt) const
|
||||||
|
|||||||
@ -90,7 +90,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~fileControl();
|
~fileControl() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -63,9 +63,9 @@ Foam::cellSizeFunction::cellSizeFunction
|
|||||||
defaultCellSize_(defaultCellSize),
|
defaultCellSize_(defaultCellSize),
|
||||||
regionIndices_(regionIndices),
|
regionIndices_(regionIndices),
|
||||||
sideMode_(),
|
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())
|
if (surface_.hasVolumeType())
|
||||||
{
|
{
|
||||||
@ -125,7 +125,7 @@ Foam::autoPtr<Foam::cellSizeFunction> Foam::cellSizeFunction::New
|
|||||||
{
|
{
|
||||||
const word functionName
|
const word functionName
|
||||||
(
|
(
|
||||||
cellSizeFunctionDict.lookup("cellSizeFunction")
|
cellSizeFunctionDict.get<word>("cellSizeFunction")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< indent << "Selecting cellSizeFunction "
|
Info<< indent << "Selecting cellSizeFunction "
|
||||||
|
|||||||
@ -106,9 +106,7 @@ protected:
|
|||||||
label priority_;
|
label priority_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
// Protected Member Functions
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
cellSizeFunction(const cellSizeFunction&) = delete;
|
cellSizeFunction(const cellSizeFunction&) = delete;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,20 +29,18 @@ License
|
|||||||
#include "triSurfaceFields.H"
|
#include "triSurfaceFields.H"
|
||||||
#include "volumeType.H"
|
#include "volumeType.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(linearDistance, 0);
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
addToRunTimeSelectionTable(cellSizeFunction, linearDistance, dictionary);
|
||||||
|
}
|
||||||
defineTypeNameAndDebug(linearDistance, 0);
|
|
||||||
addToRunTimeSelectionTable(cellSizeFunction, linearDistance, dictionary);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
linearDistance::linearDistance
|
Foam::linearDistance::linearDistance
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const searchableSurface& surface,
|
const searchableSurface& surface,
|
||||||
@ -60,12 +58,11 @@ linearDistance::linearDistance
|
|||||||
),
|
),
|
||||||
distanceCellSize_
|
distanceCellSize_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("distanceCellSizeCoeff"))
|
coeffsDict().get<scalar>("distanceCellSizeCoeff") * defaultCellSize
|
||||||
*defaultCellSize
|
|
||||||
),
|
),
|
||||||
distance_
|
distance_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("distanceCoeff"))*defaultCellSize
|
coeffsDict().get<scalar>("distanceCoeff") * defaultCellSize
|
||||||
),
|
),
|
||||||
distanceSqr_(sqr(distance_))
|
distanceSqr_(sqr(distance_))
|
||||||
{}
|
{}
|
||||||
@ -73,7 +70,7 @@ linearDistance::linearDistance
|
|||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar linearDistance::sizeFunction
|
Foam::scalar Foam::linearDistance::sizeFunction
|
||||||
(
|
(
|
||||||
const point& pt,
|
const point& pt,
|
||||||
scalar d,
|
scalar d,
|
||||||
@ -83,7 +80,7 @@ scalar linearDistance::sizeFunction
|
|||||||
const scalar interpolatedSize
|
const scalar interpolatedSize
|
||||||
= surfaceCellSizeFunction_().interpolate(pt, index);
|
= surfaceCellSizeFunction_().interpolate(pt, index);
|
||||||
|
|
||||||
scalar gradient
|
const scalar gradient
|
||||||
= (distanceCellSize_ - interpolatedSize)
|
= (distanceCellSize_ - interpolatedSize)
|
||||||
/distance_;
|
/distance_;
|
||||||
|
|
||||||
@ -95,7 +92,7 @@ scalar linearDistance::sizeFunction
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool linearDistance::sizeLocations
|
bool Foam::linearDistance::sizeLocations
|
||||||
(
|
(
|
||||||
const pointIndexHit& hitPt,
|
const pointIndexHit& hitPt,
|
||||||
const vector& n,
|
const vector& n,
|
||||||
@ -111,9 +108,9 @@ bool linearDistance::sizeLocations
|
|||||||
shapeSizes.resize(2);
|
shapeSizes.resize(2);
|
||||||
|
|
||||||
shapePts[0] = pt - n*distance_;
|
shapePts[0] = pt - n*distance_;
|
||||||
shapeSizes[0] = distanceCellSize_;
|
|
||||||
|
|
||||||
shapePts[1] = pt + n*distance_;
|
shapePts[1] = pt + n*distance_;
|
||||||
|
|
||||||
|
shapeSizes[0] = distanceCellSize_;
|
||||||
shapeSizes[1] = distanceCellSize_;
|
shapeSizes[1] = distanceCellSize_;
|
||||||
}
|
}
|
||||||
else if (sideMode_ == smInside)
|
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;
|
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());
|
// 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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -88,8 +88,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~linearDistance()
|
virtual ~linearDistance() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,20 +27,18 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "volumeType.H"
|
#include "volumeType.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(linearSpatial, 0);
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
addToRunTimeSelectionTable(cellSizeFunction, linearSpatial, dictionary);
|
||||||
|
}
|
||||||
defineTypeNameAndDebug(linearSpatial, 0);
|
|
||||||
addToRunTimeSelectionTable(cellSizeFunction, linearSpatial, dictionary);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
linearSpatial::linearSpatial
|
Foam::linearSpatial::linearSpatial
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const searchableSurface& surface,
|
const searchableSurface& surface,
|
||||||
@ -56,22 +54,28 @@ linearSpatial::linearSpatial
|
|||||||
defaultCellSize,
|
defaultCellSize,
|
||||||
regionIndices
|
regionIndices
|
||||||
),
|
),
|
||||||
referencePoint_(coeffsDict().lookup("referencePoint")),
|
referencePoint_
|
||||||
|
(
|
||||||
|
coeffsDict().get<point>("referencePoint")
|
||||||
|
),
|
||||||
referenceCellSize_
|
referenceCellSize_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("referenceCellSizeCoeff"))
|
coeffsDict().get<scalar>("referenceCellSizeCoeff") * defaultCellSize
|
||||||
*defaultCellSize
|
|
||||||
),
|
),
|
||||||
direction_(coeffsDict().lookup("direction")),
|
direction_
|
||||||
cellSizeGradient_(readScalar(coeffsDict().lookup("cellSizeGradient")))
|
(
|
||||||
{
|
coeffsDict().get<vector>("direction").normalise()
|
||||||
direction_ /= mag(direction_);
|
),
|
||||||
}
|
cellSizeGradient_
|
||||||
|
(
|
||||||
|
coeffsDict().get<scalar>("cellSizeGradient")
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar linearSpatial::sizeFunction(const point& pt) const
|
Foam::scalar Foam::linearSpatial::sizeFunction(const point& pt) const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
referenceCellSize_
|
referenceCellSize_
|
||||||
@ -82,7 +86,7 @@ scalar linearSpatial::sizeFunction(const point& pt) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool linearSpatial::sizeLocations
|
bool Foam::linearSpatial::sizeLocations
|
||||||
(
|
(
|
||||||
const pointIndexHit& hitPt,
|
const pointIndexHit& hitPt,
|
||||||
const vector& n,
|
const vector& n,
|
||||||
@ -104,7 +108,7 @@ bool linearSpatial::sizeLocations
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool linearSpatial::cellSize
|
bool Foam::linearSpatial::cellSize
|
||||||
(
|
(
|
||||||
const point& pt,
|
const point& pt,
|
||||||
scalar& size
|
scalar& size
|
||||||
@ -169,12 +173,7 @@ bool linearSpatial::cellSize
|
|||||||
}
|
}
|
||||||
|
|
||||||
return functionApplied;
|
return functionApplied;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -92,8 +92,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~linearSpatial()
|
virtual ~linearSpatial() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -29,22 +29,22 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(surfaceOffsetLinearDistance, 0);
|
namespace Foam
|
||||||
addToRunTimeSelectionTable
|
{
|
||||||
(
|
defineTypeNameAndDebug(surfaceOffsetLinearDistance, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
cellSizeFunction,
|
cellSizeFunction,
|
||||||
surfaceOffsetLinearDistance,
|
surfaceOffsetLinearDistance,
|
||||||
dictionary
|
dictionary
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
|
Foam::surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const searchableSurface& surface,
|
const searchableSurface& surface,
|
||||||
@ -62,48 +62,34 @@ surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
|
|||||||
),
|
),
|
||||||
distanceCellSize_
|
distanceCellSize_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("distanceCellSizeCoeff"))
|
coeffsDict().get<scalar>("distanceCellSizeCoeff") * defaultCellSize
|
||||||
*defaultCellSize
|
|
||||||
),
|
),
|
||||||
surfaceOffset_
|
surfaceOffset_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("surfaceOffsetCoeff"))*defaultCellSize
|
coeffsDict().get<scalar>("surfaceOffsetCoeff") * defaultCellSize
|
||||||
),
|
),
|
||||||
totalDistance_(),
|
totalDistance_(),
|
||||||
totalDistanceSqr_()
|
totalDistanceSqr_()
|
||||||
{
|
{
|
||||||
if
|
if (coeffsDict().found("totalDistanceCoeff"))
|
||||||
(
|
|
||||||
coeffsDict().found("totalDistanceCoeff")
|
|
||||||
|| coeffsDict().found("linearDistanceCoeff")
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
if
|
totalDistance_ =
|
||||||
(
|
coeffsDict().get<scalar>("totalDistanceCoeff") * defaultCellSize;
|
||||||
coeffsDict().found("totalDistanceCoeff")
|
|
||||||
&& coeffsDict().found("linearDistanceCoeff")
|
if (coeffsDict().found("linearDistanceCoeff"))
|
||||||
)
|
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "totalDistanceCoeff and linearDistanceCoeff found, "
|
<< "totalDistanceCoeff and linearDistanceCoeff found, "
|
||||||
<< "specify one or other, not both."
|
<< "specify one or other, not both."
|
||||||
<< nl << exit(FatalError) << endl;
|
<< nl << exit(FatalError) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coeffsDict().found("totalDistanceCoeff"))
|
|
||||||
{
|
|
||||||
totalDistance_ =
|
|
||||||
readScalar(coeffsDict().lookup("totalDistanceCoeff"))
|
|
||||||
*defaultCellSize;
|
|
||||||
}
|
}
|
||||||
else
|
else if (coeffsDict().found("linearDistanceCoeff"))
|
||||||
{
|
{
|
||||||
totalDistance_ =
|
totalDistance_ =
|
||||||
readScalar(coeffsDict().lookup("linearDistanceCoeff"))
|
coeffsDict().get<scalar>("linearDistanceCoeff") * defaultCellSize
|
||||||
*defaultCellSize
|
|
||||||
+ surfaceOffset_;
|
+ surfaceOffset_;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
@ -117,7 +103,7 @@ surfaceOffsetLinearDistance::surfaceOffsetLinearDistance
|
|||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar surfaceOffsetLinearDistance::sizeFunction
|
Foam::scalar Foam::surfaceOffsetLinearDistance::sizeFunction
|
||||||
(
|
(
|
||||||
const point& pt,
|
const point& pt,
|
||||||
scalar d,
|
scalar d,
|
||||||
@ -144,7 +130,7 @@ scalar surfaceOffsetLinearDistance::sizeFunction
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool surfaceOffsetLinearDistance::sizeLocations
|
bool Foam::surfaceOffsetLinearDistance::sizeLocations
|
||||||
(
|
(
|
||||||
const pointIndexHit& hitPt,
|
const pointIndexHit& hitPt,
|
||||||
const vector& n,
|
const vector& n,
|
||||||
@ -197,7 +183,7 @@ bool surfaceOffsetLinearDistance::sizeLocations
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool surfaceOffsetLinearDistance::cellSize
|
bool Foam::surfaceOffsetLinearDistance::cellSize
|
||||||
(
|
(
|
||||||
const point& pt,
|
const point& pt,
|
||||||
scalar& size
|
scalar& size
|
||||||
@ -275,8 +261,4 @@ bool surfaceOffsetLinearDistance::cellSize
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,19 +27,17 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "volumeType.H"
|
#include "volumeType.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(uniformDistance, 0);
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
addToRunTimeSelectionTable(cellSizeFunction, uniformDistance, dictionary);
|
||||||
|
}
|
||||||
defineTypeNameAndDebug(uniformDistance, 0);
|
|
||||||
addToRunTimeSelectionTable(cellSizeFunction, uniformDistance, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
uniformDistance::uniformDistance
|
Foam::uniformDistance::uniformDistance
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const searchableSurface& surface,
|
const searchableSurface& surface,
|
||||||
@ -57,7 +55,7 @@ uniformDistance::uniformDistance
|
|||||||
),
|
),
|
||||||
distance_
|
distance_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("distanceCoeff"))*defaultCellSize
|
coeffsDict().get<scalar>("distanceCoeff") * defaultCellSize
|
||||||
),
|
),
|
||||||
distanceSqr_(sqr(distance_))
|
distanceSqr_(sqr(distance_))
|
||||||
{}
|
{}
|
||||||
@ -66,7 +64,7 @@ uniformDistance::uniformDistance
|
|||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|
||||||
bool uniformDistance::sizeLocations
|
bool Foam::uniformDistance::sizeLocations
|
||||||
(
|
(
|
||||||
const pointIndexHit& hitPt,
|
const pointIndexHit& hitPt,
|
||||||
const vector& n,
|
const vector& n,
|
||||||
@ -85,9 +83,9 @@ bool uniformDistance::sizeLocations
|
|||||||
shapeSizes.resize(2);
|
shapeSizes.resize(2);
|
||||||
|
|
||||||
shapePts[0] = pt - n*distance_;
|
shapePts[0] = pt - n*distance_;
|
||||||
shapeSizes[0] = distanceCellSize;
|
|
||||||
|
|
||||||
shapePts[1] = pt + n*distance_;
|
shapePts[1] = pt + n*distance_;
|
||||||
|
|
||||||
|
shapeSizes[0] = distanceCellSize;
|
||||||
shapeSizes[1] = distanceCellSize;
|
shapeSizes[1] = distanceCellSize;
|
||||||
}
|
}
|
||||||
else if (sideMode_ == smInside)
|
else if (sideMode_ == smInside)
|
||||||
@ -111,7 +109,7 @@ bool uniformDistance::sizeLocations
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool uniformDistance::cellSize
|
bool Foam::uniformDistance::cellSize
|
||||||
(
|
(
|
||||||
const point& pt,
|
const point& pt,
|
||||||
scalar& size
|
scalar& size
|
||||||
@ -187,7 +185,7 @@ bool uniformDistance::cellSize
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool uniformDistance::setCellSize
|
bool Foam::uniformDistance::setCellSize
|
||||||
(
|
(
|
||||||
const pointField& pts
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -79,8 +79,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~uniformDistance()
|
virtual ~uniformDistance() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -120,11 +120,11 @@ Foam::automatic::automatic
|
|||||||
|
|
||||||
curvatureCellSizeCoeff_
|
curvatureCellSizeCoeff_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict_.lookup("curvatureCellSizeCoeff"))
|
coeffsDict_.get<scalar>("curvatureCellSizeCoeff")
|
||||||
),
|
),
|
||||||
maximumCellSize_
|
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
|
const word calculationType
|
||||||
(
|
(
|
||||||
cellSizeCalculationTypeDict.lookup("cellSizeCalculationType")
|
cellSizeCalculationTypeDict.get<word>("cellSizeCalculationType")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< indent << "Selecting 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
|
class cellSizeCalculationType
|
||||||
{
|
{
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
// Protected Data
|
||||||
|
|
||||||
const dictionary& cellSizeCalculationTypeDict_;
|
const dictionary& cellSizeCalculationTypeDict_;
|
||||||
|
|
||||||
//- Reference to the triSurfaceMesh
|
//- Reference to the triSurfaceMesh
|
||||||
@ -63,9 +64,7 @@ protected:
|
|||||||
const scalar& defaultCellSize_;
|
const scalar& defaultCellSize_;
|
||||||
|
|
||||||
|
|
||||||
private:
|
// Protected Member Functions
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
cellSizeCalculationType(const cellSizeCalculationType&) = delete;
|
cellSizeCalculationType(const cellSizeCalculationType&) = delete;
|
||||||
@ -120,7 +119,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~cellSizeCalculationType();
|
virtual ~cellSizeCalculationType() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -64,7 +64,7 @@ Foam::fieldFromFile::fieldFromFile
|
|||||||
cellSizeCalcTypeDict.optionalSubDict
|
cellSizeCalcTypeDict.optionalSubDict
|
||||||
(
|
(
|
||||||
typeName + "Coeffs"
|
typeName + "Coeffs"
|
||||||
).lookup("fieldFile")
|
).get<word>("fieldFile")
|
||||||
),
|
),
|
||||||
cellSizeMultipleCoeff_
|
cellSizeMultipleCoeff_
|
||||||
(
|
(
|
||||||
|
|||||||
@ -61,8 +61,8 @@ private:
|
|||||||
//- Dictionary of coefficients for automatic cell sizing
|
//- Dictionary of coefficients for automatic cell sizing
|
||||||
const dictionary& coeffsDict_;
|
const dictionary& coeffsDict_;
|
||||||
|
|
||||||
//- Name of the triSurfaceScalarField file to load in. Must be in
|
//- Name of the triSurfaceScalarField file to load in.
|
||||||
// constant/triSurface
|
// Must be in constant/triSurface
|
||||||
const word fileName_;
|
const word fileName_;
|
||||||
|
|
||||||
//- Multiply all the point sizes by this value
|
//- Multiply all the point sizes by this value
|
||||||
@ -87,8 +87,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~fieldFromFile()
|
virtual ~fieldFromFile() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -67,7 +67,7 @@ Foam::autoPtr<Foam::surfaceCellSizeFunction> Foam::surfaceCellSizeFunction::New
|
|||||||
{
|
{
|
||||||
const word functionName
|
const word functionName
|
||||||
(
|
(
|
||||||
surfaceCellSizeFunctionDict.lookup("surfaceCellSizeFunction")
|
surfaceCellSizeFunctionDict.get<word>("surfaceCellSizeFunction")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< indent << "Selecting 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
|
//- Destructor
|
||||||
virtual ~surfaceCellSizeFunction();
|
virtual ~surfaceCellSizeFunction() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -58,7 +58,7 @@ Foam::uniformValue::uniformValue
|
|||||||
),
|
),
|
||||||
surfaceCellSize_
|
surfaceCellSize_
|
||||||
(
|
(
|
||||||
readScalar(coeffsDict().lookup("surfaceCellSizeCoeff"))*defaultCellSize
|
coeffsDict().get<scalar>("surfaceCellSizeCoeff") * defaultCellSize
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,7 +49,6 @@ class uniformValue
|
|||||||
:
|
:
|
||||||
public surfaceCellSizeFunction
|
public surfaceCellSizeFunction
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -75,8 +74,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~uniformValue()
|
virtual ~uniformValue() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -516,10 +516,8 @@ void Foam::conformalVoronoiMesh::buildCellSizeAndAlignmentMesh()
|
|||||||
const dictionary& motionControlDict
|
const dictionary& motionControlDict
|
||||||
= foamyHexMeshControls().foamyHexMeshDict().subDict("motionControl");
|
= foamyHexMeshControls().foamyHexMeshDict().subDict("motionControl");
|
||||||
|
|
||||||
label nMaxIter = readLabel
|
const label nMaxIter =
|
||||||
(
|
motionControlDict.get<label>("maxRefinementIterations");
|
||||||
motionControlDict.lookup("maxRefinementIterations")
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Maximum number of refinement iterations : " << nMaxIter << endl;
|
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;
|
Info<< "Background cell size and alignment mesh:" << endl;
|
||||||
cellSizeMesh.printInfo(Info);
|
cellSizeMesh.printInfo(Info);
|
||||||
|
|||||||
@ -751,12 +751,12 @@ Foam::conformalVoronoiMesh::createPolyMeshFromPoints
|
|||||||
|
|
||||||
forAll(patches, p)
|
forAll(patches, p)
|
||||||
{
|
{
|
||||||
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
|
label totalPatchSize = patchDicts[p].get<label>("nFaces");
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchDicts.set(p)
|
patchDicts.set(p)
|
||||||
&& word(patchDicts[p].lookup("type")) == processorPolyPatch::typeName
|
&& patchDicts[p].get<word>("type") == processorPolyPatch::typeName
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// Do not create empty processor patches
|
// Do not create empty processor patches
|
||||||
@ -837,7 +837,7 @@ void Foam::conformalVoronoiMesh::checkCellSizing()
|
|||||||
= dict.subDict("meshQualityControls");
|
= dict.subDict("meshQualityControls");
|
||||||
|
|
||||||
const scalar maxNonOrtho =
|
const scalar maxNonOrtho =
|
||||||
readScalar(meshQualityDict.lookup("maxNonOrtho", true));
|
meshQualityDict.get<scalar>("maxNonOrtho", true);
|
||||||
|
|
||||||
label nWrongFaces = 0;
|
label nWrongFaces = 0;
|
||||||
|
|
||||||
@ -1710,18 +1710,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
|
|
||||||
const label nPatches = patchNames.size();
|
const label nPatches = patchNames.size();
|
||||||
|
|
||||||
labelList procNeighbours(nPatches, label(-1));
|
labelList procNeighbours(nPatches);
|
||||||
forAll(procNeighbours, patchi)
|
forAll(procNeighbours, patchi)
|
||||||
{
|
|
||||||
if (patchDicts[patchi].found("neighbProcNo"))
|
|
||||||
{
|
{
|
||||||
procNeighbours[patchi] =
|
procNeighbours[patchi] =
|
||||||
(
|
patchDicts[patchi].lookupOrDefault<label>("neighbProcNo", -1);
|
||||||
patchDicts[patchi].found("neighbProcNo")
|
|
||||||
? readLabel(patchDicts[patchi].lookup("neighbProcNo"))
|
|
||||||
: -1
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<DynamicList<face>> patchFaces(nPatches, DynamicList<face>(0));
|
List<DynamicList<face>> patchFaces(nPatches, DynamicList<face>(0));
|
||||||
@ -2343,11 +2336,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
|||||||
if (patchFaces[nbI].size() > 0)
|
if (patchFaces[nbI].size() > 0)
|
||||||
{
|
{
|
||||||
const label neighbour =
|
const label neighbour =
|
||||||
(
|
patchDicts[nbI].lookupOrDefault<label>("neighbProcNo", -1);
|
||||||
patchDicts[nbI].found("neighbProcNo")
|
|
||||||
? readLabel(patchDicts[nbI].lookup("neighbProcNo"))
|
|
||||||
: -1
|
|
||||||
);
|
|
||||||
|
|
||||||
faceList procPatchFaces = patchFaces[nbI];
|
faceList procPatchFaces = patchFaces[nbI];
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -154,7 +154,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
|||||||
forAll(dualPatchStarts, patchi)
|
forAll(dualPatchStarts, patchi)
|
||||||
{
|
{
|
||||||
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)
|
patchDicts.set(patchi)
|
||||||
&& (
|
&& (
|
||||||
word(patchDicts[patchi].lookup("type"))
|
patchDicts[patchi].get<word>("type")
|
||||||
== processorPolyPatch::typeName
|
== processorPolyPatch::typeName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -426,8 +426,8 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
|||||||
0, //patchStarts[p],
|
0, //patchStarts[p],
|
||||||
patchi,
|
patchi,
|
||||||
mesh.boundaryMesh(),
|
mesh.boundaryMesh(),
|
||||||
readLabel(patchDicts[patchi].lookup("myProcNo")),
|
patchDicts[patchi].get<label>("myProcNo"),
|
||||||
readLabel(patchDicts[patchi].lookup("neighbProcNo")),
|
patchDicts[patchi].get<label>("neighbProcNo"),
|
||||||
coupledPolyPatch::COINCIDENTFULLMATCH
|
coupledPolyPatch::COINCIDENTFULLMATCH
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -435,7 +435,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
|
|||||||
{
|
{
|
||||||
patches[patchi] = polyPatch::New
|
patches[patchi] = polyPatch::New
|
||||||
(
|
(
|
||||||
patchDicts[patchi].lookup("type"),
|
patchDicts[patchi].get<word>("type"),
|
||||||
patchNames[patchi],
|
patchNames[patchi],
|
||||||
0, //patchSizes[p],
|
0, //patchSizes[p],
|
||||||
0, //patchStarts[p],
|
0, //patchStarts[p],
|
||||||
@ -469,16 +469,16 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
|||||||
(
|
(
|
||||||
patchDicts.set(patchi)
|
patchDicts.set(patchi)
|
||||||
&& (
|
&& (
|
||||||
word(patchDicts[patchi].lookup("type"))
|
patchDicts[patchi].get<word>("type")
|
||||||
== processorPolyPatch::typeName
|
== processorPolyPatch::typeName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const label procNeighb =
|
const label procNeighb =
|
||||||
readLabel(patchDicts[patchi].lookup("neighbProcNo"));
|
patchDicts[patchi].get<label>("neighbProcNo");
|
||||||
|
|
||||||
procPatchSizes[Pstream::myProcNo()][procNeighb]
|
procPatchSizes[Pstream::myProcNo()][procNeighb]
|
||||||
= readLabel(patchDicts[patchi].lookup("nFaces"));
|
= patchDicts[patchi].get<label>("nFaces");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,8 +631,8 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
SubList<face>
|
SubList<face>
|
||||||
(
|
(
|
||||||
faces,
|
faces,
|
||||||
readLabel(patchDicts[patchi].lookup("nFaces")),
|
patchDicts[patchi].get<label>("nFaces"),
|
||||||
readLabel(patchDicts[patchi].lookup("startFace"))
|
patchDicts[patchi].get<label>("startFace")
|
||||||
),
|
),
|
||||||
points
|
points
|
||||||
)
|
)
|
||||||
@ -654,9 +654,10 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
|||||||
if (isA<processorPolyPatch>(pp))
|
if (isA<processorPolyPatch>(pp))
|
||||||
{
|
{
|
||||||
const label nPatchFaces =
|
const label nPatchFaces =
|
||||||
readLabel(patchDicts[patchi].lookup("nFaces"));
|
patchDicts[patchi].get<label>("nFaces");
|
||||||
|
|
||||||
const label patchStartFace =
|
const label patchStartFace =
|
||||||
readLabel(patchDicts[patchi].lookup("startFace"));
|
patchDicts[patchi].get<label>("startFace");
|
||||||
|
|
||||||
labelList patchFaceMap(nPatchFaces, label(-1));
|
labelList patchFaceMap(nPatchFaces, label(-1));
|
||||||
labelList patchFaceRotation(nPatchFaces, label(0));
|
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);
|
reorderPoints(points, boundaryPts, faces, nInternalFaces);
|
||||||
|
|
||||||
@ -815,13 +816,13 @@ void Foam::conformalVoronoiMesh::writeMesh
|
|||||||
|
|
||||||
forAll(patches, p)
|
forAll(patches, p)
|
||||||
{
|
{
|
||||||
label totalPatchSize = readLabel(patchDicts[p].lookup("nFaces"));
|
label totalPatchSize = patchDicts[p].get<label>("nFaces");
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
patchDicts.set(p)
|
patchDicts.set(p)
|
||||||
&& (
|
&& (
|
||||||
word(patchDicts[p].lookup("type"))
|
patchDicts[p].get<word>("type")
|
||||||
== processorPolyPatch::typeName
|
== processorPolyPatch::typeName
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@ -133,12 +133,15 @@ void Foam::conformationSurfaces::readFeatures
|
|||||||
label& featureIndex
|
label& featureIndex
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
word featureMethod =
|
const word featureMethod =
|
||||||
featureDict.lookupOrDefault<word>("featureMethod", "none");
|
featureDict.lookupOrDefault<word>("featureMethod", "none");
|
||||||
|
|
||||||
if (featureMethod == "extendedFeatureEdgeMesh")
|
if (featureMethod == "extendedFeatureEdgeMesh")
|
||||||
{
|
{
|
||||||
fileName feMeshName(featureDict.lookup("extendedFeatureEdgeMesh"));
|
fileName feMeshName
|
||||||
|
(
|
||||||
|
featureDict.get<fileName>("extendedFeatureEdgeMesh")
|
||||||
|
);
|
||||||
|
|
||||||
Info<< " features: " << feMeshName << endl;
|
Info<< " features: " << feMeshName << endl;
|
||||||
|
|
||||||
@ -213,12 +216,15 @@ void Foam::conformationSurfaces::readFeatures
|
|||||||
label& featureIndex
|
label& featureIndex
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
word featureMethod =
|
const word featureMethod =
|
||||||
featureDict.lookupOrDefault<word>("featureMethod", "none");
|
featureDict.lookupOrDefault<word>("featureMethod", "none");
|
||||||
|
|
||||||
if (featureMethod == "extendedFeatureEdgeMesh")
|
if (featureMethod == "extendedFeatureEdgeMesh")
|
||||||
{
|
{
|
||||||
fileName feMeshName(featureDict.lookup("extendedFeatureEdgeMesh"));
|
fileName feMeshName
|
||||||
|
(
|
||||||
|
featureDict.get<fileName>("extendedFeatureEdgeMesh")
|
||||||
|
);
|
||||||
|
|
||||||
Info<< " features: " << feMeshName << ", id: " << featureIndex
|
Info<< " features: " << feMeshName << ", id: " << featureIndex
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -271,7 +277,7 @@ Foam::conformationSurfaces::conformationSurfaces
|
|||||||
rndGen_(rndGen),
|
rndGen_(rndGen),
|
||||||
allGeometry_(allGeometry),
|
allGeometry_(allGeometry),
|
||||||
features_(),
|
features_(),
|
||||||
locationInMesh_(surfaceConformationDict.lookup("locationInMesh")),
|
locationInMesh_(surfaceConformationDict.get<point>("locationInMesh")),
|
||||||
surfaces_(),
|
surfaces_(),
|
||||||
allGeometryToSurfaces_(),
|
allGeometryToSurfaces_(),
|
||||||
normalVolumeTypes_(),
|
normalVolumeTypes_(),
|
||||||
@ -298,13 +304,11 @@ Foam::conformationSurfaces::conformationSurfaces
|
|||||||
|
|
||||||
// Count number of surfaces.
|
// Count number of surfaces.
|
||||||
label surfI = 0;
|
label surfI = 0;
|
||||||
forAll(allGeometry.names(), geomI)
|
for (const word& geomName : allGeometry_.names())
|
||||||
{
|
{
|
||||||
const word& geomName = allGeometry_.names()[geomI];
|
|
||||||
|
|
||||||
if (surfacesDict.found(geomName))
|
if (surfacesDict.found(geomName))
|
||||||
{
|
{
|
||||||
surfI++;
|
++surfI;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -596,12 +600,6 @@ Foam::conformationSurfaces::conformationSurfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::conformationSurfaces::~conformationSurfaces()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bool Foam::conformationSurfaces::overlaps(const treeBoundBox& bb) const
|
bool Foam::conformationSurfaces::overlaps(const treeBoundBox& bb) const
|
||||||
|
|||||||
@ -151,7 +151,7 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~conformationSurfaces();
|
~conformationSurfaces() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -54,7 +54,7 @@ Foam::autoPtr<Foam::faceAreaWeightModel> Foam::faceAreaWeightModel::New
|
|||||||
const dictionary& relaxationDict
|
const dictionary& relaxationDict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(relaxationDict.lookup("faceAreaWeightModel"));
|
const word modelType(relaxationDict.get<word>("faceAreaWeightModel"));
|
||||||
|
|
||||||
Info<< nl << "Selecting faceAreaWeightModel " << modelType << endl;
|
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
|
//- Method coeffs dictionary
|
||||||
dictionary coeffDict_;
|
dictionary coeffDict_;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
faceAreaWeightModel(const faceAreaWeightModel&) = delete;
|
faceAreaWeightModel(const faceAreaWeightModel&) = delete;
|
||||||
@ -115,7 +114,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~faceAreaWeightModel();
|
virtual ~faceAreaWeightModel() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -28,35 +28,37 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
defineTypeNameAndDebug(piecewiseLinearRamp, 0);
|
namespace Foam
|
||||||
addToRunTimeSelectionTable
|
{
|
||||||
(
|
defineTypeNameAndDebug(piecewiseLinearRamp, 0);
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
faceAreaWeightModel,
|
faceAreaWeightModel,
|
||||||
piecewiseLinearRamp,
|
piecewiseLinearRamp,
|
||||||
dictionary
|
dictionary
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
piecewiseLinearRamp::piecewiseLinearRamp
|
Foam::piecewiseLinearRamp::piecewiseLinearRamp
|
||||||
(
|
(
|
||||||
const dictionary& faceAreaWeightDict
|
const dictionary& faceAreaWeightDict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
faceAreaWeightModel(typeName, faceAreaWeightDict),
|
faceAreaWeightModel(typeName, faceAreaWeightDict),
|
||||||
lAF_(readScalar(coeffDict().lookup("lowerAreaFraction"))),
|
lAF_(coeffDict().get<scalar>("lowerAreaFraction")),
|
||||||
uAF_(readScalar(coeffDict().lookup("upperAreaFraction")))
|
uAF_(coeffDict().get<scalar>("upperAreaFraction"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar piecewiseLinearRamp::faceAreaWeight(scalar faceAreaFraction) const
|
Foam::scalar
|
||||||
|
Foam::piecewiseLinearRamp::faceAreaWeight(scalar faceAreaFraction) const
|
||||||
{
|
{
|
||||||
if (faceAreaFraction < lAF_)
|
if (faceAreaFraction < lAF_)
|
||||||
{
|
{
|
||||||
@ -66,15 +68,9 @@ scalar piecewiseLinearRamp::faceAreaWeight(scalar faceAreaFraction) const
|
|||||||
{
|
{
|
||||||
return faceAreaFraction/((uAF_ - lAF_)) - lAF_/(uAF_ - lAF_);
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -50,7 +50,6 @@ class piecewiseLinearRamp
|
|||||||
:
|
:
|
||||||
public faceAreaWeightModel
|
public faceAreaWeightModel
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -61,6 +60,7 @@ private:
|
|||||||
//- Face area fraction above which a which of 1 is returned
|
//- Face area fraction above which a which of 1 is returned
|
||||||
scalar uAF_;
|
scalar uAF_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -76,8 +76,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~piecewiseLinearRamp()
|
virtual ~piecewiseLinearRamp() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -55,15 +55,13 @@ void Foam::autoDensity::writeOBJ
|
|||||||
|
|
||||||
pointField bbPoints(bb.points());
|
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;
|
str << "l " << e[0] + 1 << ' ' << e[1] + 1 << nl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -884,9 +882,9 @@ autoDensity::autoDensity
|
|||||||
(
|
(
|
||||||
detailsDict().lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
|
detailsDict().lookupOrDefault<scalar>("minCellSizeLimit", 0.0)
|
||||||
),
|
),
|
||||||
minLevels_(readLabel(detailsDict().lookup("minLevels"))),
|
minLevels_(detailsDict().get<label>("minLevels")),
|
||||||
maxSizeRatio_(readScalar(detailsDict().lookup("maxSizeRatio"))),
|
maxSizeRatio_(detailsDict().get<scalar>("maxSizeRatio")),
|
||||||
volRes_(readLabel(detailsDict().lookup("sampleResolution"))),
|
volRes_(detailsDict().get<label>("sampleResolution")),
|
||||||
surfRes_
|
surfRes_
|
||||||
(
|
(
|
||||||
detailsDict().lookupOrDefault<label>("surfaceSampleResolution", volRes_)
|
detailsDict().lookupOrDefault<label>("surfaceSampleResolution", volRes_)
|
||||||
|
|||||||
@ -26,19 +26,18 @@ License
|
|||||||
#include "bodyCentredCubic.H"
|
#include "bodyCentredCubic.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(bodyCentredCubic, 0);
|
defineTypeNameAndDebug(bodyCentredCubic, 0);
|
||||||
addToRunTimeSelectionTable(initialPointsMethod, bodyCentredCubic, dictionary);
|
addToRunTimeSelectionTable(initialPointsMethod, bodyCentredCubic, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
bodyCentredCubic::bodyCentredCubic
|
Foam::bodyCentredCubic::bodyCentredCubic
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
@ -58,18 +57,18 @@ bodyCentredCubic::bodyCentredCubic
|
|||||||
cellShapeControls,
|
cellShapeControls,
|
||||||
decomposition
|
decomposition
|
||||||
),
|
),
|
||||||
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
|
initialCellSize_(detailsDict().get<scalar>("initialCellSize")),
|
||||||
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
|
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
|
||||||
randomPerturbationCoeff_
|
randomPerturbationCoeff_
|
||||||
(
|
(
|
||||||
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
|
detailsDict().get<scalar>("randomPerturbationCoeff")
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
List<Vb::Point> bodyCentredCubic::initialPoints() const
|
Foam::List<Vb::Point> Foam::bodyCentredCubic::initialPoints() const
|
||||||
{
|
{
|
||||||
boundBox bb;
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,7 +51,6 @@ class bodyCentredCubic
|
|||||||
:
|
:
|
||||||
public initialPointsMethod
|
public initialPointsMethod
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -86,8 +85,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~bodyCentredCubic()
|
virtual ~bodyCentredCubic() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,19 +26,17 @@ License
|
|||||||
#include "faceCentredCubic.H"
|
#include "faceCentredCubic.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(faceCentredCubic, 0);
|
defineTypeNameAndDebug(faceCentredCubic, 0);
|
||||||
addToRunTimeSelectionTable(initialPointsMethod, faceCentredCubic, dictionary);
|
addToRunTimeSelectionTable(initialPointsMethod, faceCentredCubic, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
faceCentredCubic::faceCentredCubic
|
Foam::faceCentredCubic::faceCentredCubic
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
@ -58,18 +56,18 @@ faceCentredCubic::faceCentredCubic
|
|||||||
cellShapeControls,
|
cellShapeControls,
|
||||||
decomposition
|
decomposition
|
||||||
),
|
),
|
||||||
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
|
initialCellSize_(detailsDict().get<scalar>("initialCellSize")),
|
||||||
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
|
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
|
||||||
randomPerturbationCoeff_
|
randomPerturbationCoeff_
|
||||||
(
|
(
|
||||||
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
|
detailsDict().get<scalar>("randomPerturbationCoeff")
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
List<Vb::Point> faceCentredCubic::initialPoints() const
|
Foam::List<Vb::Point> Foam::faceCentredCubic::initialPoints() const
|
||||||
{
|
{
|
||||||
boundBox bb;
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,7 +51,6 @@ class faceCentredCubic
|
|||||||
:
|
:
|
||||||
public initialPointsMethod
|
public initialPointsMethod
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -86,8 +85,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~faceCentredCubic()
|
virtual ~faceCentredCubic() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,19 +26,18 @@ License
|
|||||||
#include "pointFile.H"
|
#include "pointFile.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(pointFile, 0);
|
||||||
|
addToRunTimeSelectionTable(initialPointsMethod, pointFile, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(pointFile, 0);
|
|
||||||
addToRunTimeSelectionTable(initialPointsMethod, pointFile, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
pointFile::pointFile
|
Foam::pointFile::pointFile
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
@ -58,12 +57,12 @@ pointFile::pointFile
|
|||||||
cellShapeControls,
|
cellShapeControls,
|
||||||
decomposition
|
decomposition
|
||||||
),
|
),
|
||||||
pointFileName_(detailsDict().lookup("pointFile")),
|
pointFileName_(detailsDict().get<fileName>("pointFile")),
|
||||||
insideOutsideCheck_(detailsDict().lookup("insideOutsideCheck")),
|
insideOutsideCheck_(detailsDict().get<Switch>("insideOutsideCheck")),
|
||||||
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
|
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
|
||||||
randomPerturbationCoeff_
|
randomPerturbationCoeff_
|
||||||
(
|
(
|
||||||
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
|
detailsDict().get<scalar>("randomPerturbationCoeff")
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Info<< " Inside/Outside check is " << insideOutsideCheck_.c_str()
|
Info<< " Inside/Outside check is " << insideOutsideCheck_.c_str()
|
||||||
@ -73,7 +72,7 @@ pointFile::pointFile
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
List<Vb::Point> pointFile::initialPoints() const
|
Foam::List<Vb::Point> Foam::pointFile::initialPoints() const
|
||||||
{
|
{
|
||||||
pointField points;
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -92,8 +92,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~pointFile()
|
virtual ~pointFile() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -27,20 +27,18 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "triSurfaceMesh.H"
|
#include "triSurfaceMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(rayShooting, 0);
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
addToRunTimeSelectionTable(initialPointsMethod, rayShooting, dictionary);
|
||||||
|
}
|
||||||
defineTypeNameAndDebug(rayShooting, 0);
|
|
||||||
addToRunTimeSelectionTable(initialPointsMethod, rayShooting, dictionary);
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
void rayShooting::splitLine
|
void Foam::rayShooting::splitLine
|
||||||
(
|
(
|
||||||
const line<point, point>& l,
|
const line<point, point>& l,
|
||||||
const scalar& pert,
|
const scalar& pert,
|
||||||
@ -117,7 +115,7 @@ void rayShooting::splitLine
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
rayShooting::rayShooting
|
Foam::rayShooting::rayShooting
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
@ -137,17 +135,17 @@ rayShooting::rayShooting
|
|||||||
cellShapeControls,
|
cellShapeControls,
|
||||||
decomposition
|
decomposition
|
||||||
),
|
),
|
||||||
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
|
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
|
||||||
randomPerturbationCoeff_
|
randomPerturbationCoeff_
|
||||||
(
|
(
|
||||||
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
|
detailsDict().get<scalar>("randomPerturbationCoeff")
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
List<Vb::Point> rayShooting::initialPoints() const
|
Foam::List<Vb::Point> Foam::rayShooting::initialPoints() const
|
||||||
{
|
{
|
||||||
// Loop over surface faces
|
// Loop over surface faces
|
||||||
const searchableSurfaces& surfaces = geometryToConformTo().geometry();
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -49,7 +49,6 @@ class rayShooting
|
|||||||
:
|
:
|
||||||
public initialPointsMethod
|
public initialPointsMethod
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -91,8 +90,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~rayShooting()
|
virtual ~rayShooting() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -26,19 +26,18 @@ License
|
|||||||
#include "uniformGrid.H"
|
#include "uniformGrid.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(uniformGrid, 0);
|
||||||
|
addToRunTimeSelectionTable(initialPointsMethod, uniformGrid, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(uniformGrid, 0);
|
|
||||||
addToRunTimeSelectionTable(initialPointsMethod, uniformGrid, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
uniformGrid::uniformGrid
|
Foam::uniformGrid::uniformGrid
|
||||||
(
|
(
|
||||||
const dictionary& initialPointsDict,
|
const dictionary& initialPointsDict,
|
||||||
const Time& runTime,
|
const Time& runTime,
|
||||||
@ -58,18 +57,18 @@ uniformGrid::uniformGrid
|
|||||||
cellShapeControls,
|
cellShapeControls,
|
||||||
decomposition
|
decomposition
|
||||||
),
|
),
|
||||||
initialCellSize_(readScalar(detailsDict().lookup("initialCellSize"))),
|
initialCellSize_(detailsDict().get<scalar>("initialCellSize")),
|
||||||
randomiseInitialGrid_(detailsDict().lookup("randomiseInitialGrid")),
|
randomiseInitialGrid_(detailsDict().get<Switch>("randomiseInitialGrid")),
|
||||||
randomPerturbationCoeff_
|
randomPerturbationCoeff_
|
||||||
(
|
(
|
||||||
readScalar(detailsDict().lookup("randomPerturbationCoeff"))
|
detailsDict().get<scalar>("randomPerturbationCoeff")
|
||||||
)
|
)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
List<Vb::Point> uniformGrid::initialPoints() const
|
Foam::List<Vb::Point> Foam::uniformGrid::initialPoints() const
|
||||||
{
|
{
|
||||||
boundBox bb;
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,7 +51,6 @@ class uniformGrid
|
|||||||
:
|
:
|
||||||
public initialPointsMethod
|
public initialPointsMethod
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -86,8 +85,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~uniformGrid()
|
virtual ~uniformGrid() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,27 +26,25 @@ License
|
|||||||
#include "adaptiveLinear.H"
|
#include "adaptiveLinear.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(adaptiveLinear, 0);
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
addToRunTimeSelectionTable(relaxationModel, adaptiveLinear, dictionary);
|
||||||
|
}
|
||||||
defineTypeNameAndDebug(adaptiveLinear, 0);
|
|
||||||
addToRunTimeSelectionTable(relaxationModel, adaptiveLinear, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
adaptiveLinear::adaptiveLinear
|
Foam::adaptiveLinear::adaptiveLinear
|
||||||
(
|
(
|
||||||
const dictionary& relaxationDict,
|
const dictionary& relaxationDict,
|
||||||
const Time& runTime
|
const Time& runTime
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
relaxationModel(typeName, relaxationDict, runTime),
|
relaxationModel(typeName, relaxationDict, runTime),
|
||||||
relaxationStart_(readScalar(coeffDict().lookup("relaxationStart"))),
|
relaxationStart_(coeffDict().get<scalar>("relaxationStart")),
|
||||||
relaxationEnd_(readScalar(coeffDict().lookup("relaxationEnd"))),
|
relaxationEnd_(coeffDict().get<scalar>("relaxationEnd")),
|
||||||
lastTimeValue_(runTime_.time().timeOutputValue()),
|
lastTimeValue_(runTime_.time().timeOutputValue()),
|
||||||
relaxation_(relaxationStart_)
|
relaxation_(relaxationStart_)
|
||||||
{}
|
{}
|
||||||
@ -54,7 +52,7 @@ adaptiveLinear::adaptiveLinear
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar adaptiveLinear::relaxation()
|
Foam::scalar Foam::adaptiveLinear::relaxation()
|
||||||
{
|
{
|
||||||
if (runTime_.time().timeOutputValue() > lastTimeValue_)
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -52,7 +52,6 @@ class adaptiveLinear
|
|||||||
:
|
:
|
||||||
public relaxationModel
|
public relaxationModel
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -88,8 +87,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~adaptiveLinear()
|
virtual ~adaptiveLinear() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -26,30 +26,29 @@ License
|
|||||||
#include "rampHoldFall.H"
|
#include "rampHoldFall.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(rampHoldFall, 0);
|
||||||
|
addToRunTimeSelectionTable(relaxationModel, rampHoldFall, dictionary);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(rampHoldFall, 0);
|
|
||||||
addToRunTimeSelectionTable(relaxationModel, rampHoldFall, dictionary);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
rampHoldFall::rampHoldFall
|
Foam::rampHoldFall::rampHoldFall
|
||||||
(
|
(
|
||||||
const dictionary& relaxationDict,
|
const dictionary& relaxationDict,
|
||||||
const Time& runTime
|
const Time& runTime
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
relaxationModel(typeName, relaxationDict, runTime),
|
relaxationModel(typeName, relaxationDict, runTime),
|
||||||
rampStartRelaxation_(readScalar(coeffDict().lookup("rampStartRelaxation"))),
|
rampStartRelaxation_(coeffDict().get<scalar>("rampStartRelaxation")),
|
||||||
holdRelaxation_(readScalar(coeffDict().lookup("holdRelaxation"))),
|
holdRelaxation_(coeffDict().get<scalar>("holdRelaxation")),
|
||||||
fallEndRelaxation_(readScalar(coeffDict().lookup("fallEndRelaxation"))),
|
fallEndRelaxation_(coeffDict().get<scalar>("fallEndRelaxation")),
|
||||||
rampEndFraction_(readScalar(coeffDict().lookup("rampEndFraction"))),
|
rampEndFraction_(coeffDict().get<scalar>("rampEndFraction")),
|
||||||
fallStartFraction_(readScalar(coeffDict().lookup("fallStartFraction"))),
|
fallStartFraction_(coeffDict().get<scalar>("fallStartFraction")),
|
||||||
rampGradient_((holdRelaxation_ - rampStartRelaxation_)/(rampEndFraction_)),
|
rampGradient_((holdRelaxation_ - rampStartRelaxation_)/(rampEndFraction_)),
|
||||||
fallGradient_
|
fallGradient_
|
||||||
(
|
(
|
||||||
@ -60,7 +59,7 @@ rampHoldFall::rampHoldFall
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
scalar rampHoldFall::relaxation()
|
Foam::scalar Foam::rampHoldFall::relaxation()
|
||||||
{
|
{
|
||||||
scalar t = runTime_.time().timeOutputValue();
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -51,7 +51,6 @@ class rampHoldFall
|
|||||||
:
|
:
|
||||||
public relaxationModel
|
public relaxationModel
|
||||||
{
|
{
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
@ -93,8 +92,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~rampHoldFall()
|
virtual ~rampHoldFall() = default;
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -58,7 +58,7 @@ Foam::autoPtr<Foam::relaxationModel> Foam::relaxationModel::New
|
|||||||
const Time& runTime
|
const Time& runTime
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word modelType(relaxationDict.lookup("relaxationModel"));
|
const word modelType(relaxationDict.get<word>("relaxationModel"));
|
||||||
|
|
||||||
Info<< nl << "Selecting relaxationModel " << modelType << endl;
|
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
|
//- Method coeffs dictionary
|
||||||
dictionary coeffDict_;
|
dictionary coeffDict_;
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- No copy construct
|
//- No copy construct
|
||||||
relaxationModel(const relaxationModel&) = delete;
|
relaxationModel(const relaxationModel&) = delete;
|
||||||
@ -120,7 +119,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~relaxationModel();
|
virtual ~relaxationModel() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -32,15 +32,13 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
defineTypeNameAndDebug(triSurfaceMeshFeatures, 0);
|
||||||
defineTypeNameAndDebug(triSurfaceMeshFeatures, 0);
|
addToRunTimeSelectionTable
|
||||||
addToRunTimeSelectionTable
|
(
|
||||||
(
|
|
||||||
searchableSurfaceFeatures,
|
searchableSurfaceFeatures,
|
||||||
triSurfaceMeshFeatures,
|
triSurfaceMeshFeatures,
|
||||||
dict
|
dict
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -53,7 +51,7 @@ Foam::triSurfaceMeshFeatures::triSurfaceMeshFeatures
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
searchableSurfaceFeatures(surface, dict),
|
searchableSurfaceFeatures(surface, dict),
|
||||||
includedAngle_(readScalar(dict.lookup("includedAngle"))),
|
includedAngle_(dict.get<scalar>("includedAngle")),
|
||||||
mode_
|
mode_
|
||||||
(
|
(
|
||||||
extendedFeatureEdgeMesh::sideVolumeTypeNames_
|
extendedFeatureEdgeMesh::sideVolumeTypeNames_
|
||||||
@ -70,19 +68,11 @@ Foam::triSurfaceMeshFeatures::triSurfaceMeshFeatures
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::triSurfaceMeshFeatures::~triSurfaceMeshFeatures()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::autoPtr<Foam::extendedFeatureEdgeMesh>
|
Foam::autoPtr<Foam::extendedFeatureEdgeMesh>
|
||||||
Foam::triSurfaceMeshFeatures::features() const
|
Foam::triSurfaceMeshFeatures::features() const
|
||||||
{
|
{
|
||||||
autoPtr<extendedFeatureEdgeMesh> features;
|
|
||||||
|
|
||||||
const triSurfaceMesh& surfMesh = refCast<const triSurfaceMesh>(surface());
|
const triSurfaceMesh& surfMesh = refCast<const triSurfaceMesh>(surface());
|
||||||
|
|
||||||
surfaceFeatures sFeat(surfMesh, includedAngle_);
|
surfaceFeatures sFeat(surfMesh, includedAngle_);
|
||||||
@ -94,18 +84,14 @@ Foam::triSurfaceMeshFeatures::features() const
|
|||||||
(mode_ == extendedFeatureEdgeMesh::BOTH ? true : false)
|
(mode_ == extendedFeatureEdgeMesh::BOTH ? true : false)
|
||||||
);
|
);
|
||||||
|
|
||||||
features.reset
|
|
||||||
(
|
return autoPtr<extendedFeatureEdgeMesh>::New
|
||||||
new extendedFeatureEdgeMesh
|
|
||||||
(
|
(
|
||||||
sFeat,
|
sFeat,
|
||||||
surface().db(),
|
surface().db(),
|
||||||
surface().name() + ".extendedFeatureEdgeMesh",
|
surface().name() + ".extendedFeatureEdgeMesh",
|
||||||
surfBaffleRegions
|
surfBaffleRegions
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return features;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -85,7 +85,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~triSurfaceMeshFeatures();
|
virtual ~triSurfaceMeshFeatures() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -150,10 +150,8 @@ Foam::CV2D::CV2D
|
|||||||
),
|
),
|
||||||
z_
|
z_
|
||||||
(
|
(
|
||||||
Foam::point
|
cvMeshDict.subDict("surfaceConformation")
|
||||||
(
|
.get<Foam::point>("locationInMesh").z()
|
||||||
cvMeshDict.subDict("surfaceConformation").lookup("locationInMesh")
|
|
||||||
).z()
|
|
||||||
),
|
),
|
||||||
startOfInternalPoints_(0),
|
startOfInternalPoints_(0),
|
||||||
startOfSurfacePointPairs_(0),
|
startOfSurfacePointPairs_(0),
|
||||||
@ -187,10 +185,8 @@ void Foam::CV2D::insertPoints
|
|||||||
label nVert = startOfInternalPoints_;
|
label nVert = startOfInternalPoints_;
|
||||||
|
|
||||||
// Add the points and index them
|
// 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))
|
if (qSurf_.wellInside(toPoint3D(p), nearness))
|
||||||
{
|
{
|
||||||
insert(toPoint(p))->index() = nVert++;
|
insert(toPoint(p))->index() = nVert++;
|
||||||
|
|||||||
@ -152,7 +152,7 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
cv2Dmesh_(cv2Dmesh),
|
cv2Dmesh_(cv2Dmesh),
|
||||||
shortEdgeFilterFactor_(readScalar(dict.lookup("shortEdgeFilterFactor"))),
|
shortEdgeFilterFactor_(dict.get<scalar>("shortEdgeFilterFactor")),
|
||||||
edgeAttachedToBoundaryFactor_
|
edgeAttachedToBoundaryFactor_
|
||||||
(
|
(
|
||||||
dict.lookupOrDefault<scalar>("edgeAttachedToBoundaryFactor", 2.0)
|
dict.lookupOrDefault<scalar>("edgeAttachedToBoundaryFactor", 2.0)
|
||||||
@ -226,8 +226,7 @@ Foam::shortEdgeFilter2D::~shortEdgeFilter2D()
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void
|
void Foam::shortEdgeFilter2D::filter()
|
||||||
Foam::shortEdgeFilter2D::filter()
|
|
||||||
{
|
{
|
||||||
// These are global indices.
|
// These are global indices.
|
||||||
const pointField& points = ms_.points();
|
const pointField& points = ms_.points();
|
||||||
|
|||||||
@ -66,7 +66,7 @@ Foam::autoPtr<Foam::faceSelection> Foam::faceSelection::New
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word sampleType(dict.lookup("type"));
|
const word sampleType(dict.get<word>("type"));
|
||||||
|
|
||||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(sampleType);
|
auto cstrIter = dictionaryConstructorTablePtr_->cfind(sampleType);
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ Foam::faceSelections::searchableSurfaceSelection::searchableSurfaceSelection
|
|||||||
(
|
(
|
||||||
searchableSurface::New
|
searchableSurface::New
|
||||||
(
|
(
|
||||||
word(dict.lookup("surface")),
|
dict.get<word>("surface"),
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
dict.lookupOrDefault("name", mesh.objectRegistry::db().name()),
|
dict.lookupOrDefault("name", mesh.objectRegistry::db().name()),
|
||||||
|
|||||||
@ -557,10 +557,9 @@ int main(int argc, char *argv[])
|
|||||||
PtrList<dictionary> patchSources(dict.lookup("patches"));
|
PtrList<dictionary> patchSources(dict.lookup("patches"));
|
||||||
|
|
||||||
wordHashSet addedPatchNames;
|
wordHashSet addedPatchNames;
|
||||||
forAll(patchSources, addedI)
|
for (const dictionary& dict : patchSources)
|
||||||
{
|
{
|
||||||
const dictionary& dict = patchSources[addedI];
|
addedPatchNames.insert(dict.get<word>("name"));
|
||||||
addedPatchNames.insert(dict.lookup("name"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -595,11 +594,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(patchSources, addedI)
|
for (const dictionary& dict : patchSources)
|
||||||
{
|
{
|
||||||
const dictionary& dict = patchSources[addedI];
|
const word patchName(dict.get<word>("name"));
|
||||||
|
|
||||||
word patchName(dict.lookup("name"));
|
|
||||||
|
|
||||||
label destPatchi = patches.findPatchID(patchName);
|
label destPatchi = patches.findPatchID(patchName);
|
||||||
|
|
||||||
@ -671,11 +668,9 @@ int main(int argc, char *argv[])
|
|||||||
polyTopoChange meshMod(mesh);
|
polyTopoChange meshMod(mesh);
|
||||||
|
|
||||||
|
|
||||||
forAll(patchSources, addedI)
|
for (const dictionary& dict : patchSources)
|
||||||
{
|
{
|
||||||
const dictionary& dict = patchSources[addedI];
|
const word patchName(dict.get<word>("name"));
|
||||||
|
|
||||||
const word patchName(dict.lookup("name"));
|
|
||||||
label destPatchi = patches.findPatchID(patchName);
|
label destPatchi = patches.findPatchID(patchName);
|
||||||
|
|
||||||
if (destPatchi == -1)
|
if (destPatchi == -1)
|
||||||
@ -685,16 +680,13 @@ int main(int argc, char *argv[])
|
|||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
const word sourceType(dict.lookup("constructFrom"));
|
const word sourceType(dict.get<word>("constructFrom"));
|
||||||
|
|
||||||
if (sourceType == "patches")
|
if (sourceType == "patches")
|
||||||
{
|
{
|
||||||
labelHashSet patchSources
|
labelHashSet patchSources
|
||||||
(
|
(
|
||||||
patches.patchSet
|
patches.patchSet(dict.get<wordRes>("patches"))
|
||||||
(
|
|
||||||
wordReList(dict.lookup("patches"))
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
// Repatch faces of the patches.
|
// Repatch faces of the patches.
|
||||||
@ -719,7 +711,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
else if (sourceType == "set")
|
else if (sourceType == "set")
|
||||||
{
|
{
|
||||||
const word setName(dict.lookup("set"));
|
const word setName(dict.get<word>("set"));
|
||||||
|
|
||||||
faceSet faces(mesh, setName);
|
faceSet faces(mesh, setName);
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / 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
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -45,7 +45,6 @@ Usage
|
|||||||
- \par -dict \<dictionary\>
|
- \par -dict \<dictionary\>
|
||||||
Specify a dictionary to read actions from.
|
Specify a dictionary to read actions from.
|
||||||
|
|
||||||
|
|
||||||
Note
|
Note
|
||||||
- can only handle pairwise boundary faces. So three faces using
|
- can only handle pairwise boundary faces. So three faces using
|
||||||
the same points is not handled (is illegal mesh anyway)
|
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)
|
if (faceIDs.size() != sz)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction << exit(FatalError);
|
FatalErrorInFunction << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return faceIDs;
|
return faceIDs;
|
||||||
}
|
}
|
||||||
@ -332,8 +331,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
if (dict.found("detect"))
|
if (dict.found("detect"))
|
||||||
{
|
{
|
||||||
wordReList patchNames(dict.subDict("detect").lookup("patches"));
|
detectPatchIDs = patches.patchSet
|
||||||
detectPatchIDs = patches.patchSet(patchNames).sortedToc();
|
(
|
||||||
|
dict.subDict("detect").get<wordRes>("patches")
|
||||||
|
).sortedToc();
|
||||||
|
|
||||||
Info<< "Detecting baffles on " << detectPatchIDs.size()
|
Info<< "Detecting baffles on " << detectPatchIDs.size()
|
||||||
<< " patches with "
|
<< " patches with "
|
||||||
<< returnReduce(patchSize(mesh, detectPatchIDs), sumOp<label>())
|
<< returnReduce(patchSize(mesh, detectPatchIDs), sumOp<label>())
|
||||||
@ -341,8 +343,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (dict.found("merge"))
|
if (dict.found("merge"))
|
||||||
{
|
{
|
||||||
wordReList patchNames(dict.subDict("merge").lookup("patches"));
|
mergePatchIDs = patches.patchSet
|
||||||
mergePatchIDs = patches.patchSet(patchNames).sortedToc();
|
(
|
||||||
|
dict.subDict("merge").get<wordRes>("patches")
|
||||||
|
).sortedToc();
|
||||||
|
|
||||||
Info<< "Detecting baffles on " << mergePatchIDs.size()
|
Info<< "Detecting baffles on " << mergePatchIDs.size()
|
||||||
<< " patches with "
|
<< " patches with "
|
||||||
<< returnReduce(patchSize(mesh, mergePatchIDs), sumOp<label>())
|
<< returnReduce(patchSize(mesh, mergePatchIDs), sumOp<label>())
|
||||||
@ -350,8 +355,11 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (dict.found("split"))
|
if (dict.found("split"))
|
||||||
{
|
{
|
||||||
wordReList patchNames(dict.subDict("split").lookup("patches"));
|
splitPatchIDs = patches.patchSet
|
||||||
splitPatchIDs = patches.patchSet(patchNames).sortedToc();
|
(
|
||||||
|
dict.subDict("split").get<wordRes>("patches")
|
||||||
|
).sortedToc();
|
||||||
|
|
||||||
Info<< "Detecting baffles on " << splitPatchIDs.size()
|
Info<< "Detecting baffles on " << splitPatchIDs.size()
|
||||||
<< " patches with "
|
<< " patches with "
|
||||||
<< returnReduce(patchSize(mesh, splitPatchIDs), sumOp<label>())
|
<< returnReduce(patchSize(mesh, splitPatchIDs), sumOp<label>())
|
||||||
|
|||||||
@ -46,9 +46,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
|||||||
{
|
{
|
||||||
plane mirrorPlane(mirrorMeshDict_);
|
plane mirrorPlane(mirrorMeshDict_);
|
||||||
|
|
||||||
scalar planeTolerance
|
const scalar planeTolerance
|
||||||
(
|
(
|
||||||
readScalar(mirrorMeshDict_.lookup("planeTolerance"))
|
mirrorMeshDict_.get<scalar>("planeTolerance")
|
||||||
);
|
);
|
||||||
|
|
||||||
const pointField& oldPoints = points();
|
const pointField& oldPoints = points();
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
plane mirrorPlane(mirrorMeshDict);
|
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())
|
if (refineDict.size())
|
||||||
{
|
{
|
||||||
const word setName(refineDict.lookup("set"));
|
const word setName(refineDict.get<word>("set"));
|
||||||
|
|
||||||
cellSet cells(mesh, setName);
|
cellSet cells(mesh, setName);
|
||||||
|
|
||||||
|
|||||||
@ -175,7 +175,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
forAll(patchEntries, patchi)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const entry& e = 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();
|
const word& name = e.keyword();
|
||||||
|
|
||||||
if
|
if
|
||||||
@ -270,7 +270,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
|||||||
forAll(patchEntries, patchi)
|
forAll(patchEntries, patchi)
|
||||||
{
|
{
|
||||||
const entry& e = 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();
|
const word& name = e.keyword();
|
||||||
|
|
||||||
if (type == processorPolyPatch::typeName)
|
if (type == processorPolyPatch::typeName)
|
||||||
|
|||||||
@ -13,17 +13,17 @@ IOdictionary conversionProperties
|
|||||||
|
|
||||||
scalar startTime
|
scalar startTime
|
||||||
(
|
(
|
||||||
readScalar(conversionProperties.lookup("startTime"))
|
conversionProperties.get<scalar>("startTime")
|
||||||
);
|
);
|
||||||
|
|
||||||
word vComp
|
word vComp
|
||||||
(
|
(
|
||||||
conversionProperties.lookup("vector")
|
conversionProperties.get<word>("vector")
|
||||||
);
|
);
|
||||||
|
|
||||||
word format
|
word format
|
||||||
(
|
(
|
||||||
conversionProperties.lookup("format")
|
conversionProperties.get<word>("format")
|
||||||
);
|
);
|
||||||
|
|
||||||
if ((format != "ascii") && (format != "ieeei4r8"))
|
if ((format != "ascii") && (format != "ieeei4r8"))
|
||||||
@ -37,7 +37,7 @@ if ((format != "ascii") && (format != "ieeei4r8"))
|
|||||||
|
|
||||||
word cells
|
word cells
|
||||||
(
|
(
|
||||||
conversionProperties.lookup("cells")
|
conversionProperties.get<word>("cells")
|
||||||
);
|
);
|
||||||
|
|
||||||
if
|
if
|
||||||
|
|||||||
@ -365,7 +365,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
const dictionary& patchDict = patchEntries[patchi].dict();
|
const dictionary& patchDict = patchEntries[patchi].dict();
|
||||||
wordList groupNames;
|
wordList groupNames;
|
||||||
|
|
||||||
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
|
sizes[patchi] = patchDict.get<label>("nFaces");
|
||||||
names[patchi] = patchEntries[patchi].keyword();
|
names[patchi] = patchEntries[patchi].keyword();
|
||||||
|
|
||||||
if
|
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";
|
const fileName pdfPath = runTime.path()/"pdf";
|
||||||
|
|||||||
@ -223,12 +223,12 @@ Foam::channelIndex::channelIndex
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
symmetric_(readBool(dict.lookup("symmetric"))),
|
symmetric_(dict.get<bool>("symmetric")),
|
||||||
dir_(vectorComponentsNames_.lookup("component", dict))
|
dir_(vectorComponentsNames_.lookup("component", dict))
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
const wordList patchNames(dict.lookup("patches"));
|
const wordList patchNames(dict.get<wordList>("patches"));
|
||||||
|
|
||||||
label nFaces = 0;
|
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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -28,8 +28,6 @@ License
|
|||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
#include "processorPolyPatch.H"
|
#include "processorPolyPatch.H"
|
||||||
|
|
||||||
using namespace Foam;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
@ -67,13 +65,13 @@ Foam::IOPtrList<Foam::entry> Foam::boundaryInfo::readBoundaryDict
|
|||||||
forAll(boundaryPatchList, patchI)
|
forAll(boundaryPatchList, patchI)
|
||||||
{
|
{
|
||||||
const dictionary& dict = boundaryPatchList[patchI].dict();
|
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 procPatch = pType == processorPolyPatch::typeName;
|
||||||
|
|
||||||
bool addPatch = true;
|
bool addPatch = true;
|
||||||
if (!procPatch)
|
if (!procPatch)
|
||||||
{
|
{
|
||||||
label nFaces = readLabel(dict.lookup("nFaces"));
|
label nFaces = dict.get<label>("nFaces");
|
||||||
reduce(nFaces, sumOp<label>());
|
reduce(nFaces, sumOp<label>());
|
||||||
if (nFaces == 0)
|
if (nFaces == 0)
|
||||||
{
|
{
|
||||||
@ -114,15 +112,14 @@ Foam::boundaryInfo::boundaryInfo(const Time& runTime, const word& regionName)
|
|||||||
const dictionary& dict = boundaryDict_[patchI].dict();
|
const dictionary& dict = boundaryDict_[patchI].dict();
|
||||||
|
|
||||||
names_[patchI] = dict.dictName();
|
names_[patchI] = dict.dictName();
|
||||||
dict.lookup("type") >> types_[patchI];
|
dict.read("type", types_[patchI]);
|
||||||
if (polyPatch::constraintType(types_[patchI]))
|
if (polyPatch::constraintType(types_[patchI]))
|
||||||
{
|
{
|
||||||
constraint_[patchI] = true;
|
constraint_[patchI] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("inGroups"))
|
if (dict.readIfPresent("inGroups", groups_[patchI]))
|
||||||
{
|
{
|
||||||
dict.lookup("inGroups") >> groups_[patchI];
|
|
||||||
allGroupNames_.insert(groups_[patchI]);
|
allGroupNames_.insert(groups_[patchI]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ Foam::word Foam::solverTemplate::readFromDict
|
|||||||
}
|
}
|
||||||
|
|
||||||
IOdictionary dict(dictHeader);
|
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");
|
dictionary fieldTemplates = solverDict.subDict("fluidFields");
|
||||||
|
|
||||||
const fileName turbModelDir(baseDir/"models"/"turbulence");
|
const fileName turbModelDir(baseDir/"models"/"turbulence");
|
||||||
word turbulenceModel("laminar"); // default to laminar
|
|
||||||
|
|
||||||
const dictionary fieldModels(solverDict.subDict("fluidModels"));
|
const dictionary fieldModels(solverDict.subDict("fluidModels"));
|
||||||
|
|
||||||
word turbulenceType = "none";
|
word turbulenceModel("laminar"); // default to laminar
|
||||||
|
word turbulenceType("none");
|
||||||
|
|
||||||
if (fieldModels.readIfPresent("turbulenceModel", turbulenceType))
|
if (fieldModels.readIfPresent("turbulenceModel", turbulenceType))
|
||||||
{
|
{
|
||||||
word simulationType(word::null);
|
|
||||||
|
|
||||||
if (turbulenceType == "turbulenceModel")
|
if (turbulenceType == "turbulenceModel")
|
||||||
{
|
{
|
||||||
IOdictionary turbulenceProperties
|
IOdictionary turbPropDict
|
||||||
(
|
(
|
||||||
IOobject
|
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
|
// Leave turbulenceModel as laminar
|
||||||
}
|
}
|
||||||
else if (simulationType == "RAS")
|
else if (modelType == "RAS")
|
||||||
{
|
{
|
||||||
turbulenceProperties.subDict(simulationType).lookup("RASModel")
|
turbPropDict.subDict(modelType)
|
||||||
>> turbulenceModel;
|
.read("RASModel", turbulenceModel);
|
||||||
}
|
}
|
||||||
else if (simulationType == "LES")
|
else if (modelType == "LES")
|
||||||
{
|
{
|
||||||
turbulenceProperties.subDict(simulationType).lookup("LESModel")
|
turbPropDict.subDict(modelType)
|
||||||
>> turbulenceModel;
|
.read("LESModel", turbulenceModel);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unhandled turbulence model option " << simulationType
|
<< "Unhandled turbulence model option " << modelType
|
||||||
<< ". Valid options are laminar, RAS, LES"
|
<< ". Valid options are laminar, RAS, LES"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -139,7 +138,7 @@ Foam::dictionary Foam::solverTemplate::readFluidFieldTemplates
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Unhandled turbulence model option " << simulationType
|
<< "Unhandled turbulence model option " << turbulenceType
|
||||||
<< ". Valid options are turbulenceModel"
|
<< ". Valid options are turbulenceModel"
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -259,7 +258,7 @@ Foam::solverTemplate::solverTemplate
|
|||||||
solverType_ = solverTypeNames_.lookup("solverType", solverDict);
|
solverType_ = solverTypeNames_.lookup("solverType", solverDict);
|
||||||
Info<< solverTypeNames_[solverType_];
|
Info<< solverTypeNames_[solverType_];
|
||||||
|
|
||||||
multiRegion_ = readBool(solverDict.lookup("multiRegion"));
|
multiRegion_ = solverDict.get<bool>("multiRegion");
|
||||||
if (multiRegion_)
|
if (multiRegion_)
|
||||||
{
|
{
|
||||||
Info<< ", multi-region";
|
Info<< ", multi-region";
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char *argv[])
|
|||||||
// Read control dictionary
|
// Read control dictionary
|
||||||
const IOdictionary agglomDict(dictIO);
|
const IOdictionary agglomDict(dictIO);
|
||||||
|
|
||||||
bool writeAgglom = readBool(agglomDict.lookup("writeFacesAgglomeration"));
|
const bool writeAgglom(agglomDict.get<bool>("writeFacesAgglomeration"));
|
||||||
|
|
||||||
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
|
const polyBoundaryMesh& boundary = mesh.boundaryMesh();
|
||||||
|
|
||||||
|
|||||||
@ -95,10 +95,10 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
const shapeSelector::shapeType surfType
|
const shapeSelector::shapeType surfType
|
||||||
(
|
(
|
||||||
shapeSelector::shapeTypeNames.read(dict.lookup("type"))
|
shapeSelector::shapeTypeNames.lookup("type", dict)
|
||||||
);
|
);
|
||||||
const vector centre(dict.lookup("centre"));
|
const vector centre(dict.get<vector>("centre"));
|
||||||
const word fieldName(dict.lookup("field"));
|
const word fieldName(dict.get<word>("field"));
|
||||||
|
|
||||||
Info<< "Reading field " << fieldName << "\n" << endl;
|
Info<< "Reading field " << fieldName << "\n" << endl;
|
||||||
volScalarField alpha1
|
volScalarField alpha1
|
||||||
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
case shapeSelector::shapeType::PLANE:
|
case shapeSelector::shapeType::PLANE:
|
||||||
{
|
{
|
||||||
const vector direction(dict.lookup("direction"));
|
const vector direction(dict.get<vector>("direction"));
|
||||||
|
|
||||||
f = -(mesh.points() - centre) & (direction/mag(direction));
|
f = -(mesh.points() - centre) & (direction/mag(direction));
|
||||||
f0 = 0.0;
|
f0 = 0.0;
|
||||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
case shapeSelector::shapeType::SPHERE:
|
case shapeSelector::shapeType::SPHERE:
|
||||||
{
|
{
|
||||||
const scalar radius(readScalar(dict.lookup("radius")));
|
const scalar radius(dict.get<scalar>("radius"));
|
||||||
|
|
||||||
f = -mag(mesh.points() - centre);
|
f = -mag(mesh.points() - centre);
|
||||||
f0 = -radius;
|
f0 = -radius;
|
||||||
@ -140,8 +140,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
case shapeSelector::shapeType::CYLINDER:
|
case shapeSelector::shapeType::CYLINDER:
|
||||||
{
|
{
|
||||||
const scalar radius(readScalar(dict.lookup("radius")));
|
const scalar radius(dict.get<scalar>("radius"));
|
||||||
const vector direction(dict.lookup("direction"));
|
const vector direction(dict.get<vector>("direction"));
|
||||||
|
|
||||||
f = -sqrt
|
f = -sqrt
|
||||||
(
|
(
|
||||||
@ -153,10 +153,10 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
case shapeSelector::shapeType::SIN:
|
case shapeSelector::shapeType::SIN:
|
||||||
{
|
{
|
||||||
const scalar period(readScalar(dict.lookup("period")));
|
const scalar period(dict.get<scalar>("period"));
|
||||||
const scalar amplitude(readScalar(dict.lookup("amplitude")));
|
const scalar amplitude(dict.get<scalar>("amplitude"));
|
||||||
const vector up(dict.lookup("up"));
|
const vector up(dict.get<vector>("up"));
|
||||||
const vector direction(dict.lookup("direction"));
|
const vector direction(dict.get<vector>("direction"));
|
||||||
|
|
||||||
const scalarField xx
|
const scalarField xx
|
||||||
(
|
(
|
||||||
|
|||||||
@ -124,8 +124,8 @@ Foam::tabulatedWallFunctions::SpaldingsLaw::SpaldingsLaw
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
tabulatedWallFunction(dict, mesh, typeName),
|
tabulatedWallFunction(dict, mesh, typeName),
|
||||||
kappa_(readScalar(coeffDict_.lookup("kappa"))),
|
kappa_(coeffDict_.get<scalar>("kappa")),
|
||||||
E_(readScalar(coeffDict_.lookup("E")))
|
E_(coeffDict_.get<scalar>("E"))
|
||||||
{
|
{
|
||||||
invertFunction();
|
invertFunction();
|
||||||
|
|
||||||
@ -136,12 +136,6 @@ Foam::tabulatedWallFunctions::SpaldingsLaw::SpaldingsLaw
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::tabulatedWallFunctions::SpaldingsLaw::~SpaldingsLaw()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::scalar Foam::tabulatedWallFunctions::SpaldingsLaw::yPlus
|
Foam::scalar Foam::tabulatedWallFunctions::SpaldingsLaw::yPlus
|
||||||
|
|||||||
@ -105,8 +105,9 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
SpaldingsLaw(const dictionary& dict, const polyMesh& mesh);
|
SpaldingsLaw(const dictionary& dict, const polyMesh& mesh);
|
||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~SpaldingsLaw();
|
virtual ~SpaldingsLaw() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -54,13 +54,7 @@ Foam::searchableSurfaceModifiers::autoPatch::autoPatch
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
searchableSurfaceModifier(geometry, dict),
|
searchableSurfaceModifier(geometry, dict),
|
||||||
featureAngle_(readScalar(dict.lookup("featureAngle")))
|
featureAngle_(dict.get<scalar>("featureAngle"))
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::searchableSurfaceModifiers::autoPatch::~autoPatch()
|
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -59,8 +59,6 @@ class autoPatch
|
|||||||
const scalar featureAngle_;
|
const scalar featureAngle_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -70,7 +68,7 @@ public:
|
|||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from dictionary
|
//- Construct from dictionary
|
||||||
autoPatch(const searchableSurfaces&, const dictionary&);
|
autoPatch(const searchableSurfaces& geometry, const dictionary& dict);
|
||||||
|
|
||||||
//- Clone
|
//- Clone
|
||||||
autoPtr<searchableSurfaceModifier> clone() const
|
autoPtr<searchableSurfaceModifier> clone() const
|
||||||
@ -81,7 +79,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
virtual ~autoPatch();
|
virtual ~autoPatch() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -226,7 +226,7 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
const dictionary& surfDict = meshSubsetDict.subDict("surface");
|
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"));
|
const bool outside(surfDict.get<bool>("outside"));
|
||||||
|
|
||||||
@ -282,8 +282,8 @@ int main(int argc, char *argv[])
|
|||||||
const dictionary& planeDict = meshSubsetDict.subDict("plane");
|
const dictionary& planeDict = meshSubsetDict.subDict("plane");
|
||||||
|
|
||||||
const plane pl(planeDict);
|
const plane pl(planeDict);
|
||||||
const scalar distance(readScalar(planeDict.lookup("distance")));
|
const scalar distance(planeDict.get<scalar>("distance"));
|
||||||
const scalar cosAngle(readScalar(planeDict.lookup("cosAngle")));
|
const scalar cosAngle(planeDict.get<scalar>("cosAngle"));
|
||||||
|
|
||||||
// Select all triangles that are close to the plane and
|
// Select all triangles that are close to the plane and
|
||||||
// whose normal aligns with the plane as well.
|
// whose normal aligns with the plane as well.
|
||||||
|
|||||||
@ -82,12 +82,11 @@ int main(int argc, char *argv[])
|
|||||||
dictionary control(controlFile);
|
dictionary control(controlFile);
|
||||||
|
|
||||||
|
|
||||||
scalar P(readScalar(control.lookup("P")));
|
const scalar P(control.get<scalar>("P"));
|
||||||
scalar T0(readScalar(control.lookup("T0")));
|
const scalar T0(control.get<scalar>("T0"));
|
||||||
const word fuelName(control.lookup("fuel"));
|
const word fuelName(control.get<word>("fuel"));
|
||||||
scalar n(readScalar(control.lookup("n")));
|
const scalar n(control.get<scalar>("n"));
|
||||||
scalar m(readScalar(control.lookup("m")));
|
const scalar m(control.get<scalar>("m"));
|
||||||
|
|
||||||
|
|
||||||
Info<< nl << "Reading thermodynamic data dictionary" << endl;
|
Info<< nl << "Reading thermodynamic data dictionary" << endl;
|
||||||
|
|
||||||
|
|||||||
@ -85,10 +85,10 @@ int main(int argc, char *argv[])
|
|||||||
dictionary control(controlFile);
|
dictionary control(controlFile);
|
||||||
|
|
||||||
|
|
||||||
scalar P(readScalar(control.lookup("P")));
|
const scalar P(control.get<scalar>("P"));
|
||||||
const word fuelName(control.lookup("fuel"));
|
const word fuelName(control.get<word>("fuel"));
|
||||||
scalar n(readScalar(control.lookup("n")));
|
const scalar n(control.get<scalar>("n"));
|
||||||
scalar m(readScalar(control.lookup("m")));
|
const scalar m(control.get<scalar>("m"));
|
||||||
|
|
||||||
|
|
||||||
Info<< nl << "Reading thermodynamic data dictionary" << endl;
|
Info<< nl << "Reading thermodynamic data dictionary" << endl;
|
||||||
|
|||||||
@ -81,8 +81,8 @@ int main(int argc, char *argv[])
|
|||||||
dictionary control(controlFile);
|
dictionary control(controlFile);
|
||||||
|
|
||||||
|
|
||||||
scalar P(readScalar(control.lookup("P")));
|
const scalar P(control.get<scalar>("P"));
|
||||||
scalar T0(readScalar(control.lookup("T0")));
|
const scalar T0(control.get<scalar>("T0"));
|
||||||
mixture rMix(control.lookup("reactants"));
|
mixture rMix(control.lookup("reactants"));
|
||||||
mixture pMix(control.lookup("products"));
|
mixture pMix(control.lookup("products"));
|
||||||
|
|
||||||
|
|||||||
@ -148,7 +148,7 @@ Foam::LESModel<BasicTurbulenceModel>::New
|
|||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
).subDict("LES").lookup("LESModel")
|
).subDict("LES").get<word>("LESModel")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Selecting LES turbulence model " << modelType << endl;
|
Info<< "Selecting LES turbulence model " << modelType << endl;
|
||||||
|
|||||||
@ -138,7 +138,7 @@ Foam::RASModel<BasicTurbulenceModel>::New
|
|||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
).subDict("RAS").lookup("RASModel")
|
).subDict("RAS").get<word>("RASModel")
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "Selecting RAS turbulence model " << modelType << endl;
|
Info<< "Selecting RAS turbulence model " << modelType << endl;
|
||||||
|
|||||||
@ -32,8 +32,8 @@ IOdictionary turbulenceProperties
|
|||||||
);
|
);
|
||||||
const dictionary& MaxwellCoeffs =
|
const dictionary& MaxwellCoeffs =
|
||||||
turbulenceProperties.subDict("laminar").subDict("MaxwellCoeffs");
|
turbulenceProperties.subDict("laminar").subDict("MaxwellCoeffs");
|
||||||
const scalar nu1 = readScalar(MaxwellCoeffs.lookup("nuM"));
|
const scalar nu1 = MaxwellCoeffs.get<scalar>("nuM");
|
||||||
const scalar lambda = readScalar(MaxwellCoeffs.lookup("lambda"));
|
const scalar lambda = MaxwellCoeffs.get<scalar>("lambda");
|
||||||
|
|
||||||
const scalar rho = 1;
|
const scalar rho = 1;
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ IOdictionary fvOptions
|
|||||||
const dictionary& gradPDict =
|
const dictionary& gradPDict =
|
||||||
fvOptions.subDict("momentumSource").subDict("injectionRateSuSp");
|
fvOptions.subDict("momentumSource").subDict("injectionRateSuSp");
|
||||||
const scalar K =
|
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")());
|
dictionary probes(IFstream(runTime.system()/"probes")());
|
||||||
const point location = pointField(probes.lookup("probeLocations"))[0];
|
const point location = pointField(probes.lookup("probeLocations"))[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user