mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
sampledPlane, plane: standardize the selection of the plane type
This commit is contained in:
@ -201,14 +201,14 @@ Foam::plane::plane(const dictionary& dict)
|
|||||||
const dictionary& subDict = dict.subDict("pointAndNormalDict");
|
const dictionary& subDict = dict.subDict("pointAndNormalDict");
|
||||||
|
|
||||||
point_ =
|
point_ =
|
||||||
subDict.found("point")
|
subDict.found("basePoint")
|
||||||
? subDict.lookup("point")
|
? subDict.lookup("basePoint")
|
||||||
: subDict.lookup("basePoint");
|
: subDict.lookup("point");
|
||||||
|
|
||||||
normal_ =
|
normal_ =
|
||||||
subDict.found("normal")
|
subDict.found("normalVector")
|
||||||
? subDict.lookup("normal")
|
? subDict.lookup("normalVector")
|
||||||
: subDict.lookup("normalVector");
|
: subDict.lookup("normal");
|
||||||
|
|
||||||
normal_ /= mag(normal_);
|
normal_ /= mag(normal_);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -118,6 +118,7 @@ protected:
|
|||||||
//- Construct plane description without cutting
|
//- Construct plane description without cutting
|
||||||
cuttingPlane(const plane&);
|
cuttingPlane(const plane&);
|
||||||
|
|
||||||
|
|
||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Recut mesh with existing planeDesc, restricted to a list of cells
|
//- Recut mesh with existing planeDesc, restricted to a list of cells
|
||||||
|
|||||||
@ -71,24 +71,12 @@ Foam::sampledPlane::sampledPlane
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
sampledSurface(name, mesh, dict),
|
sampledSurface(name, mesh, dict),
|
||||||
cuttingPlane
|
cuttingPlane(plane(dict)),
|
||||||
(
|
|
||||||
plane
|
|
||||||
(
|
|
||||||
dict.found("point")
|
|
||||||
? dict.lookup("point")
|
|
||||||
: dict.lookup("basePoint"),
|
|
||||||
|
|
||||||
dict.found("normal")
|
|
||||||
? dict.lookup("normal")
|
|
||||||
: dict.lookup("normalVector")
|
|
||||||
)
|
|
||||||
),
|
|
||||||
zoneKey_(keyType::null),
|
zoneKey_(keyType::null),
|
||||||
triangulate_(dict.lookupOrDefault("triangulate", true)),
|
triangulate_(dict.lookupOrDefault("triangulate", true)),
|
||||||
needsUpdate_(true)
|
needsUpdate_(true)
|
||||||
{
|
{
|
||||||
// make plane relative to the coordinateSystem (Cartesian)
|
// Make plane relative to the coordinateSystem (Cartesian)
|
||||||
// allow lookup from global coordinate systems
|
// allow lookup from global coordinate systems
|
||||||
if (dict.found("coordinateSystem"))
|
if (dict.found("coordinateSystem"))
|
||||||
{
|
{
|
||||||
@ -97,7 +85,7 @@ Foam::sampledPlane::sampledPlane
|
|||||||
point base = cs.globalPosition(planeDesc().refPoint());
|
point base = cs.globalPosition(planeDesc().refPoint());
|
||||||
vector norm = cs.globalVector(planeDesc().normal());
|
vector norm = cs.globalVector(planeDesc().normal());
|
||||||
|
|
||||||
// assign the plane description
|
// Assign the plane description
|
||||||
static_cast<plane&>(*this) = plane(base, norm);
|
static_cast<plane&>(*this) = plane(base, norm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,7 +115,7 @@ bool Foam::sampledPlane::needsUpdate() const
|
|||||||
|
|
||||||
bool Foam::sampledPlane::expire()
|
bool Foam::sampledPlane::expire()
|
||||||
{
|
{
|
||||||
// already marked as expired
|
// Already marked as expired
|
||||||
if (needsUpdate_)
|
if (needsUpdate_)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user