mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add min/max method to PDRblock::location (#1216)
- grid(i,j,k) method for returning the grid point at an i-j-k location
This commit is contained in:
committed by
Andrew Heather
parent
5ab1021211
commit
9cf085a68c
@ -110,6 +110,12 @@ public:
|
|||||||
//- True if the location is within the range
|
//- True if the location is within the range
|
||||||
inline bool contains(const scalar p) const;
|
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.
|
//- Mid-point location, zero for an empty list.
|
||||||
inline scalar centre() const;
|
inline scalar centre() const;
|
||||||
|
|
||||||
@ -305,6 +311,12 @@ public:
|
|||||||
//- Cell dimensions at i,j,k position.
|
//- Cell dimensions at i,j,k position.
|
||||||
inline vector span(const labelVector& ijk) const;
|
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.
|
//- Cell centre at i,j,k position.
|
||||||
inline point C(const label i, const label j, const label k) const;
|
inline point C(const label i, const label j, const label k) const;
|
||||||
|
|
||||||
|
|||||||
@ -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<scalar>::rootMax : first();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::scalar& Foam::PDRblock::location::max() const
|
||||||
|
{
|
||||||
|
return scalarList::empty() ? pTraits<scalar>::rootMin : last();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::scalar Foam::PDRblock::location::centre() const
|
inline Foam::scalar Foam::PDRblock::location::centre() const
|
||||||
{
|
{
|
||||||
return scalarList::empty() ? 0 : (0.5*first() + 0.5*last());
|
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
|
inline Foam::point Foam::PDRblock::C
|
||||||
(
|
(
|
||||||
const label i,
|
const label i,
|
||||||
|
|||||||
Reference in New Issue
Block a user