sampledNone.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) 2018-2019 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
26Class
27 Foam::sampledNone
28
29Description
30 A no operation sampledSurface that can be used when a sampler
31 is expected but is not desired. For example, to temporarily disable
32 a sampling definition, or to provide a boilerplate definition that
33 is overwritten at a later stage in a dictionary.
34
35Usage
36 \table
37 Property | Description | Required | Default
38 type | 'none' | yes |
39 \endtable
40
41SourceFiles
42 sampledNone.C
43
44\*---------------------------------------------------------------------------*/
45
46#ifndef sampledNone_H
47#define sampledNone_H
48
49#include "sampledSurface.H"
50#include "MeshedSurfaces.H"
51
52// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53
54namespace Foam
55{
56
57/*---------------------------------------------------------------------------*\
58 Class sampledNone Declaration
59\*---------------------------------------------------------------------------*/
60
61class sampledNone
62:
63 public meshedSurface,
64 public sampledSurface
65{
66 typedef meshedSurface Mesh;
67
68public:
69
70 //- Runtime type information
71 TypeName("sampledNone");
72
73
74 // Constructors
75
76 //- Construct null
77 explicit sampledNone();
78
79 //- Construct null, with specified name
80 explicit sampledNone(const word& name);
81
82 //- Construct null, with dictionary
83 sampledNone(const word& name, const polyMesh&, const dictionary&);
84
85
86 //- Destructor
87 virtual ~sampledNone() = default;
88
89
90 // Member Functions
91
92 //- Does the surface need an update?
93 virtual bool needsUpdate() const;
94
95 //- Mark the surface as needing an update.
96 virtual bool expire();
97
98 //- Update the surface as required.
99 virtual bool update();
100
101 //- Points of surface
102 virtual const pointField& points() const
103 {
104 return Mesh::points();
105 }
106
107 //- Faces of surface
108 virtual const faceList& faces() const
109 {
110 return Mesh::surfFaces();
112
113 //- Per-face zone/region information
114 virtual const labelList& zoneIds() const
115 {
116 return labelList::null();
118
119 //- Face area magnitudes
120 virtual const vectorField& Sf() const
121 {
122 return Mesh::Sf();
124
125 //- Face area magnitudes
126 virtual const scalarField& magSf() const
127 {
128 return Mesh::magSf();
130
131 //- Face centres
132 virtual const vectorField& Cf() const
133 {
134 return Mesh::Cf();
136
137
138 // Sample
139
140 //- Sample volume field onto surface faces
142 (
143 const interpolation<scalar>& sampler
144 ) const;
145
146 //- Sample volume field onto surface faces
148 (
149 const interpolation<vector>& sampler
150 ) const;
151
152 //- Sample volume field onto surface faces
154 (
155 const interpolation<sphericalTensor>& sampler
156 ) const;
157
158 //- Sample volume field onto surface faces
160 (
161 const interpolation<symmTensor>& sampler
162 ) const;
163
164 //- Sample volume field onto surface faces
166 (
167 const interpolation<tensor>& sampler
168 ) const;
169
170
171 // Interpolate
172
173 //- Interpolate volume field onto surface points
175 (
176 const interpolation<scalar>& interpolator
177 ) const;
178
179 //- Interpolate volume field onto surface points
181 (
182 const interpolation<vector>& interpolator
183 ) const;
184
185 //- Interpolate volume field onto surface points
187 (
188 const interpolation<sphericalTensor>& interpolator
189 ) const;
190
191 //- Interpolate volume field onto surface points
193 (
194 const interpolation<symmTensor>& interpolator
195 ) const;
196
197 //- Interpolate volume field onto surface points
199 (
200 const interpolation<tensor>& interpolator
201 ) const;
202};
203
204
205// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206
207} // End namespace Foam
208
209// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210
211#endif
212
213// ************************************************************************* //
Minimal example by using system/controlDict.functions:
static const List< label > & null()
Return a null List.
Definition: ListI.H:109
const vectorField & Sf() const
Face area vectors (normals)
const scalarField & magSf() const
Face area magnitudes.
const vectorField & Cf() const
Face centres.
const List< face > & surfFaces() const
Return const access to the faces.
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
A no operation sampledSurface that can be used when a sampler is expected but is not desired....
Definition: sampledNone.H:74
virtual const pointField & points() const
Points of surface.
Definition: sampledNone.H:111
virtual const faceList & faces() const
Faces of surface.
Definition: sampledNone.H:117
virtual const vectorField & Cf() const
Face centres.
Definition: sampledNone.H:141
virtual const labelList & zoneIds() const
Per-face zone/region information.
Definition: sampledNone.H:123
virtual const scalarField & magSf() const
Face area magnitudes.
Definition: sampledNone.H:135
sampledNone()
Construct null.
Definition: sampledNone.C:44
virtual ~sampledNone()=default
Destructor.
virtual bool expire()
Mark the surface as needing an update.
Definition: sampledNone.C:75
virtual bool needsUpdate() const
Does the surface need an update?
Definition: sampledNone.C:69
virtual bool update()
Update the surface as required.
Definition: sampledNone.C:81
virtual const vectorField & Sf() const
Face area magnitudes.
Definition: sampledNone.H:129
TypeName("sampledNone")
Runtime type information.
An abstract class for surfaces with sampling.
const word & name() const noexcept
Name of surface.
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
const pointField & points
Namespace for OpenFOAM.
MeshedSurface< face > meshedSurface
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73