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-2020 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 mapPolyMesh;
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  (
74  );
75 
76 
77  //- Sample and write a particular surface field
78  template<class Type>
79  void sampleAndWrite
80  (
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  (
100  ) const;
101 
102 
103  //- Sample a surface field at all locations
104  template<class Type>
105  tmp<Field<Type>> sample
106  (
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  //- Construct for given objectRegistry and dictionary.
133  // Allow the possibility to load fields from files
135  (
136  const word& name,
137  const objectRegistry&,
138  const dictionary&,
139  const bool loadFromFiles = false
140  );
141 
142  //- Disallow default bitwise copy construction
143  patchProbes(const patchProbes&) = delete;
144 
145 
146  //- Destructor
147  virtual ~patchProbes();
148 
149 
150  // Member Functions
151 
152  //- Sample and write
153  virtual bool write();
154 
155  //- Read
156  virtual bool read(const dictionary&);
157 
158  //- Find elements containing patchProbes
159  virtual void findElements(const fvMesh&);
160 
161 
162  // Member Operators
163 
164  //- Disallow default bitwise assignment
165  void operator=(const patchProbes&) = delete;
166 };
167 
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #ifdef NoRepository
176  #include "patchProbesTemplates.C"
177 #endif
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
dictionary dict
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual ~patchProbes()
Destructor.
Definition: patchProbes.C:233
Set of locations to sample.
Definition: probes.H:65
virtual bool read(const dictionary &)
Read.
Definition: patchProbes.C:258
patchProbes(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
Definition: patchProbes.C:191
Generic GeometricField class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
A class for handling words, derived from string.
Definition: word.H:59
Set of locations to sample.at patches.
Definition: patchProbes.H:56
virtual void findElements(const fvMesh &)
Find elements containing patchProbes.
Definition: patchProbes.C:51
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
virtual bool write()
Sample and write.
Definition: patchProbes.C:237
void operator=(const patchProbes &)=delete
Disallow default bitwise assignment.
A class for managing temporary objects.
Definition: PtrList.H:53
Registry of regIOobjects.
TypeName("patchProbes")
Runtime type information.
Class used for grouping field types.
Definition: probes.H:76
Namespace for OpenFOAM.