Loading...
Searching...
No Matches
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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2019-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::passiveParticle
29
30Description
31 Copy of base particle
32
33SourceFiles
34 passiveParticle.H
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_passiveParticle_H
39#define Foam_passiveParticle_H
40
41#include "particle.H"
42#include "IOstream.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
49/*---------------------------------------------------------------------------*\
50 Class passiveParticle Declaration
51\*---------------------------------------------------------------------------*/
52
54:
55 public particle
56{
57public:
58
59 // Constructors
60
61 //- Construct from components
63 (
64 const polyMesh& mesh,
66 const label celli,
67 const label tetFacei,
68 const label tetPti
69 )
70 :
71 particle(mesh, coordinates, celli, tetFacei, tetPti)
72 {}
73
74
75 //- Construct from a position and a cell.
76 // Searches for the rest of the required topology.
78 (
79 const polyMesh& mesh,
80 const vector& position,
81 const label celli = -1
82 )
83 :
84 particle(mesh, position, celli)
85 {}
86
87
88 //- Construct from Istream
90 (
91 const polyMesh& mesh,
92 Istream& is,
93 bool readFields = true,
94 bool newFormat = true
95 )
96 :
97 particle(mesh, is, readFields, newFormat)
98 {}
99
100
101 //- Construct as copy
103 :
104 particle(p)
105 {}
107
108 //- Return a clone
109 virtual autoPtr<particle> clone() const
110 {
111 return particle::Clone(*this);
112 }
113
114
115 //- Factory class to read-construct particles (for parallel transfer)
116 class iNew
117 {
118 const polyMesh& mesh_;
119
120 public:
121
122 iNew(const polyMesh& mesh)
123 :
124 mesh_(mesh)
125 {}
126
128 {
129 return autoPtr<passiveParticle>::New(mesh_, is, true);
131 };
132};
133
134
135// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136
137} // End namespace Foam
138
139// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140
141#endif
142
143// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
Base particle class.
Definition particle.H:72
vector position() const
Return current particle position.
Definition particleI.H:283
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static autoPtr< particle > Clone(const Derived &p)
Clone a particle.
Definition particle.H:552
const polyMesh & mesh() const noexcept
Return the mesh database.
Definition particleI.H:110
const barycentric & coordinates() const noexcept
Return current particle coordinates.
Definition particleI.H:116
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
Definition particle.C:507
Factory class to read-construct particles (for parallel transfer).
autoPtr< passiveParticle > operator()(Istream &is) const
iNew(const polyMesh &mesh)
Copy of base particle.
virtual autoPtr< particle > clone() const
Return a clone.
passiveParticle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
passiveParticle(const passiveParticle &p)
Construct as copy.
passiveParticle(const polyMesh &mesh, const vector &position, const label celli=-1)
Construct from a position and a cell.
passiveParticle(const polyMesh &mesh, Istream &is, bool readFields=true, bool newFormat=true)
Construct from Istream.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
volScalarField & p
Namespace for OpenFOAM.
Barycentric< scalar > barycentric
A scalar version of the templated Barycentric.
Definition barycentric.H:45
Vector< scalar > vector
Definition vector.H:57