Added operations needed for patch and patch-to-patch interpolation
This commit is contained in:
parent
8f3e084150
commit
c151f51ccd
2 changed files with 29 additions and 1 deletions
|
@ -148,6 +148,14 @@ public:
|
|||
const intersection::direction dir = intersection::VECTOR
|
||||
) const;
|
||||
|
||||
//- Return contact sphere diameter
|
||||
inline scalar contactSphereDiameter
|
||||
(
|
||||
const point& p,
|
||||
const vector& n,
|
||||
const pointField& meshPoints
|
||||
) const;
|
||||
|
||||
//- Return the triangle
|
||||
inline triPointRef tri(const pointField&) const;
|
||||
|
||||
|
@ -167,7 +175,11 @@ public:
|
|||
//- Hash specialization for hashing triFace - a commutative hash value.
|
||||
// Hash incrementally.
|
||||
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
|
||||
const uLabel t0(t[0]);
|
||||
|
|
|
@ -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
|
||||
{
|
||||
return triPointRef
|
||||
|
|
Reference in a new issue