From af115c5d0162b982d4d2d4df0dbb383e88134e79 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 24 Feb 2011 16:47:54 +0000 Subject: [PATCH] ENH: Updated utilities using lagrangian classes --- .../decomposePar/lagrangianFieldDecomposer.C | 6 +- .../preProcessing/mapFields/mapLagrangian.C | 26 ++-- .../meshRefinement/meshRefinementRefine.C | 8 +- .../trackedParticle/trackedParticle.C | 108 +++----------- .../trackedParticle/trackedParticle.H | 115 ++++++--------- .../trackedParticle/trackedParticleCloud.C | 4 +- .../reconstructLagrangianPositions.C | 11 +- .../field/streamLine/streamLine.C | 6 +- .../field/streamLine/streamLineParticle.C | 133 +++++------------- .../field/streamLine/streamLineParticle.H | 115 ++++++--------- src/sampling/sampledSet/face/faceOnlySet.C | 24 ++-- src/sampling/sampledSet/face/faceOnlySet.H | 9 +- .../sampledSet/midPoint/midPointSet.C | 5 +- .../sampledSet/midPoint/midPointSet.H | 4 +- .../midPointAndFace/midPointAndFaceSet.H | 4 +- .../sampledSet/polyLine/polyLineSet.C | 20 +-- .../sampledSet/polyLine/polyLineSet.H | 9 +- src/sampling/sampledSet/uniform/uniformSet.C | 33 ++--- src/sampling/sampledSet/uniform/uniformSet.H | 9 +- .../sampledTriSurfaceMesh.C | 1 + 20 files changed, 223 insertions(+), 427 deletions(-) diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C index 4392395af0..c9ab1ffbbe 100644 --- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C +++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,7 +100,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer ( new passiveParticle ( - positions_, + procMesh, ppi.position(), procCelli, false @@ -112,7 +112,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer particleIndices_.setSize(pi); - IOPosition(positions_).write(); + IOPosition >(positions_).write(); } diff --git a/applications/utilities/preProcessing/mapFields/mapLagrangian.C b/applications/utilities/preProcessing/mapFields/mapLagrangian.C index 36dd981719..97a999b62c 100644 --- a/applications/utilities/preProcessing/mapFields/mapLagrangian.C +++ b/applications/utilities/preProcessing/mapFields/mapLagrangian.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,8 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "MapLagrangianFields.H" -#include "Cloud.H" -#include "passiveParticle.H" +#include "passiveParticleCloud.H" #include "meshSearch.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -44,7 +43,9 @@ static label findCell(const Cloud& cloud, const point& pt) label tetFaceI = -1; label tetPtI = -1; - cloud.findCellFacePt(pt, cellI, tetFaceI, tetPtI); + const polyMesh& mesh = cloud.pMesh(); + + mesh.findCellFacePt(pt, cellI, tetFaceI, tetPtI); if (cellI >= 0) { @@ -55,8 +56,6 @@ static label findCell(const Cloud& cloud, const point& pt) // See if particle on face by finding nearest face and shifting // particle. - const polyMesh& mesh = cloud.pMesh(); - meshSearch meshSearcher(mesh, false); label faceI = meshSearcher.findNearestBoundaryFace(pt); @@ -67,7 +66,7 @@ static label findCell(const Cloud& cloud, const point& pt) const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc; - cloud.findCellFacePt(perturbPt, cellI, tetFaceI, tetPtI); + mesh.findCellFacePt(perturbPt, cellI, tetFaceI, tetPtI); return cellI; } @@ -124,7 +123,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp) Info<< nl << " processing cloud " << cloudDirs[cloudI] << endl; // Read positions & cell - Cloud sourceParcels + passiveParticleCloud sourceParcels ( meshSource, cloudDirs[cloudI], @@ -134,13 +133,15 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp) << " parcels from source mesh." << endl; // Construct empty target cloud - Cloud targetParcels + passiveParticleCloud targetParcels ( meshTarget, cloudDirs[cloudI], IDLList() ); + particle::TrackingData td(targetParcels); + label sourceParticleI = 0; // Indices of source particles that get added to targetParcels @@ -176,15 +177,14 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp) ( new passiveParticle ( - targetParcels, + meshTarget, targetCc[targetCells[i]], targetCells[i] ) ); passiveParticle& newP = newPtr(); - scalar fraction = 0; - label faceI = newP.track(iter().position(), fraction); + label faceI = newP.track(iter().position(), td); if (faceI < 0 && newP.cell() >= 0) { @@ -246,7 +246,7 @@ void mapLagrangian(const meshToMesh& meshToMeshInterp) if (addParticles.size()) { - IOPosition(targetParcels).write(); + IOPosition(targetParcels).write(); // addParticles now contains the indices of the sourceMesh // particles that were appended to the target mesh. diff --git a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C index be26fe0988..c2e7a6ffd0 100644 --- a/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C +++ b/src/mesh/autoMesh/autoHexMesh/meshRefinement/meshRefinementRefine.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -283,7 +283,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement label tetFaceI = -1; label tetPtI = -1; - cloud.findCellFacePt(keepPoint, cellI, tetFaceI, tetPtI); + mesh_.findCellFacePt(keepPoint, cellI, tetFaceI, tetPtI); if (cellI != -1) { @@ -309,7 +309,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement ( new trackedParticle ( - cloud, + mesh_, keepPoint, cellI, tetFaceI, @@ -330,7 +330,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement labelList maxFeatureLevel(mesh_.nCells(), -1); // Database to pass into trackedParticle::move - trackedParticle::trackData td(cloud, maxFeatureLevel); + trackedParticle::trackingData td(cloud, maxFeatureLevel); // Track all particles to their end position (= starting feature point) cloud.move(td, GREAT); diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C index 214e7d6440..607a65ebaa 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ License Foam::trackedParticle::trackedParticle ( - const Cloud& c, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -40,7 +40,7 @@ Foam::trackedParticle::trackedParticle const label j ) : - Particle(c, position, cellI, tetFaceI, tetPtI), + particle(mesh, position, cellI, tetFaceI, tetPtI), end_(end), level_(level), i_(i), @@ -50,12 +50,12 @@ Foam::trackedParticle::trackedParticle Foam::trackedParticle::trackedParticle ( - const Cloud& c, + const polyMesh& mesh, Istream& is, bool readFields ) : - Particle(c, is, readFields) + particle(mesh, is, readFields) { if (readFields) { @@ -89,7 +89,7 @@ Foam::trackedParticle::trackedParticle bool Foam::trackedParticle::move ( - trackedParticle::trackData& td, + trackingData& td, const scalar trackedParticle ) { @@ -120,7 +120,7 @@ bool Foam::trackedParticle::move bool Foam::trackedParticle::hitPatch ( const polyPatch&, - trackedParticle::trackData& td, + trackingData& td, const label patchI, const scalar trackFraction, const tetIndices& tetIs @@ -130,42 +130,10 @@ bool Foam::trackedParticle::hitPatch } -bool Foam::trackedParticle::hitPatch -( - const polyPatch&, - int&, - const label, - const scalar trackFraction, - const tetIndices& tetIs -) -{ - return false; -} - - void Foam::trackedParticle::hitWedgePatch ( const wedgePolyPatch&, - trackedParticle::trackData& td -) -{ - // Remove particle - td.keepParticle = false; -} - - -void Foam::trackedParticle::hitWedgePatch -( - const wedgePolyPatch&, - int& -) -{} - - -void Foam::trackedParticle::hitSymmetryPatch -( - const symmetryPolyPatch&, - trackedParticle::trackData& td + trackingData& td ) { // Remove particle @@ -176,15 +144,7 @@ void Foam::trackedParticle::hitSymmetryPatch void Foam::trackedParticle::hitSymmetryPatch ( const symmetryPolyPatch&, - int& -) -{} - - -void Foam::trackedParticle::hitCyclicPatch -( - const cyclicPolyPatch&, - trackedParticle::trackData& td + trackingData& td ) { // Remove particle @@ -195,15 +155,18 @@ void Foam::trackedParticle::hitCyclicPatch void Foam::trackedParticle::hitCyclicPatch ( const cyclicPolyPatch&, - int& + trackingData& td ) -{} +{ + // Remove particle + td.keepParticle = false; +} void Foam::trackedParticle::hitProcessorPatch ( const processorPolyPatch&, - trackedParticle::trackData& td + trackingData& td ) { // Remove particle @@ -211,18 +174,10 @@ void Foam::trackedParticle::hitProcessorPatch } -void Foam::trackedParticle::hitProcessorPatch -( - const processorPolyPatch&, - int& -) -{} - - void Foam::trackedParticle::hitWallPatch ( const wallPolyPatch& wpp, - trackedParticle::trackData& td, + trackingData& td, const tetIndices& ) { @@ -231,32 +186,15 @@ void Foam::trackedParticle::hitWallPatch } -void Foam::trackedParticle::hitWallPatch -( - const wallPolyPatch& wpp, - int&, - const tetIndices& -) -{} - - -void Foam::trackedParticle::hitPatch -( - const polyPatch& wpp, - trackedParticle::trackData& td -) -{ - // Remove particle - td.keepParticle = false; -} - - void Foam::trackedParticle::hitPatch ( const polyPatch& wpp, - int& + trackingData& td ) -{} +{ + // Remove particle + td.keepParticle = false; +} // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // @@ -265,7 +203,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p) { if (os.format() == IOstream::ASCII) { - os << static_cast&>(p) + os << static_cast(p) << token::SPACE << p.end_ << token::SPACE << p.level_ << token::SPACE << p.i_ @@ -273,7 +211,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p) } else { - os << static_cast&>(p); + os << static_cast(p); os.write ( reinterpret_cast(&p.end_), diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H index bfe0d9b385..256b056f0b 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticle.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,7 @@ SourceFiles #ifndef trackedParticle_H #define trackedParticle_H -#include "Particle.H" +#include "particle.H" #include "autoPtr.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,7 +52,7 @@ class trackedParticleCloud; class trackedParticle : - public Particle + public particle { // Private data @@ -74,35 +74,26 @@ public: friend class Cloud; //- Class used to pass tracking data to the trackToFace function - class trackData + class trackingData + : + public particle::TrackingData > { - //- Reference to the cloud containing this particle - Cloud& cloud_; - labelList& maxLevel_; public: - bool switchProcessor; - bool keepParticle; - // Constructors - trackData(Cloud& cloud, labelList& maxLevel) + trackingData(Cloud& cloud, labelList& maxLevel) : - cloud_(cloud), + particle::TrackingData >(cloud), maxLevel_(maxLevel) {} // Member functions - Cloud& cloud() - { - return cloud_; - } - labelList& maxLevel() { return maxLevel_; @@ -116,7 +107,7 @@ public: //- Construct from components trackedParticle ( - const Cloud& c, + const polyMesh& mesh, const vector& position, const label cellI, const label tetFaceI, @@ -130,20 +121,39 @@ public: //- Construct from Istream trackedParticle ( - const Cloud& c, + const polyMesh& mesh, Istream& is, bool readFields = true ); //- Construct and return a clone - autoPtr > clone() const + autoPtr clone() const { - return autoPtr > - ( - new trackedParticle(*this) - ); + return autoPtr(new trackedParticle(*this)); } + //- Factory class to read-construct particles used for + // parallel transfer + class iNew + { + const polyMesh& mesh_; + + public: + + iNew(const polyMesh& mesh) + : + mesh_(mesh) + {} + + autoPtr operator()(Istream& is) const + { + return autoPtr + ( + new trackedParticle(mesh_, is, true) + ); + } + }; + // Member Functions @@ -170,7 +180,7 @@ public: // Tracking //- Track all particles to their end point - bool move(trackData&, const scalar); + bool move(trackingData&, const scalar); //- Overridable function to handle the particle hitting a patch @@ -178,30 +188,17 @@ public: bool hitPatch ( const polyPatch&, - trackedParticle::trackData& td, + trackingData& td, const label patchI, const scalar trackFraction, const tetIndices& tetIs ); - bool hitPatch - ( - const polyPatch&, - int&, - const label patchI, - const scalar trackFraction, - const tetIndices& tetIs - ); //- Overridable function to handle the particle hitting a wedge void hitWedgePatch ( const wedgePolyPatch&, - trackedParticle::trackData& td - ); - void hitWedgePatch - ( - const wedgePolyPatch&, - int& + trackingData& td ); //- Overridable function to handle the particle hitting a @@ -209,24 +206,14 @@ public: void hitSymmetryPatch ( const symmetryPolyPatch&, - trackedParticle::trackData& td - ); - void hitSymmetryPatch - ( - const symmetryPolyPatch&, - int& + trackingData& td ); //- Overridable function to handle the particle hitting a cyclic void hitCyclicPatch ( const cyclicPolyPatch&, - trackedParticle::trackData& td - ); - void hitCyclicPatch - ( - const cyclicPolyPatch&, - int& + trackingData& td ); //- Overridable function to handle the particle hitting a @@ -234,25 +221,14 @@ public: void hitProcessorPatch ( const processorPolyPatch&, - trackedParticle::trackData& td - ); - void hitProcessorPatch - ( - const processorPolyPatch&, - int& + trackingData& td ); //- Overridable function to handle the particle hitting a wallPatch void hitWallPatch ( const wallPolyPatch&, - trackedParticle::trackData& td, - const tetIndices& - ); - void hitWallPatch - ( - const wallPolyPatch&, - int&, + trackingData& td, const tetIndices& ); @@ -260,20 +236,13 @@ public: void hitPatch ( const polyPatch&, - trackedParticle::trackData& td - ); - void hitPatch - ( - const polyPatch&, - int& + trackingData& td ); // Ostream Operator friend Ostream& operator<<(Ostream&, const trackedParticle&); - - }; diff --git a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticleCloud.C b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticleCloud.C index 36f91db57d..87f8f3b7a6 100644 --- a/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticleCloud.C +++ b/src/mesh/autoMesh/autoHexMesh/trackedParticle/trackedParticleCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,7 +33,7 @@ namespace Foam // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineParticleTypeNameAndDebug(trackedParticle, 0); +//defineParticleTypeNameAndDebug(trackedParticle, 0); defineTemplateTypeNameAndDebug(Cloud, 0); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/parallel/reconstruct/reconstruct/reconstructLagrangianPositions.C b/src/parallel/reconstruct/reconstruct/reconstructLagrangianPositions.C index 1e07fee604..2de2f3b0c8 100644 --- a/src/parallel/reconstruct/reconstruct/reconstructLagrangianPositions.C +++ b/src/parallel/reconstruct/reconstruct/reconstructLagrangianPositions.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,8 +25,7 @@ License #include "reconstructLagrangian.H" #include "labelIOList.H" -#include "Cloud.H" -#include "passiveParticle.H" +#include "passiveParticleCloud.H" // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // @@ -39,7 +38,7 @@ void Foam::reconstructLagrangianPositions const PtrList& cellProcAddressing ) { - Cloud lagrangianPositions + passiveParticleCloud lagrangianPositions ( mesh, cloudName, @@ -67,7 +66,7 @@ void Foam::reconstructLagrangianPositions ( new passiveParticle ( - lagrangianPositions, + mesh, ppi.position(), cellMap[ppi.cell()], false @@ -76,7 +75,7 @@ void Foam::reconstructLagrangianPositions } } - IOPosition(lagrangianPositions).write(); + IOPosition >(lagrangianPositions).write(); } diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLine.C b/src/postProcessing/functionObjects/field/streamLine/streamLine.C index 45c25fb61c..52dd5288af 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLine.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLine.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -61,7 +61,7 @@ void Foam::streamLine::track() ( new streamLineParticle ( - particles, + mesh, seedPoints[i], seedPoints.cells()[i], lifeTime_ // lifetime @@ -215,7 +215,7 @@ void Foam::streamLine::track() } // additional particle info - streamLineParticle::trackData td + streamLineParticle::trackingData td ( particles, vsInterp, diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C index 8b2127e995..f441b12bb7 100644 --- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C +++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C @@ -30,16 +30,15 @@ License namespace Foam { - defineParticleTypeNameAndDebug(streamLineParticle, 0); +// defineParticleTypeNameAndDebug(streamLineParticle, 0); } // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -// Estimate dt to cross cell in a few steps Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT ( - streamLineParticle::trackData& td, + trackingData& td, const scalar dt, const vector& U ) const @@ -58,7 +57,7 @@ Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT Foam::vector Foam::streamLineParticle::interpolateFields ( - const streamLineParticle::trackData& td, + const trackingData& td, const point& position, const label cellI ) @@ -103,29 +102,27 @@ Foam::vector Foam::streamLineParticle::interpolateFields // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -//- Construct from components Foam::streamLineParticle::streamLineParticle ( - const Cloud& c, + const polyMesh& mesh, const vector& position, const label cellI, const label lifeTime ) : - Particle(c, position, cellI), + particle(mesh, position, cellI), lifeTime_(lifeTime) {} -//- Construct from Istream Foam::streamLineParticle::streamLineParticle ( - const Cloud& c, + const polyMesh& mesh, Istream& is, bool readFields ) : - Particle(c, is, readFields) + particle(mesh, is, readFields) { if (readFields) { @@ -157,16 +154,15 @@ Foam::streamLineParticle::streamLineParticle } -// Construct copy Foam::streamLineParticle::streamLineParticle ( - const streamLineParticle& c + const streamLineParticle& p ) : - Particle(c), - lifeTime_(c.lifeTime_), - sampledPositions_(c.sampledPositions_), - sampledScalars_(c.sampledScalars_) + particle(p), + lifeTime_(p.lifeTime_), + sampledPositions_(p.sampledPositions_), + sampledScalars_(p.sampledScalars_) {} @@ -174,15 +170,17 @@ Foam::streamLineParticle::streamLineParticle bool Foam::streamLineParticle::move ( - streamLineParticle::trackData& td, + trackingData& td, const scalar trackTime ) { + streamLineParticle& p = static_cast(*this); + td.switchProcessor = false; td.keepParticle = true; scalar tEnd = (1.0 - stepFraction())*trackTime; - scalar maxDt = cloud_.pMesh().bounds().mag(); + scalar maxDt = mesh_.bounds().mag(); while ( @@ -266,8 +264,7 @@ bool Foam::streamLineParticle::move if (debug) { Pout<< "streamLineParticle : Removing stagnant particle:" - << static_cast >(*this) - << " sampled positions:" << sampledPositions_.size() + << p << " sampled positions:" << sampledPositions_.size() << endl; } td.keepParticle = false; @@ -281,13 +278,12 @@ bool Foam::streamLineParticle::move if (debug) { Pout<< "streamLineParticle : Removing particle:" - << static_cast >(*this) - << " sampled positions:" << sampledPositions_.size() + << p << " sampled positions:" << sampledPositions_.size() << endl; } } - // Transfer particle data into trackData. + // Transfer particle data into trackingData. //td.allPositions_.append(sampledPositions_); td.allPositions_.append(vectorList()); vectorList& top = td.allPositions_.last(); @@ -316,7 +312,7 @@ bool Foam::streamLineParticle::move bool Foam::streamLineParticle::hitPatch ( const polyPatch&, - streamLineParticle::trackData& td, + trackingData& td, const label patchI, const scalar trackFraction, const tetIndices& tetIs @@ -327,24 +323,10 @@ bool Foam::streamLineParticle::hitPatch } -bool Foam::streamLineParticle::hitPatch -( - const polyPatch&, - int&, - const label, - const scalar, - const tetIndices& -) -{ - // Disable generic patch interaction - return false; -} - - void Foam::streamLineParticle::hitWedgePatch ( const wedgePolyPatch& pp, - streamLineParticle::trackData& td + trackingData& td ) { // Remove particle @@ -352,18 +334,10 @@ void Foam::streamLineParticle::hitWedgePatch } -void Foam::streamLineParticle::hitWedgePatch -( - const wedgePolyPatch&, - int& -) -{} - - void Foam::streamLineParticle::hitSymmetryPatch ( const symmetryPolyPatch& pp, - streamLineParticle::trackData& td + trackingData& td ) { // Remove particle @@ -371,18 +345,10 @@ void Foam::streamLineParticle::hitSymmetryPatch } -void Foam::streamLineParticle::hitSymmetryPatch -( - const symmetryPolyPatch&, - int& -) -{} - - void Foam::streamLineParticle::hitCyclicPatch ( const cyclicPolyPatch& pp, - streamLineParticle::trackData& td + trackingData& td ) { // Remove particle @@ -390,18 +356,10 @@ void Foam::streamLineParticle::hitCyclicPatch } -void Foam::streamLineParticle::hitCyclicPatch -( - const cyclicPolyPatch&, - int& -) -{} - - void Foam::streamLineParticle::hitProcessorPatch ( const processorPolyPatch&, - streamLineParticle::trackData& td + trackingData& td ) { // Switch particle @@ -409,18 +367,10 @@ void Foam::streamLineParticle::hitProcessorPatch } -void Foam::streamLineParticle::hitProcessorPatch -( - const processorPolyPatch&, - int& -) -{} - - void Foam::streamLineParticle::hitWallPatch ( const wallPolyPatch& wpp, - streamLineParticle::trackData& td, + trackingData& td, const tetIndices& ) { @@ -429,32 +379,15 @@ void Foam::streamLineParticle::hitWallPatch } -void Foam::streamLineParticle::hitWallPatch -( - const wallPolyPatch& wpp, - int&, - const tetIndices& -) -{} - - -void Foam::streamLineParticle::hitPatch -( - const polyPatch& wpp, - streamLineParticle::trackData& td -) -{ - // Remove particle - td.keepParticle = false; -} - - void Foam::streamLineParticle::hitPatch ( const polyPatch& wpp, - int& + trackingData& td ) -{} +{ + // Remove particle + td.keepParticle = false; +} void Foam::streamLineParticle::readFields(Cloud& c) @@ -464,6 +397,8 @@ void Foam::streamLineParticle::readFields(Cloud& c) return; } + particle::readFields(c); + IOField