volumeOptimizer.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  volumeOptimizer
26 
27 Description
28  Mesh smoothing without any topological changes. The vertex is put into
29  location which minimises the objective function.
30 
31 SourceFiles
32  volumeOptimizer.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef volumeOptimizer_H
37 #define volumeOptimizer_H
38 
39 #include "simplexSmoother.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declarations
47 class partTetMeshSimplex;
48 
49 /*---------------------------------------------------------------------------*\
50  Class volumeOptimizer Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 //- class for volume optimizer
54 class volumeOptimizer
55 :
56  public simplexSmoother
57 {
58  // Private static data
59  //- direction vectors for divide and conquer algorithm
60  static const vector dirVecs[8];
61 
62  // Private member functions
63  //- evaluate functional
64  scalar evaluateFunc() const;
65 
66  //- find appropriate value of K
67  scalar evaluateStabilisationFactor() const;
68 
69  //- evaluate gradients of the functional
70  void evaluateGradientsExact(vector&, tensor&) const;
71 
72  //- optimize position using a divide and conquer algorithm
73  scalar optimiseDivideAndConquer(const scalar tol);
74 
75  //- optimise using the steepest descent
76  scalar optimiseSteepestDescent(const scalar tol);
77 
78  public:
79 
80  // Constructor
81  //- construct from partTetMeshSimplex
83 
84  // Destructor
86 
87  // Member functions
88  //- find the best position for the node
89  void optimizeNodePosition(const scalar tol = 0.001);
90 };
91 
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 } // End namespace Foam
96 
97 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
98 
99 #endif
100 
101 // ************************************************************************* //
Foam::volumeOptimizer::evaluateGradientsExact
void evaluateGradientsExact(vector &, tensor &) const
evaluate gradients of the functional
Definition: volumeOptimizerEvaluateGradients.C:113
Foam::Tensor
Templated 3D tensor derived from VectorSpace adding construction from 9 components,...
Definition: complexI.H:224
Foam::volumeOptimizer::~volumeOptimizer
~volumeOptimizer()
Definition: volumeOptimizer.C:61
Foam::partTetMeshSimplex
Definition: partTetMeshSimplex.H:52
Foam::volumeOptimizer::optimiseSteepestDescent
scalar optimiseSteepestDescent(const scalar tol)
optimise using the steepest descent
Definition: volumeOptimizerEvaluateGradients.C:286
Foam::volumeOptimizer::evaluateStabilisationFactor
scalar evaluateStabilisationFactor() const
find appropriate value of K
Definition: volumeOptimizerEvaluateGradients.C:75
Foam::volumeOptimizer::evaluateFunc
scalar evaluateFunc() const
evaluate functional
Definition: volumeOptimizerEvaluateGradients.C:41
Foam::simplexSmoother
class for volume optimizer
Definition: simplexSmoother.H:56
partTetMeshSimplex
A simplex which is used for smoothing purposes.
Foam::volumeOptimizer
class for volume optimizer
Definition: volumeOptimizer.H:53
Foam::volumeOptimizer::optimizeNodePosition
void optimizeNodePosition(const scalar tol=0.001)
find the best position for the node
Definition: volumeOptimizer.C:67
Foam::volumeOptimizer::dirVecs
static const vector dirVecs[8]
direction vectors for divide and conquer algorithm
Definition: volumeOptimizer.H:59
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::volumeOptimizer::volumeOptimizer
volumeOptimizer(partTetMeshSimplex &simplex)
construct from partTetMeshSimplex
Definition: volumeOptimizer.C:56
Foam::Vector< scalar >
Foam::volumeOptimizer::optimiseDivideAndConquer
scalar optimiseDivideAndConquer(const scalar tol)
optimize position using a divide and conquer algorithm
Definition: volumeOptimizerEvaluateGradients.C:222
simplexSmoother.H