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-2014 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  :
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  //- Factory class to read-construct particles used for
111  // parallel transfer
112  class iNew
113  {
114  const polyMesh& mesh_;
115 
116  public:
117 
118  iNew(const polyMesh& mesh)
119  :
120  mesh_(mesh)
121  {}
122 
124  {
126  (
127  new passiveParticle(mesh_, is, true)
128  );
129  }
130  };
131 
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
Foam::passiveParticle::clone
virtual autoPtr< particle > clone() const
Construct and return a clone.
Definition: passiveParticle.H:103
p
p
Definition: pEqn.H:62
Foam::passiveParticle
Copy of base particle.
Definition: passiveParticle.H:50
Foam::readFields
This function object reads fields from the time directories and adds them to the mesh database for fu...
Definition: readFields.H:104
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::label
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
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:57
IOstream.H
Foam::particle::mesh
const polyMesh & mesh() const
Return the mesh database.
Definition: particleI.H:580
Foam::passiveParticle::iNew::iNew
iNew(const polyMesh &mesh)
Definition: passiveParticle.H:117
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::particle::particle
particle(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from components.
Definition: particle.C:48
Foam::passiveParticle::iNew::operator()
autoPtr< passiveParticle > operator()(Istream &is) const
Definition: passiveParticle.H:122
Foam::passiveParticle::iNew::mesh_
const polyMesh & mesh_
Definition: passiveParticle.H:113
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::passiveParticle::passiveParticle
passiveParticle(const polyMesh &mesh, const vector &position, const label cellI, const label tetFaceI, const label tetPtI)
Construct from components.
Definition: passiveParticle.H:61
Foam::Vector< scalar >
Foam::particle
Base particle class.
Definition: particle.H:78
Foam::particle::position
const vector & position() const
Return current particle position.
Definition: particleI.H:586
particle.H
Foam::passiveParticle::iNew
Factory class to read-construct particles used for.
Definition: passiveParticle.H:111
Foam::passiveParticle::passiveParticle
passiveParticle(const passiveParticle &p)
Construct as copy.
Definition: passiveParticle.H:97
autoPtr.H