diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblock.H b/src/mesh/blockMesh/PDRblockMesh/PDRblock.H index 91e16b66e2..5f85f21ca9 100644 --- a/src/mesh/blockMesh/PDRblockMesh/PDRblock.H +++ b/src/mesh/blockMesh/PDRblockMesh/PDRblock.H @@ -110,6 +110,12 @@ public: //- True if the location is within the range inline bool contains(const scalar p) const; + //- The first() value is considered the min value. + inline const scalar& min() const; + + //- The last() value is considered the max value. + inline const scalar& max() const; + //- Mid-point location, zero for an empty list. inline scalar centre() const; @@ -305,6 +311,12 @@ public: //- Cell dimensions at i,j,k position. inline vector span(const labelVector& ijk) const; + //- Grid point at i,j,k position. + inline point grid(const label i, const label j, const label k) const; + + //- Grid point at i,j,k position. + inline point grid(const labelVector& ijk) const; + //- Cell centre at i,j,k position. inline point C(const label i, const label j, const label k) const; diff --git a/src/mesh/blockMesh/PDRblockMesh/PDRblockI.H b/src/mesh/blockMesh/PDRblockMesh/PDRblockI.H index a624ee68a6..7a04ce09ea 100644 --- a/src/mesh/blockMesh/PDRblockMesh/PDRblockI.H +++ b/src/mesh/blockMesh/PDRblockMesh/PDRblockI.H @@ -62,6 +62,18 @@ inline bool Foam::PDRblock::location::contains(const scalar p) const } +inline const Foam::scalar& Foam::PDRblock::location::min() const +{ + return scalarList::empty() ? pTraits::rootMax : first(); +} + + +inline const Foam::scalar& Foam::PDRblock::location::max() const +{ + return scalarList::empty() ? pTraits::rootMin : last(); +} + + inline Foam::scalar Foam::PDRblock::location::centre() const { return scalarList::empty() ? 0 : (0.5*first() + 0.5*last()); @@ -206,6 +218,29 @@ inline Foam::vector Foam::PDRblock::span(const labelVector& ijk) const } +inline Foam::point Foam::PDRblock::grid +( + const label i, + const label j, + const label k +) const +{ + return point(grid_.x()[i], grid_.y()[j], grid_.z()[k]); +} + + +inline Foam::point Foam::PDRblock::grid(const labelVector& ijk) const +{ + return + point + ( + grid_.x()[ijk.x()], + grid_.y()[ijk.y()], + grid_.z()[ijk.z()] + ); +} + + inline Foam::point Foam::PDRblock::C ( const label i,