closedTriSurface.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-2025 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::searchableSurfaces::closedTriSurface
26 
27 Description
28  Like triSurface, a surface geometry formed of discrete facets, e.g. \
29  triangles and/or quadrilaterals, defined in a file using formats such as
30  Wavefront OBJ, or stereolithography STL. A closedTriSurface is a
31  geometry surface which is meant to be closed but contains some
32  imperfections, e.g. small holes or multiple parts, which mean it is not
33  strictly closed.
34 
35 Usage
36  \table
37  Property | Description | Required
38  file | Name of the geometry file | yes
39  scale | Scaling factor for surface | no
40  minQuality | Threshold triangle quality | no
41  \endtable
42 
43  Note: when calculating surface normal vectors, triangles are ignored with
44  quality < minQuality.
45 
46  Example specification in snappyHexMeshDict/geometry:
47  \verbatim
48  type closedTriSurface;
49  file "surfaceFile.obj";
50  \endverbatim
51 
52 SourceFiles
53  closedTriSurface.C
54 
55 \*---------------------------------------------------------------------------*/
56 
57 #ifndef closedTriSurface_searchableSurface_H
58 #define closedTriSurface_searchableSurface_H
59 
61 
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
63 
64 namespace Foam
65 {
66 namespace searchableSurfaces
67 {
68 
69 /*---------------------------------------------------------------------------*\
70  Class closedTriSurface Declaration
71 \*---------------------------------------------------------------------------*/
72 
73 class closedTriSurface
74 :
75  public triSurface
76 {
77 public:
78 
79  //- Runtime type information
80  TypeName("closedTriSurface");
81 
82 
83  // Constructors
84 
85  //- Construct from triSurface
86  closedTriSurface(const IOobject&, const triSurface&);
87 
88  //- Construct read.
89  closedTriSurface(const IOobject& io);
90 
91  //- Construct from IO and dictionary (used by searchableSurface).
92  // Dictionary may contain a 'scale' entry (eg, 0.001: mm -> m)
94  (
95  const IOobject& io,
96  const dictionary& dict
97  );
98 
99  //- Disallow default bitwise copy construction
100  closedTriSurface(const closedTriSurface&) = delete;
101 
102 
103  // Destructor
104 
105  virtual ~closedTriSurface();
106 
107 
108  // Member Functions
109 
110  //- Whether supports volume type, forcing to true to force getVolumeType
111  // queries for this type
112  virtual bool hasVolumeType() const
113  {
114  return true;
115  }
116 
117 
118  // Member Operators
119 
120  //- Disallow default bitwise assignment
121  void operator=(const closedTriSurface&) = delete;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End of namespace searchableSurfaces
128 } // End namespace Foam
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Definition: IOobject.H:99
IOobject(const word &name, const fileName &instance, const objectRegistry &registry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true)
Construct from name, instance, registry, io options.
Definition: IOobject.C:164
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Like triSurface, a surface geometry formed of discrete facets, e.g. \ triangles and/or quadrilaterals...
TypeName("closedTriSurface")
Runtime type information.
virtual bool hasVolumeType() const
Whether supports volume type, forcing to true to force getVolumeType.
void operator=(const closedTriSurface &)=delete
Disallow default bitwise assignment.
closedTriSurface(const IOobject &, const triSurface &)
Construct from triSurface.
triSurface()
Construct null.
Definition: triSurface.C:535
Namespace for OpenFOAM.
dictionary dict