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-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::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 field on the surface's faces
104  #define DEFINE_SAMPLE(Type, nullArg) \
105  virtual tmp<Field<Type>> sample \
106  ( \
107  const VolField<Type>& \
108  ) const;
110  #undef DEFINE_SAMPLE
111 
112  //- Interpolate field to the surface's points
113  #define DEFINE_INTERPOLATE(Type, nullArg) \
114  virtual tmp<Field<Type>> interpolate \
115  ( \
116  const interpolation<Type>& \
117  ) const;
119  #undef DEFINE_INTERPOLATE
120 
121  //- Write
122  virtual void print(Ostream&) const;
123 };
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace sampledSurfaces
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #ifdef NoRepository
135 #endif
136 
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
138 
139 #endif
140 
141 // ************************************************************************* //
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 keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Abstract base class for interpolation.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
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 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:63
Namespace for OpenFOAM.
#define DEFINE_SAMPLE(Type, nullArg)
Sample field on the surface's faces.
#define DEFINE_INTERPOLATE(Type, nullArg)
Interpolate field to the surface's points.
dictionary dict