FreeFOAM The Cross-Platform CFD Toolkit
patchProbes.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 | Copyright (C) 2010-2011 OpenCFD Ltd.
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 
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 all the fields of the given type
78  template <class Type>
79  void sampleAndWrite(const fieldGroup<Type>&);
80 
81 
82  //- Sample a volume field at all locations
83  template<class Type>
84  tmp<Field<Type> > sample
85  (
87  ) const;
88 
89 
90  //- Sample a single field on all sample locations
91  template <class Type>
92  tmp<Field<Type> > sample(const word& fieldName) const;
93 
94 
95  //- Disallow default bitwise copy construct
96  patchProbes(const patchProbes&);
97 
98  //- Disallow default bitwise assignment
99  void operator=(const patchProbes&);
100 
101 
102 public:
103 
104  //- Runtime type information
105  TypeName("patchProbes");
106 
107 
108  // Constructors
109 
110  //- Construct for given objectRegistry and dictionary.
111  // Allow the possibility to load fields from files
113  (
114  const word& name,
115  const objectRegistry&,
116  const dictionary&,
117  const bool loadFromFiles = false
118  );
119 
120 
121  //- Destructor
122  virtual ~patchProbes();
123 
124  //- Public members
125 
126  //- Sample and write
127  virtual void write();
128 
129  //- Read
130  virtual void read(const dictionary&);
131 
132  //- Find elements containing patchProbes
133  virtual void findElements(const fvMesh&);
134 
135 
136 };
137 
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 
140 } // End namespace Foam
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 #ifdef NoRepository
145 # include "patchProbesTemplates.C"
146 #endif
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************ vim: set sw=4 sts=4 et: ************************ //