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 {
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;
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 // ************************************************************************* //
virtual const faceList & faces() const
Faces of surface.
Definition: sampledNone.H:133
bool interpolate() const noexcept
Same as isPointData()
virtual const scalarField & magSf() const
Face area magnitudes.
Definition: sampledNone.H:157
virtual tmp< scalarField > sample(const interpolation< scalar > &sampler) const
Sample volume field onto surface faces.
Definition: sampledNone.C:88
virtual bool update()
Update the surface as required.
Definition: sampledNone.C:74
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
const vectorField & Sf() const
Face area vectors (normals)
virtual const pointField & points() const
Points of surface.
Definition: sampledNone.H:125
static const List< label > & null()
Return a null List.
Definition: ListI.H:130
virtual ~sampledNone()=default
Destructor.
const word & name() const noexcept
Name of surface.
sampledNone()
Construct null.
Definition: sampledNone.C:37
A class for handling words, derived from Foam::string.
Definition: word.H:63
const scalarField & magSf() const
Face area magnitudes.
MeshedSurface< face > meshedSurface
const Field< point_type > & points() const noexcept
Return reference to global points.
virtual const vectorField & Sf() const
Face area magnitudes.
Definition: sampledNone.H:149
const List< face > & surfFaces() const
Return const access to the faces.
virtual bool needsUpdate() const
Does the surface need an update?
Definition: sampledNone.C:62
const vectorField & Cf() const
Face centres.
virtual const vectorField & Cf() const
Face centres.
Definition: sampledNone.H:165
TypeName("sampledNone")
Runtime type information.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< label > labelList
A List of labels.
Definition: List.H:62
A class for managing temporary objects.
Definition: HashPtrTable.H:50
virtual const labelList & zoneIds() const
Per-face zone/region information.
Definition: sampledNone.H:141
virtual bool expire()
Mark the surface as needing an update.
Definition: sampledNone.C:68
Namespace for OpenFOAM.