mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: place projectCurveEdge, projectEdge into blockEdges namespace
- consistent with other blockEdge types - adjust some debug output
This commit is contained in:
@ -271,13 +271,13 @@ Foam::blockEdges::arcEdge::arcEdge
|
||||
calcFromMidPoint(points_[start_], points_[end_], p);
|
||||
}
|
||||
|
||||
// Debug information
|
||||
#if 0
|
||||
Info<< "arc " << start_ << ' ' << end_
|
||||
<< ' ' << position(0.5) << ' ' << cs_
|
||||
// << " radius=" << radius_ << " angle=" << radToDeg(angle_)
|
||||
<< nl;
|
||||
#endif
|
||||
if (debug)
|
||||
{
|
||||
Info<< "arc " << start_ << ' ' << end_ << ' '
|
||||
<< position(0.5) << " origin " << cs_.origin() << " // ";
|
||||
cs_.rotation().write(Info);
|
||||
Info<< nl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -288,8 +288,8 @@ Foam::point Foam::blockEdges::arcEdge::position(const scalar lambda) const
|
||||
#ifdef FULLDEBUG
|
||||
if (lambda < -SMALL || lambda > 1 + SMALL)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Parameter out of range, lambda = " << lambda << nl;
|
||||
InfoInFunction
|
||||
<< "Limit parameter to [0-1] range: " << lambda << nl;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -124,8 +124,8 @@ Foam::pointField Foam::blockEdge::appendEndPoints
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::blockEdge::position(const scalarList& lambdas) const
|
||||
{
|
||||
tmp<pointField> tpoints(new pointField(lambdas.size()));
|
||||
pointField& points = tpoints.ref();
|
||||
auto tpoints = tmp<pointField>::New(lambdas.size());
|
||||
auto& points = tpoints.ref();
|
||||
|
||||
forAll(lambdas, i)
|
||||
{
|
||||
@ -135,20 +135,20 @@ Foam::blockEdge::position(const scalarList& lambdas) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::blockEdge::write(Ostream& os, const dictionary& d) const
|
||||
void Foam::blockEdge::write(Ostream& os, const dictionary& dict) const
|
||||
{
|
||||
blockVertex::write(os, start_, d);
|
||||
blockVertex::write(os, start_, dict);
|
||||
os << tab;
|
||||
blockVertex::write(os, end_, d);
|
||||
blockVertex::write(os, end_, dict);
|
||||
os << endl;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const blockEdge& p)
|
||||
Foam::Ostream& Foam::operator<<(Ostream& os, const blockEdge& e)
|
||||
{
|
||||
os << p.start_ << tab << p.end_ << endl;
|
||||
os << e.start_ << tab << e.end_ << endl;
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
@ -35,7 +35,7 @@ Class
|
||||
|
||||
Description
|
||||
Define a curved edge that is parameterized for 0<lambda<1
|
||||
between the start and end point.
|
||||
between the start/end points.
|
||||
|
||||
SourceFiles
|
||||
blockEdge.C
|
||||
@ -54,7 +54,7 @@ namespace Foam
|
||||
|
||||
// Forward Declarations
|
||||
class blockEdge;
|
||||
Ostream& operator<<(Ostream&, const blockEdge&);
|
||||
Ostream& operator<<(Ostream& os, const blockEdge& e);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class blockEdge Declaration
|
||||
@ -188,21 +188,21 @@ public:
|
||||
//- Index of end point
|
||||
inline label end() const;
|
||||
|
||||
//- Compare the given start and end points with this curve
|
||||
//- Compare the given start/end points with this block edge
|
||||
// Return:
|
||||
// - 0: different
|
||||
// - +1: identical
|
||||
// - -1: same edge, but different orientation
|
||||
inline int compare(const blockEdge&) const;
|
||||
inline int compare(const blockEdge& e) const;
|
||||
|
||||
//- Compare the given start and end points with this curve
|
||||
//- Compare the given start/end points with this block edge
|
||||
// Return:
|
||||
// - 0: different
|
||||
// - +1: identical
|
||||
// - -1: same edge, but different orientation
|
||||
inline int compare(const edge&) const;
|
||||
inline int compare(const edge& e) const;
|
||||
|
||||
//- Compare the given start and end points with this curve
|
||||
//- Compare the given start/end points with this block edge
|
||||
// Return:
|
||||
// - 0: different
|
||||
// - +1: identical
|
||||
@ -211,22 +211,22 @@ public:
|
||||
|
||||
//- The point position corresponding to the curve parameter
|
||||
// 0 <= lambda <= 1
|
||||
virtual point position(const scalar) const = 0;
|
||||
virtual point position(const scalar lambda) const = 0;
|
||||
|
||||
//- The point positions corresponding to the curve parameters
|
||||
// 0 <= lambda <= 1
|
||||
virtual tmp<pointField> position(const scalarList&) const;
|
||||
virtual tmp<pointField> position(const scalarList& lambdas) const;
|
||||
|
||||
//- The length of the curve
|
||||
virtual scalar length() const = 0;
|
||||
|
||||
//- Write edge with variable backsubstitution
|
||||
void write(Ostream&, const dictionary&) const;
|
||||
//- Write edge with variable back-substitution
|
||||
void write(Ostream& os, const dictionary& dict) const;
|
||||
|
||||
|
||||
// Ostream Operator
|
||||
|
||||
friend Ostream& operator<<(Ostream&, const blockEdge&);
|
||||
friend Ostream& operator<<(Ostream& os, const blockEdge& e);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -74,8 +74,8 @@ Foam::point Foam::blockEdges::lineEdge::position(const scalar lambda) const
|
||||
#ifdef FULLDEBUG
|
||||
if (lambda < -SMALL || lambda > 1 + SMALL)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Parameter out of range, lambda = " << lambda << nl;
|
||||
InfoInFunction
|
||||
<< "Limit parameter to [0-1] range: " << lambda << nl;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@ -38,15 +38,18 @@ License
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace blockEdges
|
||||
{
|
||||
defineTypeNameAndDebug(projectCurveEdge, 0);
|
||||
addToRunTimeSelectionTable(blockEdge, projectCurveEdge, Istream);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::projectCurveEdge::projectCurveEdge
|
||||
Foam::blockEdges::projectCurveEdge::projectCurveEdge
|
||||
(
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
@ -84,7 +87,7 @@ Foam::projectCurveEdge::projectCurveEdge
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::point
|
||||
Foam::projectCurveEdge::position(const scalar) const
|
||||
Foam::blockEdges::projectCurveEdge::position(const scalar) const
|
||||
{
|
||||
NotImplemented;
|
||||
return point::max;
|
||||
@ -92,7 +95,7 @@ Foam::projectCurveEdge::position(const scalar) const
|
||||
|
||||
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::projectCurveEdge::position(const scalarList& lambdas) const
|
||||
Foam::blockEdges::projectCurveEdge::position(const scalarList& lambdas) const
|
||||
{
|
||||
// For debugging to tag the output
|
||||
static label eIter = 0;
|
||||
@ -267,7 +270,7 @@ Foam::projectCurveEdge::position(const scalarList& lambdas) const
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::projectCurveEdge::length() const
|
||||
Foam::scalar Foam::blockEdges::projectCurveEdge::length() const
|
||||
{
|
||||
NotImplemented;
|
||||
return 1;
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::projectCurveEdge
|
||||
Foam::blockEdges::projectCurveEdge
|
||||
|
||||
Description
|
||||
Defines the edge from the projection onto a surface (single surface)
|
||||
@ -36,8 +36,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef projectCurveEdge_H
|
||||
#define projectCurveEdge_H
|
||||
#ifndef blockEdges_projectCurveEdge_H
|
||||
#define blockEdges_projectCurveEdge_H
|
||||
|
||||
#include "blockEdge.H"
|
||||
|
||||
@ -49,6 +49,9 @@ namespace Foam
|
||||
// Forward Declarations
|
||||
class pointConstraint;
|
||||
|
||||
namespace blockEdges
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class projectCurveEdge Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -116,6 +119,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace blockEdges
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -36,15 +36,17 @@ License
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace blockEdges
|
||||
{
|
||||
defineTypeNameAndDebug(projectEdge, 0);
|
||||
addToRunTimeSelectionTable(blockEdge, projectEdge, Istream);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::projectEdge::findNearest
|
||||
void Foam::blockEdges::projectEdge::findNearest
|
||||
(
|
||||
const point& pt,
|
||||
point& near,
|
||||
@ -80,7 +82,7 @@ void Foam::projectEdge::findNearest
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::projectEdge::projectEdge
|
||||
Foam::blockEdges::projectEdge::projectEdge
|
||||
(
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
@ -110,7 +112,7 @@ Foam::projectEdge::projectEdge
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::point Foam::projectEdge::position(const scalar lambda) const
|
||||
Foam::point Foam::blockEdges::projectEdge::position(const scalar lambda) const
|
||||
{
|
||||
// Initial guess
|
||||
const point start(points_[start_] + lambda*(points_[end_]-points_[start_]));
|
||||
@ -128,7 +130,7 @@ Foam::point Foam::projectEdge::position(const scalar lambda) const
|
||||
|
||||
|
||||
Foam::tmp<Foam::pointField>
|
||||
Foam::projectEdge::position(const scalarList& lambdas) const
|
||||
Foam::blockEdges::projectEdge::position(const scalarList& lambdas) const
|
||||
{
|
||||
// For debugging to tag the output
|
||||
static label eIter = 0;
|
||||
@ -270,7 +272,7 @@ Foam::projectEdge::position(const scalarList& lambdas) const
|
||||
}
|
||||
|
||||
|
||||
Foam::scalar Foam::projectEdge::length() const
|
||||
Foam::scalar Foam::blockEdges::projectEdge::length() const
|
||||
{
|
||||
NotImplemented;
|
||||
return 1;
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::projectEdge
|
||||
Foam::blockEdges::projectEdge
|
||||
|
||||
Description
|
||||
Defines the edge from the projection onto a surface (single surface)
|
||||
@ -36,8 +36,8 @@ SourceFiles
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef projectEdge_H
|
||||
#define projectEdge_H
|
||||
#ifndef blockEdges_projectEdge_H
|
||||
#define blockEdges_projectEdge_H
|
||||
|
||||
#include "blockEdge.H"
|
||||
|
||||
@ -49,6 +49,9 @@ namespace Foam
|
||||
// Forward Declarations
|
||||
class pointConstraint;
|
||||
|
||||
namespace blockEdges
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class projectEdge Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -118,6 +121,7 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace blockEdges
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Reference in New Issue
Block a user