Loading...
Searching...
No Matches
smoothTriSurfaceMesh.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) 2016-2018 OpenFOAM Foundation
9 Copyright (C) 2025 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::smoothTriSurfaceMesh
29
30Description
31 Variant of triSurfaceMesh that interpolates face-normals to obtain
32 point normals.
33
34 Note: when constructing from dictionary has optional parameters:
35 - scale : scaling factor.
36 - tolerance : relative tolerance for doing intersections
37 (see triangle::intersection)
38 - minQuality: discard triangles with low quality when getting normal
39 - featureAngle: limit interpolation to current 'region' only.
40 Region limited by feature edges.
41
42
43SourceFiles
44 smoothTriSurfaceMesh.C
45
46\*---------------------------------------------------------------------------*/
47
48#ifndef smoothTriSurfaceMesh_H
49#define smoothTriSurfaceMesh_H
50
51#include "triSurfaceMesh.H"
52#include "PackedBoolList.H"
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
59/*---------------------------------------------------------------------------*\
60 Class smoothTriSurfaceMesh Declaration
61\*---------------------------------------------------------------------------*/
62
63class smoothTriSurfaceMesh
64:
65 public triSurfaceMesh
66{
67private:
68
69 //- Edges with discontinuity
70 bitSet isBorderEdge_;
71
72 //- Points on border edges
73 bitSet isPointOnBorderEdge_;
74
75 //- Mark feature edges
76 void calcFeatureEdges(const scalar featureAngle);
77
78 //- Calculate local point normal
79 vector pointNormal(const label, const label) const;
80
81
82 //- Disallow default bitwise copy construct
83 smoothTriSurfaceMesh(const smoothTriSurfaceMesh&) = delete;
84
85 //- Disallow default bitwise assignment
86 void operator=(const smoothTriSurfaceMesh&) = delete;
87
88
89public:
90
91 //- Runtime type information
92 TypeName("smoothTriSurfaceMesh");
93
94
95 // Constructors
96
97 //- Construct read, specify feature angle
98 smoothTriSurfaceMesh(const IOobject& io, const scalar featureAngle);
99
100 //- Construct from IO and dictionary (used by searchableSurface).
101 // Dictionary may contain a 'scale' entry (eg, 0.001: mm -> m)
102 smoothTriSurfaceMesh
103 (
104 const IOobject& io,
105 const dictionary& dict
106 );
107
108
109 //- Destructor
110 virtual ~smoothTriSurfaceMesh();
111
112
113 // Member Functions
114
115 //- From a set of points and indices get the normal
116 virtual void getNormal
117 (
118 const List<pointIndexHit>&,
119 vectorField& normal
120 ) const;
121};
122
123
124// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125
126} // End namespace Foam
127
128// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129
130#endif
131
132// ************************************************************************* //
Defines the attributes of an object for which implicit objectRegistry management is supported,...
Definition IOobject.H:191
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
virtual ~smoothTriSurfaceMesh()
Destructor.
virtual void getNormal(const List< pointIndexHit > &, vectorField &normal) const
From a set of points and indices get the normal.
triSurfaceMesh(const triSurfaceMesh &)=delete
No copy construct.
const auto & io
Namespace for OpenFOAM.
Field< vector > vectorField
Specialisation of Field<T> for vector.
Vector< scalar > vector
Definition vector.H:57
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68