1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | cfMesh: A library for mesh generation
5 \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6 \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of cfMesh.
11 cfMesh is free software; you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation; either version 3 of the License, or (at your
14 option) any later version.
16 cfMesh 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
21 You should have received a copy of the GNU General Public License
22 along with cfMesh. If not, see <http://www.gnu.org/licenses/>.
25 triSurfaceCurvatureCalculator
28 Provides information regarding surface partitions on the surface
29 triangulation, and connectivity between various surface partitions.
32 triSurfaceCurvatureEstimator.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef triSurfaceCurvatureEstimator_H
37 #define triSurfaceCurvatureEstimator_H
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 /*---------------------------------------------------------------------------*\
49 Class triSurfaceCurvatureEstimator Declaration
50 \*---------------------------------------------------------------------------*/
52 class triSurfaceCurvatureEstimator
55 //- reference to triSurface
56 const triSurf& surface_;
58 //- curvature of points at feature edges
59 scalarField edgePointCurvature_;
61 //- curvatures of other points
62 FRWGraph<label, 3> patchPositions_;
63 List<DynList<scalar, 1> > gaussianCurvature_;
64 List<DynList<scalar, 1> > meanCurvature_;
65 List<DynList<scalar, 1> > maxCurvature_;
66 List<DynList<scalar, 1> > minCurvature_;
67 List<DynList<vector, 1> > maxCurvatureVector_;
68 List<DynList<vector, 1> > minCurvatureVector_;
70 // Private member functions
71 //- calculate curvature of feature edges
72 void calculateEdgeCurvature();
74 //- calculate curvatures of other surface points
75 void calculateSurfaceCurvatures();
77 //- calculate Gaussian curvature
78 void calculateGaussianCurvature();
80 //- calculation of mean curvature
81 void calculateMeanCurvature();
83 //- calculation of min and max curvature
84 void calculateMinAndMaxCurvature();
86 //- Disallow default bitwise copy construct
87 triSurfaceCurvatureEstimator(const triSurfaceCurvatureEstimator&);
89 //- Disallow default bitwise assignment
90 void operator=(const triSurfaceCurvatureEstimator&);
96 //- Construct from triSurface
97 triSurfaceCurvatureEstimator(const triSurf& surface);
101 ~triSurfaceCurvatureEstimator();
105 //- return curvature of points at feature edges
106 scalar edgePointCurvature(const label) const;
107 scalar curvatureAtEdge(const label) const;
109 //- return average curvature on a surface triangle
110 scalar gaussianCurvatureAtTriangle(const label) const;
111 scalar meanCurvatureAtTriangle(const label) const;
112 scalar maxCurvatureAtTriangle(const label) const;
113 scalar minCurvatureAtTriangle(const label) const;
115 vector maxCurvatureVectorAtTriangle(const label) const;
116 vector minCurvatureVectorAtTriangle(const label) const;
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 } // End namespace Foam
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 // ************************************************************************* //