Loading...
Searching...
No Matches
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
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.
const Field< point_type > & faceNormals() const
const Field< point_type > & pointNormals() const
A List with indirect addressing. Like IndirectList but does not store addressing.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Abstract base class for volume field interpolation.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Variant of sampledMeshedSurface that samples the surface-normal component of a vector field.
sampledMeshedSurfaceNormal(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
sampledMeshedSurface(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
virtual tmp< scalarField > interpolate(const interpolation< scalar > &interpolator) const
Interpolate volume field onto surface points.
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
samplingSource
Types of sampling regions.
An abstract class for surfaces with sampling.
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:75
A class for handling words, derived from Foam::string.
Definition word.H:66
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
Definition className.H:142
dynamicFvMesh & mesh
const pointField & points
Namespace for OpenFOAM.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
vectorField pointField
pointField is a vectorField.
dictionary dict