surfaceOptimizer.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 Class
25  surfaceOptimizer
26 
27 Description
28  Performs optimisation of a central vertex in a simplex
29 
30 SourceFiles
31  surfaceOptimizer.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef surfaceOptimizer_H
36 #define surfaceOptimizer_H
37 
38 #include "point.H"
39 #include "triFace.H"
40 #include "DynList.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class surfaceOptimizer Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class surfaceOptimizer
52 {
53  // Private static data
54  //- direction vectors for divide and conquer algorithm
55  static const vector dirVecs[4];
56 
57  // Private data
58  //- reference to the simplex points
60 
61  //- reference to the triangles forming a simplex
62  const DynList<triFace>& trias_;
63 
64  //- min position of the bnd box
65  point pMin_;
66 
67  //- max position of the bnd box
68  point pMax_;
69 
70  // Private member functions
71  //- evaluate stabilisation factor
72  scalar evaluateStabilisationFactor() const;
73 
74  //- evaluate the functional
75  scalar evaluateFunc(const scalar& K) const;
76 
77  //- evaluate gradients needed for optimisation
78  void evaluateGradients(const scalar&, vector&, tensor&) const;
79 
80  //- optimise point position using the divide and conquer technique
81  scalar optimiseDivideAndConquer(const scalar tol);
82 
83  //- optimise point position via the steepest descent method
84  scalar optimiseSteepestDescent(const scalar tol);
85 
86  //- Disallow default bitwise copy construct
88 
89  //- Disallow default bitwise assignment
90  void operator=(const surfaceOptimizer&);
91 
92 public:
93 
94  // Constructors
95 
96  //- Construct from transformed points and triangles forming a simplex
98  (
99  DynList<point>& pts,
100  const DynList<triFace>& trias
101  );
102 
103 
104  // Destructor
105 
107 
108  // Member Functions
109 
110  //- optimizes position of a central point in the simplex
111  point optimizePoint(const scalar tol = 0.1);
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace Foam
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 #endif
122 
123 // ************************************************************************* //
Foam::surfaceOptimizer::pts_
DynList< point > & pts_
reference to the simplex points
Definition: surfaceOptimizer.H:58
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::surfaceOptimizer::optimizePoint
point optimizePoint(const scalar tol=0.1)
optimizes position of a central point in the simplex
Definition: surfaceOptimizer.C:382
Foam::surfaceOptimizer::evaluateFunc
scalar evaluateFunc(const scalar &K) const
evaluate the functional
Definition: surfaceOptimizer.C:97
point.H
triFace.H
K
CGAL::Exact_predicates_exact_constructions_kernel K
Definition: CGALTriangulation3DKernel.H:56
Foam::surfaceOptimizer::operator=
void operator=(const surfaceOptimizer &)
Disallow default bitwise assignment.
Foam::surfaceOptimizer::dirVecs
static const vector dirVecs[4]
direction vectors for divide and conquer algorithm
Definition: surfaceOptimizer.H:54
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::DynList
Definition: DynList.H:53
Foam::surfaceOptimizer::~surfaceOptimizer
~surfaceOptimizer()
Definition: surfaceOptimizer.C:377
Foam::surfaceOptimizer::pMin_
point pMin_
min position of the bnd box
Definition: surfaceOptimizer.H:64
Foam::surfaceOptimizer::evaluateStabilisationFactor
scalar evaluateStabilisationFactor() const
evaluate stabilisation factor
Definition: surfaceOptimizer.C:51
Foam::surfaceOptimizer::trias_
const DynList< triFace > & trias_
reference to the triangles forming a simplex
Definition: surfaceOptimizer.H:61
Foam::surfaceOptimizer
Definition: surfaceOptimizer.H:50
Foam::Vector< scalar >
Foam::surfaceOptimizer::optimiseSteepestDescent
scalar optimiseSteepestDescent(const scalar tol)
optimise point position via the steepest descent method
Definition: surfaceOptimizer.C:271
Foam::surfaceOptimizer::pMax_
point pMax_
max position of the bnd box
Definition: surfaceOptimizer.H:67
Foam::surfaceOptimizer::surfaceOptimizer
surfaceOptimizer(const surfaceOptimizer &)
Disallow default bitwise copy construct.
Foam::surfaceOptimizer::evaluateGradients
void evaluateGradients(const scalar &, vector &, tensor &) const
evaluate gradients needed for optimisation
Definition: surfaceOptimizer.C:135
Foam::surfaceOptimizer::optimiseDivideAndConquer
scalar optimiseDivideAndConquer(const scalar tol)
optimise point position using the divide and conquer technique
Definition: surfaceOptimizer.C:208
DynList.H