Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2004 Sandia Corporation and Argonne National
5 : : Laboratory. Under the terms of Contract DE-AC04-94AL85000
6 : : with Sandia Corporation, the U.S. Government retains certain
7 : : rights in this software.
8 : :
9 : : This library is free software; you can redistribute it and/or
10 : : modify it under the terms of the GNU Lesser General Public
11 : : License as published by the Free Software Foundation; either
12 : : version 2.1 of the License, or (at your option) any later version.
13 : :
14 : : This library is distributed in the hope that it will be useful,
15 : : but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : : MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 : : Lesser General Public License for more details.
18 : :
19 : : You should have received a copy of the GNU Lesser General Public License
20 : : (lgpl.txt) along with this library; if not, write to the Free Software
21 : : Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 : :
23 : : [email protected], [email protected], [email protected],
24 : : [email protected], [email protected], [email protected]
25 : :
26 : : ***************************************************************** */
27 : : /*!
28 : : \file SteepestDescent.hpp
29 : : \brief
30 : :
31 : : The SteepestDescent Class implements the steepest descent algorithm in
32 : : order to move a free vertex to an optimal position given an
33 : : ObjectiveFunction object and a QualityMetric object.
34 : :
35 : : \author Thomas Leurent
36 : : \date 2002-06-13
37 : : */
38 : :
39 : : #ifndef Mesquite_SteepestDescent_hpp
40 : : #define Mesquite_SteepestDescent_hpp
41 : :
42 : : #include "Mesquite.hpp"
43 : : #include "VertexMover.hpp"
44 : : #include "PatchSetUser.hpp"
45 : :
46 : : namespace MBMesquite
47 : : {
48 : : class ObjectiveFunction;
49 : :
50 : : /*! \class SteepestDescent
51 : :
52 : : This is a very basic implementation of the steepest descent optimization algorythm.
53 : : */
54 : : class SteepestDescent : public VertexMover, public PatchSetUser
55 : : {
56 : : public:
57 : : MESQUITE_EXPORT
58 : : SteepestDescent( ObjectiveFunction* of );
59 : :
60 [ - + ]: 56 : MESQUITE_EXPORT virtual ~SteepestDescent() {}
61 : :
62 : : MESQUITE_EXPORT virtual std::string get_name() const;
63 : :
64 : : MESQUITE_EXPORT virtual PatchSet* get_patch_set();
65 : :
66 : : MESQUITE_EXPORT
67 : : bool project_gradient() const
68 : : {
69 : : return projectGradient;
70 : : }
71 : :
72 : : MESQUITE_EXPORT
73 : : void project_gradient( bool yesno )
74 : : {
75 : : projectGradient = yesno;
76 : : }
77 : :
78 : : // bool cosine_projection_step() const
79 : : // { return cosineStep; }
80 : : //
81 : : // void cosine_projection_step( bool yesno )
82 : : // { cosineStep = yesno; }
83 : :
84 : : protected:
85 : : MESQUITE_EXPORT virtual void initialize( PatchData& pd, MsqError& err );
86 : : MESQUITE_EXPORT virtual void optimize_vertex_positions( PatchData& pd, MsqError& err );
87 : : MESQUITE_EXPORT virtual void initialize_mesh_iteration( PatchData& pd, MsqError& err );
88 : : MESQUITE_EXPORT virtual void terminate_mesh_iteration( PatchData& pd, MsqError& err );
89 : : MESQUITE_EXPORT virtual void cleanup();
90 : :
91 : : private:
92 : : bool projectGradient;
93 : : // bool cosineStep;
94 : : SteepestDescent( const SteepestDescent& pd ); // disable copying
95 : : SteepestDescent& operator=( const SteepestDescent& pd ); // disable assignment
96 : : };
97 : :
98 : : } // namespace MBMesquite
99 : :
100 : : #endif
|