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-2026 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  //- Find elements containing patchProbes
70  virtual void findElements(const fvMesh&);
71 
72  //- Sample and write a particular volume field
73  template<class Type>
74  void sampleAndWrite(const VolField<Type>&);
75 
76  //- Sample and write a particular surface field
77  template<class Type>
78  void sampleAndWrite(const SurfaceField<Type>&);
79 
80  //- Sample and write all the fields of the given type
81  template<class Type>
82  void sampleAndWrite(const fieldGroup<Type>&);
83 
84  //- Sample and write all the surface fields of the given type
85  template<class Type>
86  void sampleAndWriteSurfaceFields(const fieldGroup<Type>&);
87 
88  //- Sample a volume field at all locations
89  template<class Type>
90  tmp<Field<Type>> sample(const VolField<Type>&) const;
91 
92  //- Sample a surface field at all locations
93  template<class Type>
94  tmp<Field<Type>> sample(const SurfaceField<Type>&) const;
95 
96  //- Sample a single field on all sample locations
97  template<class Type>
98  tmp<Field<Type>> sample(const word& fieldName) const;
99 
100 
101 public:
102 
103  //- Runtime type information
104  TypeName("patchProbes");
105 
106 
107  // Constructors
108 
109  //- Construct from Time and dictionary
111  (
112  const word& name,
113  const Time& time,
114  const dictionary& dict
115  );
116 
117  //- Disallow default bitwise copy construction
118  patchProbes(const patchProbes&) = delete;
119 
120 
121  //- Destructor
122  virtual ~patchProbes();
123 
124 
125  // Member Functions
126 
127  //- Sample and write
128  virtual bool write();
129 
130  //- Read
131  virtual bool read(const dictionary&);
132 
133 
134  // Member Operators
135 
136  //- Disallow default bitwise assignment
137  void operator=(const patchProbes&) = delete;
138 };
139 
140 
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #ifdef NoRepository
148  #include "patchProbesTemplates.C"
149 #endif
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 #endif
154 
155 // ************************************************************************* //
Generic GeometricField class.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:76
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
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:98
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.
patchProbes(const word &name, const Time &time, const dictionary &dict)
Construct from Time and dictionary.
Definition: patchProbes.C:180
virtual bool write()
Sample and write.
Definition: patchProbes.C:217
virtual ~patchProbes()
Destructor.
Definition: patchProbes.C:194
virtual bool read(const dictionary &)
Read.
Definition: patchProbes.C:200
Class used for grouping field types.
Definition: probes.H:76
Set of locations to sample.
Definition: probes.H:66
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:63
const dimensionSet time
Namespace for OpenFOAM.
dictionary dict