lagrangian: Un-templated the tracking data
Tracking data classes are no longer templated on the derived cloud type. The advantage of this is that they can now be passed to sub models. This should allow continuous phase data to be removed from the parcel classes. The disadvantage is that every function which once took a templated TrackData argument now needs an additional TrackCloudType argument in order to perform the necessary down-casting.
This commit is contained in:
@ -100,6 +100,7 @@ Foam::findCellParticle::findCellParticle
|
||||
|
||||
bool Foam::findCellParticle::move
|
||||
(
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td,
|
||||
const scalar maxTrackLen
|
||||
)
|
||||
@ -110,7 +111,7 @@ bool Foam::findCellParticle::move
|
||||
while (td.keepParticle && !td.switchProcessor && stepFraction() < 1)
|
||||
{
|
||||
const scalar f = 1 - stepFraction();
|
||||
trackToAndHitFace(f*(end_ - start_), f, td);
|
||||
trackToAndHitFace(f*(end_ - start_), f, cloud, td);
|
||||
}
|
||||
|
||||
if (stepFraction() == 1 || !td.keepParticle)
|
||||
@ -128,6 +129,7 @@ bool Foam::findCellParticle::move
|
||||
bool Foam::findCellParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td,
|
||||
const label patchi,
|
||||
const scalar trackFraction,
|
||||
@ -141,6 +143,7 @@ bool Foam::findCellParticle::hitPatch
|
||||
void Foam::findCellParticle::hitWedgePatch
|
||||
(
|
||||
const wedgePolyPatch&,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -152,6 +155,7 @@ void Foam::findCellParticle::hitWedgePatch
|
||||
void Foam::findCellParticle::hitSymmetryPlanePatch
|
||||
(
|
||||
const symmetryPlanePolyPatch&,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -163,6 +167,7 @@ void Foam::findCellParticle::hitSymmetryPlanePatch
|
||||
void Foam::findCellParticle::hitSymmetryPatch
|
||||
(
|
||||
const symmetryPolyPatch&,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -174,6 +179,7 @@ void Foam::findCellParticle::hitSymmetryPatch
|
||||
void Foam::findCellParticle::hitCyclicPatch
|
||||
(
|
||||
const cyclicPolyPatch&,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -185,6 +191,7 @@ void Foam::findCellParticle::hitCyclicPatch
|
||||
void Foam::findCellParticle::hitProcessorPatch
|
||||
(
|
||||
const processorPolyPatch&,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -196,6 +203,7 @@ void Foam::findCellParticle::hitProcessorPatch
|
||||
void Foam::findCellParticle::hitWallPatch
|
||||
(
|
||||
const wallPolyPatch& wpp,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td,
|
||||
const tetIndices&
|
||||
)
|
||||
@ -208,6 +216,7 @@ void Foam::findCellParticle::hitWallPatch
|
||||
void Foam::findCellParticle::hitPatch
|
||||
(
|
||||
const polyPatch& wpp,
|
||||
Cloud<findCellParticle>& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
|
||||
@ -80,7 +80,7 @@ public:
|
||||
//- Class used to pass tracking data to the trackToFace function
|
||||
class trackingData
|
||||
:
|
||||
public particle::TrackingData<Cloud<findCellParticle>>
|
||||
public particle::trackingData
|
||||
{
|
||||
labelListList& cellToData_;
|
||||
List<List<point>>& cellToEnd_;
|
||||
@ -96,7 +96,7 @@ public:
|
||||
List<List<point>>& cellToEnd
|
||||
)
|
||||
:
|
||||
particle::TrackingData<Cloud<findCellParticle>>(cloud),
|
||||
particle::trackingData(cloud),
|
||||
cellToData_(cellToData),
|
||||
cellToEnd_(cellToEnd)
|
||||
{}
|
||||
@ -220,7 +220,7 @@ public:
|
||||
// Tracking
|
||||
|
||||
//- Track all particles to their end point
|
||||
bool move(trackingData&, const scalar);
|
||||
bool move(Cloud<findCellParticle>&, trackingData&, const scalar);
|
||||
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
@ -228,6 +228,7 @@ public:
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td,
|
||||
const label patchi,
|
||||
const scalar trackFraction,
|
||||
@ -238,6 +239,7 @@ public:
|
||||
void hitWedgePatch
|
||||
(
|
||||
const wedgePolyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -246,6 +248,7 @@ public:
|
||||
void hitSymmetryPlanePatch
|
||||
(
|
||||
const symmetryPlanePolyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -254,6 +257,7 @@ public:
|
||||
void hitSymmetryPatch
|
||||
(
|
||||
const symmetryPolyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -261,6 +265,7 @@ public:
|
||||
void hitCyclicPatch
|
||||
(
|
||||
const cyclicPolyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -269,6 +274,7 @@ public:
|
||||
void hitProcessorPatch
|
||||
(
|
||||
const processorPolyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -276,6 +282,7 @@ public:
|
||||
void hitWallPatch
|
||||
(
|
||||
const wallPolyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td,
|
||||
const tetIndices&
|
||||
);
|
||||
@ -284,6 +291,7 @@ public:
|
||||
void hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
Cloud<findCellParticle>&,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
|
||||
@ -171,7 +171,7 @@ void Foam::functionObjects::nearWallFields::calcAddressing()
|
||||
}
|
||||
|
||||
|
||||
cloud.move(td, maxTrackLen);
|
||||
cloud.move(cloud, td, maxTrackLen);
|
||||
|
||||
|
||||
// Rework cell-to-globalpatchface into a map
|
||||
|
||||
@ -272,7 +272,7 @@ void Foam::functionObjects::streamLine::track()
|
||||
const scalar trackTime = Foam::sqrt(GREAT);
|
||||
|
||||
// Track
|
||||
particles.move(td, trackTime);
|
||||
particles.move(particles, td, trackTime);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "streamLineParticle.H"
|
||||
#include "streamLineParticleCloud.H"
|
||||
#include "vectorFieldIOField.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
@ -145,6 +146,7 @@ Foam::streamLineParticle::streamLineParticle
|
||||
|
||||
bool Foam::streamLineParticle::move
|
||||
(
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td,
|
||||
const scalar
|
||||
)
|
||||
@ -203,7 +205,7 @@ bool Foam::streamLineParticle::move
|
||||
dt = maxDt;
|
||||
}
|
||||
|
||||
trackToAndHitFace(dt*U, 0, td);
|
||||
trackToAndHitFace(dt*U, 0, cloud, td);
|
||||
|
||||
if
|
||||
(
|
||||
@ -271,6 +273,7 @@ bool Foam::streamLineParticle::move
|
||||
bool Foam::streamLineParticle::hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td,
|
||||
const label patchi,
|
||||
const scalar trackFraction,
|
||||
@ -285,6 +288,7 @@ bool Foam::streamLineParticle::hitPatch
|
||||
void Foam::streamLineParticle::hitWedgePatch
|
||||
(
|
||||
const wedgePolyPatch& pp,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -296,6 +300,7 @@ void Foam::streamLineParticle::hitWedgePatch
|
||||
void Foam::streamLineParticle::hitSymmetryPlanePatch
|
||||
(
|
||||
const symmetryPlanePolyPatch& pp,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -307,6 +312,7 @@ void Foam::streamLineParticle::hitSymmetryPlanePatch
|
||||
void Foam::streamLineParticle::hitSymmetryPatch
|
||||
(
|
||||
const symmetryPolyPatch& pp,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -318,6 +324,7 @@ void Foam::streamLineParticle::hitSymmetryPatch
|
||||
void Foam::streamLineParticle::hitCyclicPatch
|
||||
(
|
||||
const cyclicPolyPatch& pp,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -329,6 +336,7 @@ void Foam::streamLineParticle::hitCyclicPatch
|
||||
void Foam::streamLineParticle::hitProcessorPatch
|
||||
(
|
||||
const processorPolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
@ -340,6 +348,7 @@ void Foam::streamLineParticle::hitProcessorPatch
|
||||
void Foam::streamLineParticle::hitWallPatch
|
||||
(
|
||||
const wallPolyPatch& wpp,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td,
|
||||
const tetIndices&
|
||||
)
|
||||
@ -352,6 +361,7 @@ void Foam::streamLineParticle::hitWallPatch
|
||||
void Foam::streamLineParticle::hitPatch
|
||||
(
|
||||
const polyPatch& wpp,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
)
|
||||
{
|
||||
|
||||
@ -49,6 +49,7 @@ namespace Foam
|
||||
// Forward declaration of friend functions and operators
|
||||
|
||||
class streamLineParticle;
|
||||
class streamLineParticleCloud;
|
||||
|
||||
Ostream& operator<<(Ostream&, const streamLineParticle&);
|
||||
|
||||
@ -64,7 +65,7 @@ public:
|
||||
|
||||
class trackingData
|
||||
:
|
||||
public particle::TrackingData<Cloud<streamLineParticle>>
|
||||
public particle::trackingData
|
||||
{
|
||||
public:
|
||||
|
||||
@ -94,7 +95,7 @@ public:
|
||||
//- Construct from components
|
||||
trackingData
|
||||
(
|
||||
Cloud<streamLineParticle>& cloud,
|
||||
streamLineParticleCloud& cloud,
|
||||
const PtrList<interpolation<scalar>>& vsInterp,
|
||||
const PtrList<interpolation<vector>>& vvInterp,
|
||||
const label UIndex,
|
||||
@ -106,7 +107,7 @@ public:
|
||||
List<DynamicList<vectorList>>& allVectors
|
||||
)
|
||||
:
|
||||
particle::TrackingData<Cloud<streamLineParticle>>(cloud),
|
||||
particle::trackingData(cloud),
|
||||
vsInterp_(vsInterp),
|
||||
vvInterp_(vvInterp),
|
||||
UIndex_(UIndex),
|
||||
@ -206,13 +207,19 @@ public:
|
||||
// Tracking
|
||||
|
||||
//- Track all particles to their end point
|
||||
bool move(trackingData&, const scalar);
|
||||
bool move
|
||||
(
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData&,
|
||||
const scalar
|
||||
);
|
||||
|
||||
//- Overridable function to handle the particle hitting a patch
|
||||
// Executed before other patch-hitting functions
|
||||
bool hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td,
|
||||
const label patchi,
|
||||
const scalar trackFraction,
|
||||
@ -223,6 +230,7 @@ public:
|
||||
void hitWedgePatch
|
||||
(
|
||||
const wedgePolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -231,6 +239,7 @@ public:
|
||||
void hitSymmetryPlanePatch
|
||||
(
|
||||
const symmetryPlanePolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -239,6 +248,7 @@ public:
|
||||
void hitSymmetryPatch
|
||||
(
|
||||
const symmetryPolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -246,6 +256,7 @@ public:
|
||||
void hitCyclicPatch
|
||||
(
|
||||
const cyclicPolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -254,6 +265,7 @@ public:
|
||||
void hitProcessorPatch
|
||||
(
|
||||
const processorPolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
@ -261,6 +273,7 @@ public:
|
||||
void hitWallPatch
|
||||
(
|
||||
const wallPolyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td,
|
||||
const tetIndices&
|
||||
);
|
||||
@ -269,6 +282,7 @@ public:
|
||||
void hitPatch
|
||||
(
|
||||
const polyPatch&,
|
||||
streamLineParticleCloud& cloud,
|
||||
trackingData& td
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user