sampledPatchInternalField.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::sampledSurfaces::patchInternalField
26 
27 Description
28  Variation of sampledPatch that samples the internalField (at a given
29  normal distance from the patch) instead of the patchField.
30  Note:
31  - interpolate=false : get cell value on faces
32  - interpolate=true : interpolate inside cell and interpolate to points
33  There is no option to get interpolated value inside the cell on the faces.
34 
35 SourceFiles
36  sampledPatchInternalField.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef sampledPatchInternalField_H
41 #define sampledPatchInternalField_H
42 
43 #include "sampledPatch.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 namespace sampledSurfaces
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class patchInternalField Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public patch
60 {
61  // Private Data
62 
63  //- Mapping engines
65 
66 
67  // Private Member Functions
68 
69  //- Sample field on faces
70  template<class Type>
71  tmp<Field<Type>> sampleField
72  (
73  const VolField<Type>& vField
74  ) const;
75 
76  template<class Type>
77  tmp<Field<Type>> interpolateField(const interpolation<Type>&) const;
78 
79 
80 public:
81 
82  //- Runtime type information
83  TypeName("patchInternalField");
84 
85 
86  // Constructors
87 
88  //- Construct from dictionary
90  (
91  const word& name,
92  const polyMesh& mesh,
93  const dictionary& dict
94  );
95 
96 
97  //- Destructor
98  virtual ~patchInternalField();
99 
100 
101  // Member Functions
102 
103  // Sample
104 
105  //- Sample field on surface
106  virtual tmp<scalarField> sample
107  (
108  const volScalarField&
109  ) const;
110 
111  //- Sample field on surface
112  virtual tmp<vectorField> sample
113  (
114  const volVectorField&
115  ) const;
116 
117  //- Sample field on surface
119  (
121  ) const;
122 
123  //- Sample field on surface
125  (
126  const volSymmTensorField&
127  ) const;
128 
129  //- Sample field on surface
130  virtual tmp<tensorField> sample
131  (
132  const volTensorField&
133  ) const;
134 
135 
136  // Interpolate
137 
138  //- Interpolate field on surface
140  (
141  const interpolation<scalar>&
142  ) const;
143 
144  //- Interpolate field on surface
146  (
147  const interpolation<vector>&
148  ) const;
149 
150  //- Interpolate field on surface
152  (
154  ) const;
155 
156  //- Interpolate field on surface
158  (
160  ) const;
161 
162  //- Interpolate field on surface
164  (
165  const interpolation<tensor>&
166  ) const;
167 
168 
169  //- Write
170  virtual void print(Ostream&) const;
171 };
172 
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 } // End namespace sampledSurfaces
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #ifdef NoRepository
183 #endif
184 
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186 
187 #endif
188 
189 // ************************************************************************* //
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Abstract base class for interpolation.
Definition: interpolation.H:55
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
bool interpolate() const
Interpolation requested for surface.
const word & name() const
Name of surface.
const polyMesh & mesh() const
Access to the underlying mesh.
Variation of sampledPatch that samples the internalField (at a given normal distance from the patch) ...
TypeName("patchInternalField")
Runtime type information.
patchInternalField(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
virtual void print(Ostream &) const
Write.
A sampledSurface on patches. Non-triangulated by default.
Definition: sampledPatch.H:93
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