Skip to content
Snippets Groups Projects
Commit c6200ea2 authored by Henry Weller's avatar Henry Weller
Browse files

sampledPlane, plane: standardize the selection of the plane type

parent fdb4f371
Branches
Tags
No related merge requests found
...@@ -201,14 +201,14 @@ Foam::plane::plane(const dictionary& dict) ...@@ -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: ...@@ -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 ...@@ -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 ...@@ -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 ...@@ -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;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment