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 -------------------------------------------------------------------------------
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::sampledNone
28 
29 Description
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 
35 Usage
36  \table
37  Property | Description | Required | Default
38  type | 'none' | yes |
39  \endtable
40 
41 SourceFiles
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 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class sampledNone Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class sampledNone
62 :
63  public meshedSurface,
64  public sampledSurface
65 {
66  typedef meshedSurface Mesh;
67 
68 public:
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();
111  }
112 
113  //- Per-face zone/region information
114  virtual const labelList& zoneIds() const
115  {
116  return labelList::null();
117  }
118 
119  //- Face area magnitudes
120  virtual const vectorField& Sf() const
121  {
122  return Mesh::Sf();
123  }
124 
125  //- Face area magnitudes
126  virtual const scalarField& magSf() const
127  {
128  return Mesh::magSf();
129  }
130 
131  //- Face centres
132  virtual const vectorField& Cf() const
133  {
134  return Mesh::Cf();
135  }
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
147  virtual tmp<vectorField> sample
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
165  virtual tmp<tensorField> sample
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 // ************************************************************************* //
Foam::List::null
static const List< T > & null()
Return a null List.
Definition: ListI.H:109
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::sampledNone::~sampledNone
virtual ~sampledNone()=default
Destructor.
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::sampledNone::Cf
virtual const vectorField & Cf() const
Face centres.
Definition: sampledNone.H:141
Foam::sampledNone::TypeName
TypeName("sampledNone")
Runtime type information.
Foam::sampledNone::needsUpdate
virtual bool needsUpdate() const
Does the surface need an update?
Definition: sampledNone.C:69
Foam::MeshedSurface< face >::Sf
const vectorField & Sf() const
Face area vectors (normals)
Definition: MeshedSurface.H:435
Foam::MeshedSurface< face >::surfFaces
const List< face > & surfFaces() const
Return const access to the faces.
Definition: MeshedSurface.H:413
Foam::sampledNone::zoneIds
virtual const labelList & zoneIds() const
Per-face zone/region information.
Definition: sampledNone.H:123
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::sampledNone::magSf
virtual const scalarField & magSf() const
Face area magnitudes.
Definition: sampledNone.H:135
Foam::sampledNone::sample
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Definition: sampledNone.C:95
Foam::sampledNone::Sf
virtual const vectorField & Sf() const
Face area magnitudes.
Definition: sampledNone.H:129
Foam::sampledNone
A no operation sampledSurface that can be used when a sampler is expected but is not desired....
Definition: sampledNone.H:70
Foam::MeshedSurface< face >::magSf
const scalarField & magSf() const
Face area magnitudes.
Definition: MeshedSurface.H:441
Foam::sampledSurface::interpolate
bool interpolate() const noexcept
Same as isPointData()
Definition: sampledSurface.H:598
Foam::Field< vector >
sampledSurface.H
Foam::sampledSurface
An abstract class for surfaces with sampling.
Definition: sampledSurface.H:121
Foam::sampledNone::expire
virtual bool expire()
Mark the surface as needing an update.
Definition: sampledNone.C:75
Foam::interpolation< scalar >
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::sampledNone::sampledNone
sampledNone()
Construct null.
Definition: sampledNone.C:44
Foam::meshedSurface
MeshedSurface< face > meshedSurface
Definition: MeshedSurfacesFwd.H:41
Foam::List< face >
Foam::sampledNone::points
virtual const pointField & points() const
Points of surface.
Definition: sampledNone.H:111
Foam::sampledNone::faces
virtual const faceList & faces() const
Faces of surface.
Definition: sampledNone.H:117
MeshedSurfaces.H
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::sampledNone::update
virtual bool update()
Update the surface as required.
Definition: sampledNone.C:81
Foam::MeshedSurface< face >::Cf
const vectorField & Cf() const
Face centres.
Definition: MeshedSurface.H:447
Foam::MeshedSurface< face >