Added operations needed for patch and patch-to-patch interpolation

This commit is contained in:
Hrvoje Jasak 2011-02-17 20:24:59 +00:00
parent 8f3e084150
commit c151f51ccd
2 changed files with 29 additions and 1 deletions

View file

@ -148,6 +148,14 @@ public:
const intersection::direction dir = intersection::VECTOR const intersection::direction dir = intersection::VECTOR
) const; ) const;
//- Return contact sphere diameter
inline scalar contactSphereDiameter
(
const point& p,
const vector& n,
const pointField& meshPoints
) const;
//- Return the triangle //- Return the triangle
inline triPointRef tri(const pointField&) const; inline triPointRef tri(const pointField&) const;
@ -167,7 +175,11 @@ public:
//- Hash specialization for hashing triFace - a commutative hash value. //- Hash specialization for hashing triFace - a commutative hash value.
// Hash incrementally. // Hash incrementally.
template<> template<>
inline unsigned Hash<triFace>::operator()(const triFace& t, unsigned seed) const inline unsigned Hash<triFace>::operator()
(
const triFace& t,
unsigned seed
) const
{ {
// Fortunately we don't need this very often // Fortunately we don't need this very often
const uLabel t0(t[0]); const uLabel t0(t[0]);

View file

@ -288,6 +288,22 @@ inline Foam::pointHit Foam::triFace::ray
} }
inline Foam::scalar Foam::triFace::contactSphereDiameter
(
const point& p,
const vector& n,
const pointField& meshPoints
) const
{
vector n1 = n/(Foam::mag(n) + SMALL);
vector n2 = normal(meshPoints);
n2 /= Foam::mag(n2) + SMALL;
return 2*((centre(meshPoints) - p) & n2)/((n1 & n2) - 1.0);
}
inline Foam::triPointRef Foam::triFace::tri(const pointField& points) const inline Foam::triPointRef Foam::triFace::tri(const pointField& points) const
{ {
return triPointRef return triPointRef