diff --git a/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C b/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C index 761ca5b44718a454bef04a01da36cf1376c43283..7cd8fb9dd2120de505040ab6afe713005d95a200 100644 --- a/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C +++ b/src/autoMesh/autoHexMesh/trackedParticle/trackedParticle.C @@ -56,7 +56,7 @@ Foam::trackedParticle::trackedParticle bool readFields ) : - ExactParticle<trackedParticle>(c, is) + ExactParticle<trackedParticle>(c, is, readFields) { if (readFields) { diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index 72e1b1f81824bc0ec1e1774d9e50ad051bbc4e61..e3e0b4f63f5e2576150a1eea6fe3c1c69251f8ec 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -42,15 +42,12 @@ Foam::Cloud<ParticleType>::Cloud ) : cloud(pMesh), - IDLList<ParticleType>(particles), + IDLList<ParticleType>(), polyMesh_(pMesh), - allFaces_(pMesh.faces()), - points_(pMesh.points()), - cellFaces_(pMesh.cells()), - allFaceCentres_(pMesh.faceCentres()), - owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()) -{} + particleCount_(0) +{ + IDLList<ParticleType>::operator=(particles); +} template<class ParticleType> @@ -62,19 +59,31 @@ Foam::Cloud<ParticleType>::Cloud ) : cloud(pMesh, cloudName), - IDLList<ParticleType>(particles), + IDLList<ParticleType>(), polyMesh_(pMesh), - allFaces_(pMesh.faces()), - points_(pMesh.points()), - cellFaces_(pMesh.cells()), - allFaceCentres_(pMesh.faceCentres()), - owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()) -{} + particleCount_(0) +{ + IDLList<ParticleType>::operator=(particles); +} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +template<class ParticleType> +Foam::label Foam::Cloud<ParticleType>::getNewParticleID() const +{ + label id = particleCount_++; + + if (id == labelMax) + { + WarningIn("Cloud<ParticleType>::getNewParticleID() const") + << "Particle counter has overflowed. This might cause problems" + << " when reconstructing particle tracks." << endl; + } + return id; +} + + template<class ParticleType> void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr) { diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index e298affe7d2ce5651ce34015672c8f45688d858e..626042e68ac7e1a537daf4229b4fbc650964f802 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -50,6 +50,9 @@ namespace Foam template<class ParticleType> class Cloud; +template<class ParticleType> +class IOPosition; + template<class ParticleType> Ostream& operator<< ( @@ -71,12 +74,9 @@ class Cloud // Private data const polyMesh& polyMesh_; - const faceList& allFaces_; - const vectorField& points_; - const cellList& cellFaces_; - const vectorField& allFaceCentres_; - const unallocLabelList& owner_; - const unallocLabelList& neighbour_; + + //- Overall count of particles ever created. Never decreases. + mutable label particleCount_; //- Temporary storage for addressing. Used in findFaces. mutable DynamicList<label> labels_; @@ -92,6 +92,8 @@ public: template<class ParticleT> friend class Particle; + template<class ParticleT> + friend class IOPosition; typedef ParticleType particleType; @@ -218,6 +220,9 @@ public: return IDLList<ParticleType>::clear(); }; + //- Get unique particle creation id + label getNewParticleID() const; + //- Transfer particle to cloud void addParticle(ParticleType* pPtr); @@ -251,13 +256,15 @@ public: const IOField<DataType>& data ) const; - //- Read the field data for the cloud of particles - void readFields(); + //- Read the field data for the cloud of particles. Dummy at + // this level. + virtual void readFields(); // Write - //- Write the field data for the cloud of particles + //- Write the field data for the cloud of particles Dummy at + // this level. virtual void writeFields() const; //- Write using given format, version and compression. diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index 42c1a9317a2a8d2d46930fe3245f840f8bb051c1..c1e4b30f808a9f8015f07e57bf3eb1ceaaa61b7d 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -67,12 +67,7 @@ Foam::Cloud<ParticleType>::Cloud : cloud(pMesh), polyMesh_(pMesh), - allFaces_(pMesh.faces()), - points_(pMesh.points()), - cellFaces_(pMesh.cells()), - allFaceCentres_(pMesh.faceCentres()), - owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()) + particleCount_(0) { initCloud(checkClass); } @@ -88,12 +83,7 @@ Foam::Cloud<ParticleType>::Cloud : cloud(pMesh, cloudName), polyMesh_(pMesh), - allFaces_(pMesh.faces()), - points_(pMesh.points()), - cellFaces_(pMesh.cells()), - allFaceCentres_(pMesh.faceCentres()), - owner_(pMesh.faceOwner()), - neighbour_(pMesh.faceNeighbour()) + particleCount_(0) { initCloud(checkClass); } diff --git a/src/lagrangian/basic/IOPosition/IOPosition.C b/src/lagrangian/basic/IOPosition/IOPosition.C index 810a9fbcf55f463efb7a07abb3eb879630ada3f2..5f12742d8c214df4cf8937a4486375e62512fe29 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.C +++ b/src/lagrangian/basic/IOPosition/IOPosition.C @@ -34,6 +34,7 @@ Foam::word Foam::IOPosition<ParticleType>::particlePropertiesName "particleProperties" ); + // * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * * // template<class ParticleType> @@ -58,7 +59,7 @@ void Foam::IOPosition<ParticleType>::readParticleProperties() if (propsDict.found(procName)) { propsDict.subDict(procName).lookup("particleCount") - >> Particle<ParticleType>::particleCount; + >> cloud_.particleCount_; } } } @@ -83,11 +84,7 @@ void Foam::IOPosition<ParticleType>::writeParticleProperties() const word procName("processor" + Foam::name(Pstream::myProcNo())); propsDict.add(procName, dictionary()); - propsDict.subDict(procName).add - ( - "particleCount", - Particle<ParticleType>::particleCount - ); + propsDict.subDict(procName).add("particleCount", cloud_.particleCount_); propsDict.regIOobject::write(); } @@ -135,13 +132,20 @@ bool Foam::IOPosition<ParticleType>::write() const template<class ParticleType> bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const { + // Write global cloud data writeParticleProperties(); os<< cloud_.size() << nl << token::BEGIN_LIST << nl; forAllConstIter(typename Cloud<ParticleType>, cloud_, iter) { - os<< static_cast<const Particle<ParticleType>&>(iter()) << nl; + // Prevent writing additional fields + static_cast<const Particle<ParticleType>&>(iter()).write + ( + os, + false + ); + os << nl; } os<< token::END_LIST << endl; @@ -157,6 +161,7 @@ void Foam::IOPosition<ParticleType>::readData bool checkClass ) { + // Read global cloud data. Resets count on cloud. readParticleProperties(); Istream& is = readStream(checkClass ? typeName : ""); @@ -172,6 +177,7 @@ void Foam::IOPosition<ParticleType>::readData for (label i=0; i<s; i++) { + // Do not read any fields, position only c.append(new ParticleType(c, is, false)); } @@ -202,6 +208,7 @@ void Foam::IOPosition<ParticleType>::readData ) { is.putBack(lastToken); + // Do not read any fields, position only c.append(new ParticleType(c, is, false)); is >> lastToken; } diff --git a/src/lagrangian/basic/IOPosition/IOPosition.H b/src/lagrangian/basic/IOPosition/IOPosition.H index 069dc0135df4339dbc0cb4ee1c5063865a40ef4e..982416fdc8ff8bddc998e745fb920523cdda6735 100644 --- a/src/lagrangian/basic/IOPosition/IOPosition.H +++ b/src/lagrangian/basic/IOPosition/IOPosition.H @@ -26,7 +26,7 @@ Class Foam::IOPosition Description - Helper IO class to write particle positions + Helper IO class to read and write particle positions SourceFiles IOPosition.C @@ -72,7 +72,7 @@ public: // Static data - //- Runtime type name information + //- Runtime type name information. Use cloud type. virtual const word& type() const { return cloud_.type(); @@ -90,11 +90,11 @@ public: // Member functions - void readData(Cloud<ParticleType>& c, bool checkClass); + virtual void readData(Cloud<ParticleType>& c, bool checkClass); - bool write() const; + virtual bool write() const; - bool writeData(Ostream& os) const; + virtual bool writeData(Ostream& os) const; }; diff --git a/src/lagrangian/basic/Particle/Particle.C b/src/lagrangian/basic/Particle/Particle.C index 0658e4947f53d667904d417b55593ee412448918..4838da0ad1d1dc6bd56ee90ca0e79fdb8f24e86b 100644 --- a/src/lagrangian/basic/Particle/Particle.C +++ b/src/lagrangian/basic/Particle/Particle.C @@ -33,12 +33,6 @@ License #include "wallPolyPatch.H" #include "transform.H" -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -template<class ParticleType> -Foam::label Foam::Particle<ParticleType>::particleCount = 0; - - // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template<class ParticleType> @@ -184,7 +178,7 @@ Foam::Particle<ParticleType>::Particle facei_(-1), stepFraction_(0.0), origProc_(Pstream::myProcNo()), - origId_(particleCount++) + origId_(cloud_.getNewParticleID()) {} @@ -313,13 +307,13 @@ Foam::scalar Foam::Particle<ParticleType>::trackToFace // change cell if (internalFace) // Internal face { - if (celli_ == cloud_.owner_[facei_]) + if (celli_ == mesh.faceOwner()[facei_]) { - celli_ = cloud_.neighbour_[facei_]; + celli_ = mesh.faceNeighbour()[facei_]; } - else if (celli_ == cloud_.neighbour_[facei_]) + else if (celli_ == mesh.faceNeighbour()[facei_]) { - celli_ = cloud_.owner_[facei_]; + celli_ = mesh.faceOwner()[facei_]; } else { diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H index 71011d72a460ce3a9490d2e284b233a0bd868040..a1077a604e45d7fcf2e2947eb9fa0ca3a34e1297 100644 --- a/src/lagrangian/basic/Particle/Particle.H +++ b/src/lagrangian/basic/Particle/Particle.H @@ -279,9 +279,6 @@ public: //- String representation of properties static string propHeader; - //- Cumulative particle count used for particle id - static label particleCount; - // Constructors @@ -330,7 +327,15 @@ public: autoPtr<ParticleType> operator()(Istream& is) const { - return autoPtr<ParticleType>(new ParticleType(cloud_, is)); + return autoPtr<ParticleType> + ( + new ParticleType + ( + cloud_, + is, + true + ) + ); } }; @@ -454,9 +459,14 @@ public: // I-O + //- Read the fields associated with the owner cloud + static void readFields(Cloud<ParticleType>& c); + //- Write the fields associated with the owner cloud static void writeFields(const Cloud<ParticleType>& c); + //- Write the particle data + void write(Ostream& os, bool writeFields) const; // Ostream Operator diff --git a/src/lagrangian/basic/Particle/ParticleIO.C b/src/lagrangian/basic/Particle/ParticleIO.C index 5865cf5098a81180d64c2c30b0a1f03d9e725b27..77774cf90b7c70a938e81d49b420d208af695aa3 100644 --- a/src/lagrangian/basic/Particle/ParticleIO.C +++ b/src/lagrangian/basic/Particle/ParticleIO.C @@ -50,23 +50,49 @@ Foam::Particle<ParticleType>::Particle origProc_(Pstream::myProcNo()), origId_(-1) { + + // readFields : read additional data. Should be consistent with writeFields. + if (is.format() == IOstream::ASCII) { - is >> position_ >> celli_ >> origProc_ >> origId_; + is >> position_ >> celli_; + if (readFields) + { + is >> origProc_ >> origId_; + } + else + { + origId_ = cloud_.getNewParticleID(); + } } else { // In binary read all particle data - needed for parallel transfer - is.read - ( - reinterpret_cast<char*>(&position_), - sizeof(position_) - + sizeof(celli_) - + sizeof(facei_) - + sizeof(stepFraction_) - + sizeof(origProc_) - + sizeof(origId_) - ); + if (readFields) + { + is.read + ( + reinterpret_cast<char*>(&position_), + sizeof(position_) + + sizeof(celli_) + + sizeof(facei_) + + sizeof(stepFraction_) + + sizeof(origProc_) + + sizeof(origId_) + ); + } + else + { + is.read + ( + reinterpret_cast<char*>(&position_), + sizeof(position_) + + sizeof(celli_) + + sizeof(facei_) + + sizeof(stepFraction_) + ); + origId_ = cloud_.getNewParticleID(); + } } if (celli_ == -1) @@ -79,6 +105,38 @@ Foam::Particle<ParticleType>::Particle } +template<class ParticleType> +void Foam::Particle<ParticleType>::readFields +( + Cloud<ParticleType>& c +) +{ + if (!c.size()) + { + return; + } + + IOobject procIO(c.fieldIOobject("origProcId", IOobject::MUST_READ)); + if (procIO.headerOk()) + { + IOField<label> origProcId(procIO); + c.checkFieldIOobject(c, origProcId); + IOField<label> origId(c.fieldIOobject("origId", IOobject::MUST_READ)); + c.checkFieldIOobject(c, origId); + + label i = 0; + forAllIter(typename Cloud<ParticleType>, c, iter) + { + ParticleType& p = iter(); + + p.origProc_ = origProcId[i]; + p.origId_ = origId[i]; + i++; + } + } +} + + template<class ParticleType> void Foam::Particle<ParticleType>::writeFields ( @@ -88,36 +146,91 @@ void Foam::Particle<ParticleType>::writeFields // Write the cloud position file IOPosition<ParticleType> ioP(c); ioP.write(); + + label np = c.size(); + + IOField<label> origProc + ( + c.fieldIOobject + ( + "origProcId", + IOobject::NO_READ + ), + np + ); + IOField<label> origId(c.fieldIOobject("origId", IOobject::NO_READ), np); + + label i = 0; + forAllConstIter(typename Cloud<ParticleType>, c, iter) + { + origProc[i] = iter().origProc_; + origId[i] = iter().origId_; + i++; + } + + origProc.write(); + origId.write(); } template<class ParticleType> -Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p) +void Foam::Particle<ParticleType>::write(Ostream& os, bool writeFields) const { if (os.format() == IOstream::ASCII) { - os << p.position_ - << token::SPACE << p.celli_ - << token::SPACE << p.origProc_ - << token::SPACE << p.origId_; + if (writeFields) + { + // Write the additional entries + os << position_ + << token::SPACE << celli_ + << token::SPACE << origProc_ + << token::SPACE << origId_; + } + else + { + os << position_ + << token::SPACE << celli_; + } } else { // In binary write both celli_ and facei_, needed for parallel transfer - os.write - ( - reinterpret_cast<const char*>(&p.position_), - sizeof(p.position_) - + sizeof(p.celli_) - + sizeof(p.facei_) - + sizeof(p.stepFraction_) - + sizeof(p.origProc_) - + sizeof(p.origId_) - ); + if (writeFields) + { + os.write + ( + reinterpret_cast<const char*>(&position_), + sizeof(position_) + + sizeof(celli_) + + sizeof(facei_) + + sizeof(stepFraction_) + + sizeof(origProc_) + + sizeof(origId_) + ); + } + else + { + os.write + ( + reinterpret_cast<const char*>(&position_), + sizeof(position_) + + sizeof(celli_) + + sizeof(facei_) + + sizeof(stepFraction_) + ); + } } // Check state of Ostream - os.check("Ostream& operator<<(Ostream&, const Particle<ParticleType>&)"); + os.check("Particle<ParticleType>::write(Ostream& os, bool) const"); +} + + +template<class ParticleType> +Foam::Ostream& Foam::operator<<(Ostream& os, const Particle<ParticleType>& p) +{ + // Write all data + p.write(os, true); return os; } diff --git a/src/lagrangian/basic/indexedParticle/indexedParticle.H b/src/lagrangian/basic/indexedParticle/indexedParticle.H index fd20681a32c4fc733259461ecafd4a98754a7a58..7023f0ba6d43604b9d6b5341eb9d0d32d16fe643 100644 --- a/src/lagrangian/basic/indexedParticle/indexedParticle.H +++ b/src/lagrangian/basic/indexedParticle/indexedParticle.H @@ -84,7 +84,7 @@ public: bool readFields = true ) : - Particle<indexedParticle>(c, is) + Particle<indexedParticle>(c, is, readFields) {} //- Construct as a copy diff --git a/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C b/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C index 52cf785b91b831cfe227ac0883dd9af1e37ea3f7..422661f76a70a90b7872865cfde832a5e8792262 100644 --- a/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C +++ b/src/lagrangian/basic/indexedParticle/indexedParticleCloud.C @@ -22,12 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ -#include "indexedParticle.H" -#include "Cloud.H" +#include "indexedParticleCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,4 +40,23 @@ defineTemplateTypeNameAndDebug(Cloud<indexedParticle>, 0); } // End namespace Foam +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::indexedParticleCloud::indexedParticleCloud +( + const polyMesh& mesh, + const word& cloudName +) +: + Cloud<indexedParticle>(mesh, cloudName, false) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::indexedParticleCloud::writeFields() const +{ + indexedParticle::writeFields(*this); +} + // ************************************************************************* // diff --git a/src/lagrangian/basic/indexedParticle/indexedParticleCloud.H b/src/lagrangian/basic/indexedParticle/indexedParticleCloud.H new file mode 100644 index 0000000000000000000000000000000000000000..65033e0a9dad0ec24b37f1f83f8e299457ab3694 --- /dev/null +++ b/src/lagrangian/basic/indexedParticle/indexedParticleCloud.H @@ -0,0 +1,91 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::indexedParticleCloud + +Description + A Cloud of particles carrying an additional index. + +SourceFiles + indexedParticleCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef indexedParticleCloud_H +#define indexedParticleCloud_H + +#include "Cloud.H" +#include "indexedParticle.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class indexedParticleCloud Declaration +\*---------------------------------------------------------------------------*/ + +class indexedParticleCloud +: + public Cloud<indexedParticle> +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + indexedParticleCloud(const indexedParticleCloud&); + + //- Disallow default bitwise assignment + void operator=(const indexedParticleCloud&); + + +public: + + // Constructors + + //- Construct given mesh + indexedParticleCloud + ( + const polyMesh&, + const word& cloudName = "defaultCloud" + ); + + + // Member Functions + + //- Write fields + virtual void writeFields() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/basic/passiveParticle/passiveParticle.H b/src/lagrangian/basic/passiveParticle/passiveParticle.H index ce4f7bfcadabca2e009eef09def797539dcf702f..c8d912ac76b77f85ffb71ea5f2405552dbb492c5 100644 --- a/src/lagrangian/basic/passiveParticle/passiveParticle.H +++ b/src/lagrangian/basic/passiveParticle/passiveParticle.H @@ -28,9 +28,6 @@ Class Description SourceFiles - passiveParticleI.H - passiveParticle.C - passiveParticleIO.C \*---------------------------------------------------------------------------*/ @@ -78,7 +75,7 @@ public: bool readFields = true ) : - Particle<passiveParticle>(c, is) + Particle<passiveParticle>(c, is, readFields) {} //- Construct as copy diff --git a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C index 71af5dd82be298565291adce4639aabdce09ef0c..e60b691c1f024c8b53c7e0e5d0fa24a81a12bb06 100644 --- a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C +++ b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C @@ -22,12 +22,9 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -Description - \*---------------------------------------------------------------------------*/ -#include "passiveParticle.H" -#include "Cloud.H" +#include "passiveParticleCloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -39,8 +36,32 @@ namespace Foam defineParticleTypeNameAndDebug(passiveParticle, 0); defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0); -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +}; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::passiveParticleCloud::passiveParticleCloud +( + const polyMesh& mesh, + const word& cloudName +) +: + Cloud<passiveParticle>(mesh, cloudName, false) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::passiveParticleCloud::readFields() +{ + passiveParticle::readFields(*this); +} + + +void Foam::passiveParticleCloud::writeFields() const +{ + passiveParticle::writeFields(*this); +} -} // End namespace Foam // ************************************************************************* // diff --git a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.H b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.H new file mode 100644 index 0000000000000000000000000000000000000000..b8faac8f439c9bd4754b2c7d5c8189dba7f70268 --- /dev/null +++ b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.H @@ -0,0 +1,94 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::passiveParticleCloud + +Description + A Cloud of passive particles + +SourceFiles + passiveParticleCloud.C + +\*---------------------------------------------------------------------------*/ + +#ifndef passiveParticleCloud_H +#define passiveParticleCloud_H + +#include "Cloud.H" +#include "passiveParticle.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class passiveParticleCloud Declaration +\*---------------------------------------------------------------------------*/ + +class passiveParticleCloud +: + public Cloud<passiveParticle> +{ + // Private Member Functions + + //- Disallow default bitwise copy construct + passiveParticleCloud(const passiveParticleCloud&); + + //- Disallow default bitwise assignment + void operator=(const passiveParticleCloud&); + + +public: + + // Constructors + + //- Construct given mesh + passiveParticleCloud + ( + const polyMesh&, + const word& cloudName = "defaultCloud" + ); + + + // Member Functions + + //- Read fields + virtual void readFields(); + + //- Write fields + virtual void writeFields() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H index 36e3b4e03ee7e5d4e4875604c254c8fbf1b22416..d4d6c2bc94d997ade9ef37fab7b48c837bfc30f8 100644 --- a/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H +++ b/src/lagrangian/coalCombustion/CoalCloud/CoalCloud.H @@ -87,7 +87,7 @@ public: // Member Functions //- Write fields - void writeFields() const; + virtual void writeFields() const; }; diff --git a/src/lagrangian/coalCombustion/Make/files b/src/lagrangian/coalCombustion/Make/files old mode 100755 new mode 100644 diff --git a/src/lagrangian/coalCombustion/Make/options b/src/lagrangian/coalCombustion/Make/options old mode 100755 new mode 100644 diff --git a/src/lagrangian/dieselSpray/parcel/parcelIO.C b/src/lagrangian/dieselSpray/parcel/parcelIO.C index d84f2bb195c27b41588df1a99a4a7c27a72a431a..4ae7bbc90ad6befee259df34c77ff20ef41ee403 100644 --- a/src/lagrangian/dieselSpray/parcel/parcelIO.C +++ b/src/lagrangian/dieselSpray/parcel/parcelIO.C @@ -36,7 +36,7 @@ Foam::parcel::parcel bool readFields ) : - Particle<parcel>(cloud, is), + Particle<parcel>(cloud, is, readFields), liquidComponents_ ( diff --git a/src/lagrangian/dieselSpray/spray/spray.H b/src/lagrangian/dieselSpray/spray/spray.H index f416e3cf4ea2f175588fa9c95d3633494f996420..044423fc752ecbfa5b353c1f687b1be392419312 100644 --- a/src/lagrangian/dieselSpray/spray/spray.H +++ b/src/lagrangian/dieselSpray/spray/spray.H @@ -345,7 +345,7 @@ public: // I/O //- Write fields - void writeFields() const; + virtual void writeFields() const; }; diff --git a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H index d5302056816419ee1deca073f94c13024bc52e8c..ad63aca9fcaef68e5278f5e02d7563120220a079 100644 --- a/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H +++ b/src/lagrangian/dsmc/clouds/derived/dsmcCloud/dsmcCloud.H @@ -91,7 +91,7 @@ public: // Member functions //- Write fields - void writeFields() const; + virtual void writeFields() const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index c07a3a34fa18d5899c101a5a4d626f54cffafa73..791138314619b734da0035075f4bdf801ffd71a4 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -59,6 +59,7 @@ submodels/addOns/radiation/scatter/cloudScatter/cloudScatter.C /* data entries */ submodels/IO/DataEntry/makeDataEntries.C submodels/IO/DataEntry/polynomial/polynomial.C +submodels/IO/DataEntry/polynomial/polynomialIO.C /* integration schemes */ diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H index 49a51a230e11e72d0e413366a0a0759e30ab2a1d..0dea7344a6656abfd275f4001a81ed05c5a3c8b0 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H @@ -92,7 +92,7 @@ public: // Member Functions //- Write fields - void writeFields() const; + virtual void writeFields() const; }; diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H index ac0853823fce7f97dc2ca15c2afa5bd7520b44af..11b6fb237873433fd102c1976eb19746246bfa82 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H @@ -92,7 +92,7 @@ public: // Member Functions //- Write fields - void writeFields() const; + virtual void writeFields() const; }; diff --git a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H index 91a8ae2e5bd3134782f46fa7aa41101d48806bc5..9b2c6003d318c1c413a986aed963c4ee6946ea4c 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicKinematicCloud/basicKinematicCloud.H @@ -87,7 +87,7 @@ public: // Member functions //- Write fields - void writeFields() const; + virtual void writeFields() const; }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H index 5254fed8ebb2dcb2e6160372e1ab6a1a2f5f74bb..cbe3695d5d42f44aea195f5e4c1e67978ffe030b 100644 --- a/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicThermoCloud/basicThermoCloud.H @@ -90,7 +90,7 @@ public: // Member Functions //- Write fields - void writeFields() const; + virtual void writeFields() const; }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index fa48f4c28b3c2cc6f3daf4acfca711511432aedc..7c63f1c26247550d6bc388c3a6a229b513bbde9d 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -233,7 +233,8 @@ void Foam::InjectionModel<CloudType>::postInjectCheck(const label parcelsAdded) { if (parcelsAdded > 0) { - Pout<< "\n--> Cloud: " << owner_.name() << nl + Pout<< nl + << "--> Cloud: " << owner_.name() << nl << " Added " << parcelsAdded << " new parcels" << nl << endl; } diff --git a/src/lagrangian/molecularDynamics/molecule/Make/files b/src/lagrangian/molecularDynamics/molecule/Make/files old mode 100755 new mode 100644 diff --git a/src/lagrangian/molecularDynamics/molecule/Make/options b/src/lagrangian/molecularDynamics/molecule/Make/options old mode 100755 new mode 100644 diff --git a/src/lagrangian/solidParticle/solidParticleCloud.H b/src/lagrangian/solidParticle/solidParticleCloud.H index 078594592d995164e62a5027cdb2fd1049e232e4..f171007ce35311aa54cee38788c642d71a3d8f58 100644 --- a/src/lagrangian/solidParticle/solidParticleCloud.H +++ b/src/lagrangian/solidParticle/solidParticleCloud.H @@ -108,10 +108,10 @@ public: void move(const dimensionedVector& g); - // I-O + // Write //- Write fields - void writeFields() const; + virtual void writeFields() const; };