sampledTriSurfaceMeshNormal.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-2018 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::sampledTriSurfaceMeshNormal
28 
29 Description
30  Variant of sampledTriSurfaceMesh 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 sampledTriSurfaceMeshNormal;
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 | sampledTriSurfaceMeshNormal | yes |
56  surface | surface name in triSurface/ | yes |
57  source | cells/insideCells/boundaryFaces | yes |
58  keepIds | pass through id numbering | no | false
59  \endtable
60 
61 SeeAlso
62  Foam::sampledTriSurfaceMesh
63 
64 SourceFiles
65  sampledTriSurfaceMeshNormal.C
66  sampledTriSurfaceMeshNormalTemplates.C
67 
68 \*---------------------------------------------------------------------------*/
69 
70 #ifndef sampledTriSurfaceMeshNormal_H
71 #define sampledTriSurfaceMeshNormal_H
72 
73 #include "sampledTriSurfaceMesh.H"
74 
75 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 
77 namespace Foam
78 {
79 
80 /*---------------------------------------------------------------------------*\
81  Class sampledTriSurfaceMeshNormal Declaration
82 \*---------------------------------------------------------------------------*/
83 
84 class sampledTriSurfaceMeshNormal
85 :
86  public sampledTriSurfaceMesh
87 {
88 public:
89 
90  //- Runtime type information
91  TypeName("sampledTriSurfaceMeshNormal");
92 
93 
94  // Constructors
95 
96  //- Construct from components
98  (
99  const word& name,
100  const polyMesh& mesh,
101  const word& surfaceName,
102  const samplingSource sampleSource
103  );
104 
105  //- Construct from dictionary
107  (
108  const word& name,
109  const polyMesh& mesh,
110  const dictionary& dict
111  );
112 
113  //- Construct from triSurface
115  (
116  const word& name,
117  const polyMesh& mesh,
118  const triSurface& surface,
119  const word& sampleSourceName
120  );
121 
122 
123  //- Destructor
124  virtual ~sampledTriSurfaceMeshNormal() = default;
125 
126 
127  // Member Functions
128 
129  // Sample
130 
131  //- Sample volume field onto surface faces
132  virtual tmp<scalarField> sample
133  (
134  const interpolation<scalar>& sampler
135  ) const
136  {
138  return nullptr;
139  }
140 
141  //- Sample volume field onto surface faces
142  virtual tmp<vectorField> sample
143  (
144  const interpolation<vector>& sampler
145  ) const;
146 
147  //- Sample volume field onto surface faces
149  (
150  const interpolation<sphericalTensor>& sampler
151  ) const
152  {
154  return nullptr;
155  }
156 
157  //- Sample volume field onto surface faces
159  (
160  const interpolation<symmTensor>& sampler
161  ) const
162  {
164  return nullptr;
165  }
166 
167  //- Sample volume field onto surface faces
168  virtual tmp<tensorField> sample
169  (
170  const interpolation<tensor>& sampler
171  ) const
172  {
174  return nullptr;
175  }
176 
177 
178  // Interpolate
179 
180  //- Interpolate volume field onto surface points
182  (
183  const interpolation<scalar>& interpolator
184  ) const
185  {
187  return nullptr;
188  }
189 
190  //- Interpolate volume field onto surface points
192  (
193  const interpolation<vector>& interpolator
194  ) const;
195 
196  //- Interpolate volume field onto surface points
198  (
199  const interpolation<sphericalTensor>& interpolator
200  ) const
201  {
203  return nullptr;
204  }
205 
206  //- Interpolate volume field onto surface points
208  (
209  const interpolation<symmTensor>& interpolator
210  ) const
211  {
213  return nullptr;
214  }
215 
216  //- Interpolate volume field onto surface points
218  (
219  const interpolation<tensor>& interpolator
220  ) const
221  {
223  return nullptr;
224  }
225 };
226 
227 
228 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
229 
230 } // End namespace Foam
231 
232 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 
234 #endif
235 
236 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::sampledTriSurfaceMeshNormal::sample
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Definition: sampledTriSurfaceMeshNormal.H:157
Foam::sampledTriSurfaceMesh::samplingSource
samplingSource
Types of communications.
Definition: sampledTriSurfaceMesh.H:148
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
sampledTriSurfaceMesh.H
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:419
Foam::sampledTriSurfaceMesh
A sampledSurface from a triSurfaceMesh. It samples on the points/triangles of the triSurface.
Definition: sampledTriSurfaceMesh.H:141
Foam::triSurface
Triangulated surface description with patch information.
Definition: triSurface.H:70
Foam::sampledTriSurfaceMeshNormal::TypeName
TypeName("sampledTriSurfaceMeshNormal")
Runtime type information.
Foam::sampledTriSurfaceMeshNormal::sampledTriSurfaceMeshNormal
sampledTriSurfaceMeshNormal(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
Definition: sampledTriSurfaceMeshNormal.C:48
Foam::sampledTriSurfaceMeshNormal::~sampledTriSurfaceMeshNormal
virtual ~sampledTriSurfaceMeshNormal()=default
Destructor.
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:121
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::sampledTriSurfaceMeshNormal
Variant of sampledTriSurfaceMesh that samples the surface-normal component of a vector field.
Definition: sampledTriSurfaceMeshNormal.H:108
Foam::sampledSurface::name
const word & name() const
Name of surface.
Definition: sampledSurface.H:308
Foam::sampledSurface::mesh
const polyMesh & mesh() const
Access to the underlying mesh.
Definition: sampledSurface.H:302
Foam::sampledSurface::interpolate
bool interpolate() const
Interpolation to nodes requested for surface.
Definition: sampledSurface.H:326