ENH: Added postMove() hook to particle function objects

This commit is contained in:
andy
2011-09-20 14:40:13 +01:00
parent f855447619
commit 4614b5cf15
5 changed files with 47 additions and 15 deletions

View File

@ -324,6 +324,8 @@ bool Foam::KinematicParcel<ParcelType>::move
}
p.age() += dt;
td.cloud().functions().postMove(p, cellI, dt);
}
return td.keepParticle;

View File

@ -91,6 +91,18 @@ void Foam::CloudFunctionObject<CloudType>::postEvolve()
}
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postMove
(
const typename CloudType::parcelType&,
const label,
const scalar
)
{
// do nothing
}
template<class CloudType>
void Foam::CloudFunctionObject<CloudType>::postPatch
(
@ -98,14 +110,7 @@ void Foam::CloudFunctionObject<CloudType>::postPatch
const label
)
{
notImplemented
(
"void Foam::CloudFunctionObject<CloudType>::postPatch"
"("
"const typename CloudType::parcelType&,"
"const label"
")"
);
// do nothing
}
@ -115,13 +120,7 @@ void Foam::CloudFunctionObject<CloudType>::postFace
const typename CloudType::parcelType&
)
{
notImplemented
(
"void Foam::CloudFunctionObject<CloudType>::postFace"
"("
"const typename CloudType::parcelType&"
")"
);
// do nothing
}

View File

@ -129,6 +129,14 @@ public:
//- Post-evolve hook
virtual void postEvolve();
//- Post-move hook
virtual void postMove
(
const typename CloudType::parcelType& p,
const label cellI,
const scalar dt
);
//- Post-patch hook
virtual void postPatch
(

View File

@ -127,6 +127,21 @@ void Foam::CloudFunctionObjectList<CloudType>::postEvolve()
}
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postMove
(
const typename CloudType::parcelType& p,
const label cellI,
const scalar dt
)
{
forAll(*this, i)
{
this->operator[](i).postMove(p, cellI, dt);
}
}
template<class CloudType>
void Foam::CloudFunctionObjectList<CloudType>::postPatch
(

View File

@ -109,6 +109,14 @@ public:
//- Post-evolve hook
virtual void postEvolve();
//- Post-move hook
virtual void postMove
(
const typename CloudType::parcelType& p,
const label cellI,
const scalar dt
);
//- Post-patch hook
virtual void postPatch
(