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-2022 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, specified by \\
49  the sign of the distance | yes |
50  interpolate | interpolate values to the surface points | no | no
51  \endtable
52 
53 SourceFiles
54  sampledDistanceSurface.C
55 
56 \*---------------------------------------------------------------------------*/
57 
58 #ifndef sampledDistanceSurface_H
59 #define sampledDistanceSurface_H
60 
62 #include "searchableSurface.H"
63 
64 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 
66 namespace Foam
67 {
68 namespace sampledSurfaces
69 {
70 
71 /*---------------------------------------------------------------------------*\
72  Class distanceSurface Declaration
73 \*---------------------------------------------------------------------------*/
74 
75 class distanceSurface
76 :
77  public sampledIsoSurfaceSurface
78 {
79  // Private Data
80 
81  //- Surface
82  const autoPtr<searchableSurface> surfPtr_;
83 
84  //- Distance value
85  const scalar distance_;
86 
87  //- Is the distance signed? The surface must be closed if so.
88  const bool signed_;
89 
90 
91  // Private Member Functions
92 
93  //- Generate the iso surface
94  virtual autoPtr<cutPolyIsoSurface> calcIsoSurf() const;
95 
96 
97 public:
98 
99  //- Runtime type information
100  TypeName("distanceSurface");
101 
102 
103  // Constructors
104 
105  //- Construct from dictionary
107  (
108  const word& name,
109  const polyMesh& mesh,
110  const dictionary& dict
111  );
112 
113 
114  //- Destructor
115  virtual ~distanceSurface();
116 
117 
118  // Member Functions
119 
120  //- Does the surface need an update?
121  virtual bool needsUpdate() const;
122 
123  //- Print
124  virtual void print(Ostream&) const;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace sampledSurfaces
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
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
Print.
TypeName("distanceSurface")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.
dictionary dict