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-2018 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  //- Disallow default bitwise copy construct
117  patchProbes(const patchProbes&);
118 
119  //- Disallow default bitwise assignment
120  void operator=(const patchProbes&);
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("patchProbes");
127 
128 
129  // Constructors
130 
131  //- Construct from Time and dictionary
133  (
134  const word& name,
135  const Time& time,
136  const dictionary& dict
137  );
138 
139  //- Construct for given objectRegistry and dictionary.
140  // Allow the possibility to load fields from files
142  (
143  const word& name,
144  const objectRegistry&,
145  const dictionary&,
146  const bool loadFromFiles = false
147  );
148 
149 
150  //- Destructor
151  virtual ~patchProbes();
152 
153 
154  //- Public members
155 
156  //- Sample and write
157  virtual bool write();
158 
159  //- Read
160  virtual bool read(const dictionary&);
161 
162  //- Find elements containing patchProbes
163  virtual void findElements(const fvMesh&);
164 };
165 
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 } // End namespace Foam
170 
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
172 
173 #ifdef NoRepository
174  #include "patchProbesTemplates.C"
175 #endif
176 
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
178 
179 #endif
180 
181 // ************************************************************************* //
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:137
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
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()
Public members.
Definition: patchProbes.C:237
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.