1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
11 OpenFOAM is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Particle class that marks cells it passes through. Used to mark cells
29 visited by feature edges.
34 \*---------------------------------------------------------------------------*/
36 #ifndef trackedParticle_H
37 #define trackedParticle_H
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 class trackedParticleCloud;
49 /*---------------------------------------------------------------------------*\
50 Class trackedParticle Declaration
51 \*---------------------------------------------------------------------------*/
59 //- end point to track to
62 //- level of this particle
74 friend class Cloud<trackedParticle>;
76 //- Class used to pass tracking data to the trackToFace function
79 public particle::TrackingData<Cloud<trackedParticle> >
88 trackingData(Cloud<trackedParticle>& cloud, labelList& maxLevel)
90 particle::TrackingData<Cloud<trackedParticle> >(cloud),
107 //- Construct from components
110 const polyMesh& mesh,
111 const vector& position,
113 const label tetFaceI,
121 //- Construct from Istream
124 const polyMesh& mesh,
126 bool readFields = true
129 //- Construct and return a clone
130 autoPtr<particle> clone() const
132 return autoPtr<particle>(new trackedParticle(*this));
135 //- Factory class to read-construct particles used for
139 const polyMesh& mesh_;
143 iNew(const polyMesh& mesh)
148 autoPtr<trackedParticle> operator()(Istream& is) const
150 return autoPtr<trackedParticle>
152 new trackedParticle(mesh_, is, true)
160 //- point to track to
166 //- transported label
172 //- transported label
182 //- Track all particles to their end point
183 bool move(trackingData&, const scalar);
186 //- Overridable function to handle the particle hitting a patch
187 // Executed before other patch-hitting functions
193 const scalar trackFraction,
194 const tetIndices& tetIs
197 //- Overridable function to handle the particle hitting a wedge
200 const wedgePolyPatch&,
204 //- Overridable function to handle the particle hitting a
206 void hitSymmetryPatch
208 const symmetryPolyPatch&,
212 //- Overridable function to handle the particle hitting a cyclic
215 const cyclicPolyPatch&,
219 //- Overridable function to handle the particle hitting a
221 void hitProcessorPatch
223 const processorPolyPatch&,
227 //- Overridable function to handle the particle hitting a wallPatch
230 const wallPolyPatch&,
235 //- Overridable function to handle the particle hitting a polyPatch
245 friend Ostream& operator<<(Ostream&, const trackedParticle&);
250 inline bool contiguous<trackedParticle>()
256 //void Cloud<trackedParticle>::readFields();
259 //void Cloud<trackedParticle>::writeFields() const;
262 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
264 } // End namespace Foam
266 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
270 // ************************************************************************* //