sampledDistanceSurface.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2026 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::sampledSurfaces::distanceSurface
26 
27 Description
28  A sampledSurface defined by a distance to a surface.
29 
30  Example:
31  \verbatim
32  {
33  type distanceSurface;
34  surfaceType searchableBox;
35  min (-1 -1 -1);
36  max (1 1 1);
37  distance 0.1;
38  signed yes;
39  interpolate yes;
40  }
41  \endverbatim
42 
43 Usage
44  \table
45  Property | Description | Required | Default value
46  surfaceType | The type of surface to sample from | yes |
47  distance | The distance from which to sample the surface | yes |
48  signed | Sample only on one side of the surface? | yes |
49  interpolate | Interpolate values to the surface points? | no | no
50  cellZone | Zone containing cells to include | no | all
51  \endtable
52 
53 See also
54  Foam::generatedCellZone
55 
56 SourceFiles
57  sampledDistanceSurface.C
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef sampledDistanceSurface_H
62 #define sampledDistanceSurface_H
63 
65 #include "searchableSurface.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 namespace sampledSurfaces
72 {
73 
74 /*---------------------------------------------------------------------------*\
75  Class distanceSurface Declaration
76 \*---------------------------------------------------------------------------*/
77 
78 class distanceSurface
79 :
80  public sampledIsoSurfaceSurface
81 {
82  // Private Data
83 
84  //- Surface
85  const autoPtr<searchableSurface> surfPtr_;
86 
87  //- Distance value
88  const scalar distance_;
89 
90  //- Is the distance signed? The surface must be closed if so.
91  const bool signed_;
92 
93 
94  // Private Member Functions
95 
96  //- Generate the iso surface
97  virtual autoPtr<cutPolyIsoSurface> calcIsoSurf() const;
98 
99 
100 public:
101 
102  //- Runtime type information
103  TypeName("distanceSurface");
104 
105 
106  // Constructors
107 
108  //- Construct from dictionary
110  (
111  const word& name,
112  const polyMesh& mesh,
113  const dictionary& dict
114  );
115 
116 
117  //- Destructor
118  virtual ~distanceSurface();
119 
120 
121  // Member Functions
122 
123  //- Does the surface need an update?
124  virtual bool needsUpdate() const;
125 
126  //- Write
127  virtual void print(Ostream&) const;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace sampledSurfaces
134 } // End namespace Foam
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 #endif
139 
140 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:78
const word & name() const
Name of surface.
const polyMesh & mesh() const
Access to the underlying mesh.
distanceSurface(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
virtual bool needsUpdate() const
Does the surface need an update?
virtual void print(Ostream &) const
Write.
TypeName("distanceSurface")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
dictionary dict