diff --git a/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C b/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C index 698fec2a8db45418ebc3f7a8878b1e862728a21d..4e5d33badd181cbc0dfdddcbbd2f0f57f2b4f1bd 100644 --- a/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C +++ b/src/mesh/blockMesh/blockEdges/arcEdge/arcEdge.C @@ -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 diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C index a49880b12123ee67531c0e05cf97890ef368e52c..ece247bf14a61825bef33be6a6c8e8cf7659ad73 100644 --- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C +++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.C @@ -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; } diff --git a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H index dd48cba834356d67b06031a48c65ce1c94f11f70..ae87a2fc5bdbcfa7332a9a25b98e441ef61c230f 100644 --- a/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H +++ b/src/mesh/blockMesh/blockEdges/blockEdge/blockEdge.H @@ -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); }; diff --git a/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C b/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C index 203f16220a8ac0b5c589f289e51a81ff2d73df84..564240197c16a233008e27afa000687ee0114460 100644 --- a/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C +++ b/src/mesh/blockMesh/blockEdges/lineEdge/lineEdge.C @@ -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 diff --git a/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C index f6f182207a288aff214ab2e4e22ac8fcd91e4c9f..da862fd7d705097792b145a0b9d56ae48207e906 100644 --- a/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C +++ b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.C @@ -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; diff --git a/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H index 7f939b9d58bc3114882a766a8a6d1b5969002e2a..528a7e1a303d03a73e8107e6bd5c224c5a7be24f 100644 --- a/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H +++ b/src/mesh/blockMesh/blockEdges/projectCurveEdge/projectCurveEdge.H @@ -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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C index 16b99b1bbf36f403b89c821357193c10de08f9c9..40ce7fe178d98ac24fbf12864008f54d7dca0101 100644 --- a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C +++ b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.C @@ -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; diff --git a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H index 44c9d143d8581f1996a86a158042f45cd9f54382..459f34f8308cd3fa15549eb1c5e132153959dd00 100644 --- a/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H +++ b/src/mesh/blockMesh/blockEdges/projectEdge/projectEdge.H @@ -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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //