Skip to content
Snippets Groups Projects
Commit b66e42e1 authored by Andrew Heather's avatar Andrew Heather
Browse files

added hitPatch() function

parent e009a15c
No related branches found
No related tags found
No related merge requests found
...@@ -339,6 +339,8 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace ...@@ -339,6 +339,8 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
label patchi = patch(facei_); label patchi = patch(facei_);
const polyPatch& patch = mesh.boundaryMesh()[patchi]; const polyPatch& patch = mesh.boundaryMesh()[patchi];
p.hitPatch(patch, td, patchi);
if (isA<wedgePolyPatch>(patch)) if (isA<wedgePolyPatch>(patch))
{ {
p.hitWedgePatch p.hitWedgePatch
...@@ -376,10 +378,7 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace ...@@ -376,10 +378,7 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace
} }
else if (isA<polyPatch>(patch)) else if (isA<polyPatch>(patch))
{ {
p.hitPatch p.hitPatch(patch, td);
(
static_cast<const polyPatch&>(patch), td
);
} }
else else
{ {
...@@ -434,6 +433,18 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&) ...@@ -434,6 +433,18 @@ void Foam::Particle<ParticleType>::transformProperties(const vector&)
{} {}
template<class ParticleType>
template<class TrackData>
void Foam::Particle<ParticleType>::hitPatch
(
const polyPatch&,
TrackData&,
const label
)
{}
template<class ParticleType> template<class ParticleType>
template<class TrackData> template<class TrackData>
void Foam::Particle<ParticleType>::hitWedgePatch void Foam::Particle<ParticleType>::hitWedgePatch
......
...@@ -171,6 +171,16 @@ protected: ...@@ -171,6 +171,16 @@ protected:
// Patch interactions // Patch interactions
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackData>
void hitPatch
(
const polyPatch&,
TrackData& td,
const label patchI
);
//- Overridable function to handle the particle hitting a wedgePatch //- Overridable function to handle the particle hitting a wedgePatch
template<class TrackData> template<class TrackData>
void hitWedgePatch void hitWedgePatch
......
...@@ -254,6 +254,30 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td) ...@@ -254,6 +254,30 @@ bool Foam::KinematicParcel<ParcelType>::move(TrackData& td)
} }
template<class ParcelType>
template<class TrackData>
void Foam::KinematicParcel<ParcelType>::hitPatch
(
const polyPatch& pp,
TrackData& td,
const label patchI
)
{
ParcelType& p = static_cast<ParcelType&>(*this);
td.cloud().postProcessing().postPatch(p, patchI);
}
template<class ParcelType>
void Foam::KinematicParcel<ParcelType>::hitPatch
(
const polyPatch& pp,
int& td,
const label patchI
)
{}
template<class ParcelType> template<class ParcelType>
template<class TrackData> template<class TrackData>
void Foam::KinematicParcel<ParcelType>::hitProcessorPatch void Foam::KinematicParcel<ParcelType>::hitProcessorPatch
......
...@@ -418,6 +418,27 @@ public: ...@@ -418,6 +418,27 @@ public:
// Patch interactions // Patch interactions
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions
template<class TrackData>
void hitPatch
(
const polyPatch& p,
TrackData& td,
const label patchI
);
//- Overridable function to handle the particle hitting a patch
// Executed before other patch-hitting functions without trackData
void hitPatch
(
const polyPatch& p,
int& td,
const label patchI
);
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// processorPatch // processorPatch
template<class TrackData> template<class TrackData>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment