sampledPatchInternalField.C
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-2023 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 \*---------------------------------------------------------------------------*/
25 
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33 namespace sampledSurfaces
34 {
37 }
38 }
39 
40 
41 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
42 
44 (
45  const word& name,
46  const polyMesh& mesh,
47  const dictionary& dict
48 )
49 :
50  patch(name, mesh, dict),
51  mappers_(patchIndices().size())
52 {
53  // Negate the distance so that we sample cells inside the patch
54  dictionary mappersDict(dict);
55  if (dict.found("distance"))
56  {
57  mappersDict.set("distance", -mappersDict.lookup<scalar>("distance"));
58  }
59 
60  forAll(patchIndices(), i)
61  {
62  mappers_.set
63  (
64  i,
66  (
68  mappersDict
69  )
70  );
71  }
72 }
73 
74 
75 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
76 
78 {}
79 
80 
81 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
82 
85 (
86  const volScalarField& vField
87 ) const
88 {
89  return sampleField(vField);
90 }
91 
92 
95 (
96  const volVectorField& vField
97 ) const
98 {
99  return sampleField(vField);
100 }
101 
104 (
105  const volSphericalTensorField& vField
106 ) const
107 {
108  return sampleField(vField);
109 }
110 
111 
114 (
115  const volSymmTensorField& vField
116 ) const
117 {
118  return sampleField(vField);
119 }
120 
121 
124 (
125  const volTensorField& vField
126 ) const
127 {
128  return sampleField(vField);
129 }
130 
131 
134 (
135  const interpolation<scalar>& interpolator
136 ) const
137 {
138  return interpolateField(interpolator);
139 }
140 
141 
144 (
145  const interpolation<vector>& interpolator
146 ) const
147 {
148  return interpolateField(interpolator);
149 }
150 
151 
154 (
155  const interpolation<sphericalTensor>& interpolator
156 ) const
157 {
158  return interpolateField(interpolator);
159 }
160 
161 
164 (
165  const interpolation<symmTensor>& interpolator
166 ) const
167 {
168  return interpolateField(interpolator);
169 }
170 
171 
174 (
175  const interpolation<tensor>& interpolator
176 ) const
177 {
178  return interpolateField(interpolator);
179 }
180 
181 
183 {
184  os << "patchInternalField: " << name() << " :"
185  << " patches:" << patchNames()
186  << " faces:" << faces().size()
187  << " points:" << points().size();
188 }
189 
190 
191 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:434
Macros for easy insertion into run-time selection tables.
Generic GeometricField class.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
Definition: dictionary.C:710
void set(entry *)
Assign a new entry, overwrite any existing entry.
Definition: dictionary.C:1152
Abstract base class for interpolation.
Definition: interpolation.H:55
Engine which provides mapping from cells to patch faces.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Definition: polyMesh.H:404
An abstract class for surfaces with sampling.
bool interpolate() const
Interpolation requested for 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) ...
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
const labelList & patchIndices() const
Definition: sampledPatch.C:81
A class for managing temporary objects.
Definition: tmp.H:55
A class for handling words, derived from string.
Definition: word.H:62
const pointField & points
defineTypeNameAndDebug(cutPlane, 0)
addToRunTimeSelectionTable(sampledSurface, cutPlane, word)
Namespace for OpenFOAM.
word name(const bool)
Return a word representation of a bool.
Definition: boolIO.C:39
wordList patchNames(nPatches)
dictionary dict