passiveParticle.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  Foam::passiveParticle
26 
27 Description
28  Copy of base particle
29 
30 SourceFiles
31  passiveParticle.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef passiveParticle_H
36 #define passiveParticle_H
37 
38 #include "particle.H"
39 #include "IOstream.H"
40 #include "autoPtr.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class passiveParticle Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class passiveParticle
52 :
53  public particle
54 {
55 
56 public:
57 
58  // Constructors
59 
60  //- Construct from components
62  (
63  const polyMesh& mesh,
64  const vector& position,
65  const label cellI,
66  const label tetFaceI,
67  const label tetPtI
68  )
69  :
70  particle(mesh, position, cellI, tetFaceI, tetPtI)
71  {}
72 
73  //- Construct from components, with searching for tetFace and
74  // tetPt unless disabled by doCellFacePt = false.
76  (
77  const polyMesh& mesh,
78  const vector& position,
79  const label cellI,
80  bool doCellFacePt = true
81  )
82  :
83  particle(mesh, position, cellI, doCellFacePt)
84  {}
85 
86  //- Construct from Istream
88  (
89  const polyMesh& mesh,
90  Istream& is,
91  bool readFields = true
92  )
93  :
94  particle(mesh, is, readFields)
95  {}
96 
97  //- Construct as copy
99  :
100  particle(p)
101  {}
102 
103  //- Construct and return a clone
104  virtual autoPtr<particle> clone() const
105  {
106  return autoPtr<particle>(new passiveParticle(*this));
107  }
108 };
109 
110 
111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112 
113 } // End namespace Foam
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 #endif
118 
119 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
virtual autoPtr< particle > clone() const
Construct and return a clone.
Namespace for OpenFOAM.
volScalarField & p
Definition: createFields.H:51
Base particle class.
Definition: particle.H:78
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:102
passiveParticle(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from components.
Copy of base particle.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117