patchProbes.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::patchProbes
26 
27 Description
28  Set of locations to sample.at patches
29 
30  Call write() to sample and write files.
31 
32 SourceFiles
33  patchProbes.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef patchProbes_H
38 #define patchProbes_H
39 
40 #include "probes.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 // Forward declaration of classes
48 class objectRegistry;
49 class dictionary;
50 class fvMesh;
51 class polyTopoChangeMap;
52 
53 /*---------------------------------------------------------------------------*\
54  Class patchProbes Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class patchProbes
58 :
59  public probes
60 {
61  // Private Data
62 
63  //- Patch name
64  word patchName_;
65 
66 
67  // Private Member Functions
68 
69  //- Sample and write a particular volume field
70  template<class Type>
71  void sampleAndWrite
72  (
73  const VolField<Type>&
74  );
75 
76 
77  //- Sample and write a particular surface field
78  template<class Type>
79  void sampleAndWrite
80  (
81  const SurfaceField<Type>&
82  );
83 
84 
85  //- Sample and write all the fields of the given type
86  template<class Type>
87  void sampleAndWrite(const fieldGroup<Type>&);
88 
89 
90  //- Sample and write all the surface fields of the given type
91  template<class Type>
92  void sampleAndWriteSurfaceFields(const fieldGroup<Type>&);
93 
94 
95  //- Sample a volume field at all locations
96  template<class Type>
97  tmp<Field<Type>> sample
98  (
99  const VolField<Type>&
100  ) const;
101 
102 
103  //- Sample a surface field at all locations
104  template<class Type>
105  tmp<Field<Type>> sample
106  (
107  const SurfaceField<Type>&
108  ) const;
109 
110 
111  //- Sample a single field on all sample locations
112  template<class Type>
113  tmp<Field<Type>> sample(const word& fieldName) const;
114 
115 
116 public:
117 
118  //- Runtime type information
119  TypeName("patchProbes");
120 
121 
122  // Constructors
123 
124  //- Construct from Time and dictionary
126  (
127  const word& name,
128  const Time& time,
129  const dictionary& dict
130  );
131 
132  //- Disallow default bitwise copy construction
133  patchProbes(const patchProbes&) = delete;
134 
135 
136  //- Destructor
137  virtual ~patchProbes();
138 
139 
140  // Member Functions
141 
142  //- Sample and write
143  virtual bool write();
144 
145  //- Read
146  virtual bool read(const dictionary&);
147 
148  //- Find elements containing patchProbes
149  virtual void findElements(const fvMesh&);
150 
151 
152  // Member Operators
153 
154  //- Disallow default bitwise assignment
155  void operator=(const patchProbes&) = delete;
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #ifdef NoRepository
166  #include "patchProbesTemplates.C"
167 #endif
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
Generic GeometricField class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
const word & name() const
Return the name of this functionObject.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:99
Set of locations to sample.at patches.
Definition: patchProbes.H:59
TypeName("patchProbes")
Runtime type information.
void operator=(const patchProbes &)=delete
Disallow default bitwise assignment.
virtual void findElements(const fvMesh &)
Find elements containing patchProbes.
Definition: patchProbes.C:51
patchProbes(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
Definition: patchProbes.C:177
virtual bool write()
Sample and write.
Definition: patchProbes.C:202
virtual ~patchProbes()
Destructor.
Definition: patchProbes.C:198
virtual bool read(const dictionary &)
Read.
Definition: patchProbes.C:223
Class used for grouping field types.
Definition: probes.H:78
Set of locations to sample.
Definition: probes.H:68
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict