sampledMeshedSurfaceNormal.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) 2017-2020 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::sampledMeshedSurfaceNormal
28 
29 Description
30  Variant of sampledMeshedSurface that samples the surface-normal component
31  of a vector field.
32 
33  Returns a vector field with the value in the first component and sets
34  the other two to zero.
35 
36  This is often embedded as part of a sampled surfaces function object.
37 
38 Usage
39  Example of function object partial specification:
40  \verbatim
41  surfaces
42  {
43  surface1
44  {
45  type sampledMeshedSurfaceNormal;
46  surface something.obj;
47  source cells;
48  }
49  }
50  \endverbatim
51 
52  Where the sub-entries comprise:
53  \table
54  Property | Description | Required | Default
55  type | meshedSurfaceNormal | yes |
56  surface | surface name in triSurface/ | yes |
57  patches | Limit to named surface regions (wordRes) | no |
58  source | cells/insideCells/boundaryFaces | yes |
59  keepIds | pass through id numbering | no | false
60  \endtable
61 
62 SeeAlso
63  Foam::sampledMeshedSurface
64 
65 SourceFiles
66  sampledMeshedSurfaceNormal.C
67  sampledMeshedSurfaceNormalTemplates.C
68 
69 \*---------------------------------------------------------------------------*/
70 
71 #ifndef sampledMeshedSurfaceNormal_H
72 #define sampledMeshedSurfaceNormal_H
73 
74 #include "sampledMeshedSurface.H"
75 
76 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
77 
78 namespace Foam
79 {
80 
81 /*---------------------------------------------------------------------------*\
82  Class sampledMeshedSurfaceNormal Declaration
83 \*---------------------------------------------------------------------------*/
84 
85 class sampledMeshedSurfaceNormal
86 :
87  public sampledMeshedSurface
88 {
89 public:
90 
91  //- Runtime type information
92  TypeName("sampledMeshedSurfaceNormal");
93 
94 
95  // Constructors
96 
97  //- Construct from components
99  (
100  const word& name,
101  const polyMesh& mesh,
102  const word& surfaceName,
103  const samplingSource sampleSource
104  );
105 
106  //- Construct from dictionary
108  (
109  const word& name,
110  const polyMesh& mesh,
111  const dictionary& dict
112  );
113 
114 
115  //- Destructor
116  virtual ~sampledMeshedSurfaceNormal() = default;
117 
118 
119  // Member Functions
120 
121  // Sample
122 
123  //- Sample volume field onto surface faces
124  virtual tmp<scalarField> sample
125  (
126  const interpolation<scalar>& sampler
127  ) const
128  {
130  return nullptr;
131  }
132 
133  //- Sample volume field onto surface faces
134  virtual tmp<vectorField> sample
135  (
136  const interpolation<vector>& sampler
137  ) const;
138 
139  //- Sample volume field onto surface faces
141  (
142  const interpolation<sphericalTensor>& sampler
143  ) const
144  {
146  return nullptr;
147  }
148 
149  //- Sample volume field onto surface faces
150  virtual tmp<symmTensorField> sample
151  (
152  const interpolation<symmTensor>& sampler
153  ) const
154  {
156  return nullptr;
157  }
158 
159  //- Sample volume field onto surface faces
160  virtual tmp<tensorField> sample
161  (
162  const interpolation<tensor>& sampler
163  ) const
164  {
166  return nullptr;
167  }
168 
169 
170  // Interpolate
171 
172  //- Interpolate volume field onto surface points
174  (
175  const interpolation<scalar>& interpolator
176  ) const
177  {
179  return nullptr;
180  }
181 
182  //- Interpolate volume field onto surface points
184  (
185  const interpolation<vector>& interpolator
186  ) const;
187 
188  //- Interpolate volume field onto surface points
190  (
191  const interpolation<sphericalTensor>& interpolator
192  ) const
193  {
195  return nullptr;
196  }
197 
198  //- Interpolate volume field onto surface points
200  (
201  const interpolation<symmTensor>& interpolator
202  ) const
203  {
205  return nullptr;
206  }
207 
208  //- Interpolate volume field onto surface points
210  (
211  const interpolation<tensor>& interpolator
212  ) const
213  {
215  return nullptr;
216  }
217 };
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace Foam
223 
224 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
225 
226 #endif
227 
228 // ************************************************************************* //
Foam::sampledMeshedSurfaceNormal::sampledMeshedSurfaceNormal
sampledMeshedSurfaceNormal(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
Definition: sampledMeshedSurfaceNormal.C:58
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::sampledMeshedSurfaceNormal::sample
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Definition: sampledMeshedSurfaceNormal.H:154
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::sampledMeshedSurfaceNormal
Variant of sampledMeshedSurface that samples the surface-normal component of a vector field.
Definition: sampledMeshedSurfaceNormal.H:114
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::sampledSurface::interpolate
bool interpolate() const noexcept
Same as isPointData()
Definition: sampledSurface.H:598
Foam::interpolation< scalar >
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::sampledSurface::name
const word & name() const noexcept
Name of surface.
Definition: sampledSurface.H:322
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::sampledMeshedSurface
A sampledSurface from a meshed surface. It samples on the points/faces of the meshed surface.
Definition: sampledMeshedSurface.H:188
Foam::sampledSurface::mesh
const polyMesh & mesh() const noexcept
Access to the underlying mesh.
Definition: sampledSurface.H:316
Foam::sampledMeshedSurfaceNormal::~sampledMeshedSurfaceNormal
virtual ~sampledMeshedSurfaceNormal()=default
Destructor.
sampledMeshedSurface.H
Foam::sampledMeshedSurfaceNormal::TypeName
TypeName("sampledMeshedSurfaceNormal")
Runtime type information.
Foam::sampledMeshedSurface::samplingSource
samplingSource
Types of sampling regions.
Definition: sampledMeshedSurface.H:196