mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Added Kerstin's bug fix
http://openfoam.cfd-online.com/cgi-bin/forum/show.cgi?126/7880 * applications/utilities/mesh/generation/blockMesh/curvedEdges/polySplineEdge.C:
This commit is contained in:
@ -22,28 +22,21 @@ License
|
|||||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
Description
|
|
||||||
polySplineEdge class : representation of a spline via a polyLine
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "error.H"
|
|
||||||
|
|
||||||
#include "polySplineEdge.H"
|
#include "polySplineEdge.H"
|
||||||
#include "BSpline.H"
|
#include "BSpline.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
defineTypeNameAndDebug(polySplineEdge, 0);
|
defineTypeNameAndDebug(polySplineEdge, 0);
|
||||||
|
|
||||||
// Add the curvedEdge constructor functions to the hash tables
|
// Add the curvedEdge constructor functions to the hash tables
|
||||||
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
||||||
addPolySplineEdgeIstreamConstructorToTable_;
|
addPolySplineEdgeIstreamConstructorToTable_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
@ -56,7 +49,7 @@ curvedEdge::addIstreamConstructorToTable<polySplineEdge>
|
|||||||
// note that the points are evenly spaced in the parameter mu, not
|
// note that the points are evenly spaced in the parameter mu, not
|
||||||
// in real space
|
// in real space
|
||||||
|
|
||||||
pointField polySplineEdge::intervening
|
Foam::pointField Foam::polySplineEdge::intervening
|
||||||
(
|
(
|
||||||
const pointField& otherknots,
|
const pointField& otherknots,
|
||||||
const label nbetweenKnots,
|
const label nbetweenKnots,
|
||||||
@ -72,7 +65,7 @@ pointField polySplineEdge::intervening
|
|||||||
|
|
||||||
label N = spl.nKnots();
|
label N = spl.nKnots();
|
||||||
scalar init = 1.0/(N - 1);
|
scalar init = 1.0/(N - 1);
|
||||||
scalar interval = (N - 3)/N;
|
scalar interval = (N - scalar(3))/N;
|
||||||
interval /= otherknots.size() + 1;
|
interval /= otherknots.size() + 1;
|
||||||
interval /= nbetweenKnots + 1;
|
interval /= nbetweenKnots + 1;
|
||||||
|
|
||||||
@ -93,8 +86,7 @@ pointField polySplineEdge::intervening
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
Foam::polySplineEdge::polySplineEdge
|
||||||
polySplineEdge::polySplineEdge
|
|
||||||
(
|
(
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
const label start,
|
const label start,
|
||||||
@ -118,14 +110,13 @@ polySplineEdge::polySplineEdge
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// Construct from Istream
|
Foam::polySplineEdge::polySplineEdge
|
||||||
polySplineEdge::polySplineEdge
|
|
||||||
(
|
(
|
||||||
const pointField& points,
|
const pointField& points,
|
||||||
Istream& is
|
Istream& is
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
curvedEdge(points, readLabel(is), readLabel(is)),
|
curvedEdge(points, is),
|
||||||
polyLine(pointField(0)),
|
polyLine(pointField(0)),
|
||||||
otherKnots_(is)
|
otherKnots_(is)
|
||||||
{
|
{
|
||||||
@ -144,23 +135,16 @@ polySplineEdge::polySplineEdge
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
//- Return the position of a point on the curve given by
|
Foam::vector Foam::polySplineEdge::position(const scalar mu) const
|
||||||
// the parameter 0 <= lambda <= 1
|
|
||||||
vector polySplineEdge::position(const scalar mu) const
|
|
||||||
{
|
{
|
||||||
return polyLine::position(mu);
|
return polyLine::position(mu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//- Return the length of the curve
|
Foam::scalar Foam::polySplineEdge::length() const
|
||||||
scalar polySplineEdge::length() const
|
|
||||||
{
|
{
|
||||||
return polyLine::length();
|
return polyLine::length();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user