passiveParticle.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2022 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 barycentric& coordinates,
65  const label celli,
66  const label tetFacei,
67  const label tetPti
68  )
69  :
70  particle(mesh, coordinates, celli, tetFacei, tetPti, -1)
71  {}
72 
73 
74  //- Construct from a position and a cell, searching for the rest of the
75  // required topology
77  (
78  const polyMesh& mesh,
79  const vector& position,
80  const label celli
81  )
82  :
83  particle(mesh, position, celli)
84  {}
85 
86  //- Construct from Istream
87  passiveParticle(Istream& is, bool readFields = true)
88  :
89  particle(is, readFields)
90  {}
91 
92  //- Copy constructor
94  :
95  particle(p)
96  {}
97 
98  //- Construct and return a clone
99  virtual autoPtr<particle> clone() const
100  {
101  return autoPtr<particle>(new passiveParticle(*this));
102  }
103 
104  //- Construct from Istream and return
106  {
108  }
109 };
110 
111 
112 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
113 
114 } // End namespace Foam
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 #endif
119 
120 // ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:60
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Base particle class.
Definition: particle.H:83
const barycentric & coordinates() const
Return current particle coordinates.
Definition: particleI.H:128
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
vector position(const polyMesh &mesh) const
Return current particle position.
Definition: particleI.H:255
Copy of base particle.
virtual autoPtr< particle > clone() const
Construct and return a clone.
passiveParticle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
static autoPtr< passiveParticle > New(Istream &is)
Construct from Istream and return.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Namespace for OpenFOAM.
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
volScalarField & p