mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
plane class: adding normalisation of normal vector for vector only
constructor.
This commit is contained in:
@ -128,7 +128,20 @@ Foam::plane::plane(const vector& normalVector)
|
|||||||
:
|
:
|
||||||
unitVector_(normalVector),
|
unitVector_(normalVector),
|
||||||
basePoint_(vector::zero)
|
basePoint_(vector::zero)
|
||||||
{}
|
{
|
||||||
|
scalar magUnitVector(mag(unitVector_));
|
||||||
|
|
||||||
|
if (magUnitVector > VSMALL)
|
||||||
|
{
|
||||||
|
unitVector_ /= magUnitVector;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
FatalErrorIn("plane::plane(const point&, const vector&)")
|
||||||
|
<< "plane normal has zero length"
|
||||||
|
<< abort(FatalError);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Construct from point and normal vector
|
// Construct from point and normal vector
|
||||||
@ -146,8 +159,8 @@ Foam::plane::plane(const point& basePoint, const vector& normalVector)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("plane::plane(const point&, const vector&)")
|
FatalErrorIn("plane::plane(const point&, const vector&)")
|
||||||
<< "plane normal has got zero length"
|
<< "plane normal has zero length"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -217,8 +230,8 @@ Foam::plane::plane(const dictionary& dict)
|
|||||||
"plane::plane(const dictionary&)",
|
"plane::plane(const dictionary&)",
|
||||||
dict
|
dict
|
||||||
)
|
)
|
||||||
<< "Invalid plane type: " << planeType
|
<< "Invalid plane type: " << planeType
|
||||||
<< abort(FatalIOError);
|
<< abort(FatalIOError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,7 +251,7 @@ Foam::plane::plane(Istream& is)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn("plane::plane(Istream& is)")
|
FatalErrorIn("plane::plane(Istream& is)")
|
||||||
<< "plane normal has got zero length"
|
<< "plane normal has zero length"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user