sampledMeshedSurfaceNormal.C
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-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
30
31// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32
33namespace Foam
34{
36 // Use shorter name only
38 (
41 word,
42 meshedSurfaceNormal
43 );
44 // Compatibility name (1912)
46 (
49 word,
50 sampledTriSurfaceMeshNormal
51 );
52}
53
54
55// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
56
58(
59 const word& name,
60 const polyMesh& mesh,
61 const word& surfaceName,
62 const samplingSource sampleSource
63)
64:
65 sampledMeshedSurface(name, mesh, surfaceName, sampleSource)
66{}
67
68
70(
71 const word& name,
72 const polyMesh& mesh,
73 const dictionary& dict
74)
75:
77{}
78
79
80// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
81
84(
85 const interpolation<vector>& sampler
86) const
87{
88 auto tvalues = tmp<Field<vector>>::New(size(), Zero);
89
90 tvalues.ref().replace
91 (
92 0,
95 );
96
97 return tvalues;
98}
99
100
103(
104 const interpolation<vector>& interpolator
105) const
106{
107 auto tvalues = tmp<Field<vector>>::New(points().size(), Zero);
108
109 pointField allNormals(points().size(), Zero);
110 UIndirectList<vector>(allNormals, meshPoints()) = pointNormals();
111
112 tvalues.ref().replace
113 (
114 0,
115 allNormals
117 );
118
119 return tvalues;
120}
121
122
123// ************************************************************************* //
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
Minimal example by using system/controlDict.functions:
A List with indirect addressing. Like IndirectList but does not store addressing.
Definition: IndirectList.H:79
static const FixedList< vector, 6 > faceNormals
The unit normal per face.
Definition: boundBox.H:92
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
Variant of sampledMeshedSurface that samples the surface-normal component of a vector field.
A sampledSurface from a meshed surface. It samples on the points/faces of the meshed surface.
samplingSource
Types of sampling regions.
An abstract class for surfaces with sampling.
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
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition: className.H:121
dynamicFvMesh & mesh
const pointField & points
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tdf1, const word &name, const dimensionSet &dimensions)
Global function forwards to reuseTmpDimensionedField::New.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
dictionary dict