sampledPatchInternalField.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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2018-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::sampledPatchInternalField
29
30Description
31 Variation of sampledPatch that samples the internalField (at a given
32 normal distance from the patch) instead of the patchField.
33 Note:
34 - interpolate=false : get cell value on faces
35 - interpolate=true : interpolate inside cell and interpolate to points
36 There is no option to get interpolated value inside the cell on the faces.
37
38 This is often embedded as part of a sampled surfaces function object.
39
40Usage
41 Example of function object partial specification:
42 \verbatim
43 surfaces
44 {
45 surface1
46 {
47 type patchInternalField;
48 patches (inlet "outlet.*");
49 offsetMode normal;
50 distance 0.05;
51 }
52 }
53 \endverbatim
54
55 Where the sub-entries comprise:
56 \table
57 Property | Description | Required | Default
58 type | patchInternalField | yes |
59 patches | patch selection as word/regex list | yes |
60 offsetMode | normal/uniform/nonuniform | no | normal
61 distance | distance for normal offset | partly |
62 offset | point offset for uniform offset | partly |
63 offsets | point offsets for nonuniform offset | partly |
64 \endtable
65
66SourceFiles
67 sampledPatchInternalField.C
68
69\*---------------------------------------------------------------------------*/
70
71#ifndef sampledPatchInternalField_H
72#define sampledPatchInternalField_H
73
74#include "sampledPatch.H"
75#include "mappedPatchBase.H"
76
77// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
78
79namespace Foam
80{
81
82/*---------------------------------------------------------------------------*\
83 Class sampledPatchInternalField Declaration
84\*---------------------------------------------------------------------------*/
85
86class sampledPatchInternalField
87:
88 public sampledPatch
89{
90 // Private data
91
92 //- Mapping engines
93 PtrList<mappedPatchBase> mappers_;
94
95
96 // Private Member Functions
97
98 //- Sample volume field onto surface faces
99 template<class Type>
100 tmp<Field<Type>> sampleOnFaces
101 (
102 const interpolation<Type>& sampler
103 ) const;
104
105 //- Interpolate volume field onto surface points
106 template<class Type>
107 tmp<Field<Type>> sampleOnPoints
108 (
109 const interpolation<Type>& interpolator
110 ) const;
111
112
113public:
114
115 //- Runtime type information
116 TypeName("sampledPatchInternalField");
117
118
119 // Constructors
121 //- Construct from dictionary
123 (
124 const word& name,
125 const polyMesh& mesh,
126 const dictionary& dict
127 );
128
129
130 //- Destructor
131 virtual ~sampledPatchInternalField() = default;
132
133
134 // Member Functions
135
136 // Sample
137
138 //- Sample boundary of volume field onto surface faces
140 (
141 const interpolation<scalar>& sampler
142 ) const;
143
144 //- Sample boundary of volume field onto surface faces
146 (
147 const interpolation<vector>& sampler
148 ) const;
149
150 //- Sample boundary of volume field onto surface faces
152 (
153 const interpolation<sphericalTensor>& sampler
154 ) const;
155
156 //- Sample boundary of volume field onto surface faces
158 (
159 const interpolation<symmTensor>& sampler
160 ) const;
161
162 //- Sample boundary of volume field onto surface faces
164 (
166 ) const;
167
168
169 // Interpolate
170
171 //- Interpolate boundary of volume field onto surface points
173 (
174 const interpolation<scalar>& interpolator
175 ) const;
176
177 //- Interpolate boundary of volume field onto surface points
179 (
180 const interpolation<vector>& interpolator
181 ) const;
182
183 //- Interpolate boundary of volume field onto surface points
185 (
186 const interpolation<sphericalTensor>& interpolator
187 ) const;
188
189 //- Interpolate boundary of volume field onto surface points
191 (
192 const interpolation<symmTensor>& interpolator
193 ) const;
194
195 //- Interpolate boundary of volume field onto surface points
197 (
198 const interpolation<tensor>& interpolator
199 ) const;
200
201
202 // Output
203
204 //- Print information
205 virtual void print(Ostream& os, int level=0) const;
206};
207
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211} // End namespace Foam
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215#ifdef NoRepository
217#endif
218
219// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
220
221#endif
222
223// ************************************************************************* //
Minimal example by using system/controlDict.functions:
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Abstract base class for volume field interpolation.
Definition: interpolation.H:60
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Variation of sampledPatch that samples the internalField (at a given normal distance from the patch) ...
TypeName("sampledPatchInternalField")
Runtime type information.
virtual void print(Ostream &os, int level=0) const
Print information.
virtual ~sampledPatchInternalField()=default
Destructor.
A sampledSurface on patches. Non-triangulated by default.
Definition: sampledPatch.H:99
const word & name() const noexcept
Name of surface.
const polyMesh & mesh() const noexcept
Access to the underlying mesh.
bool interpolate() const noexcept
Same as isPointData()
A class for managing temporary objects.
Definition: tmp.H:65
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73