MOAB: Mesh Oriented datABase  (version 5.4.1)
SteepestDescent.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2004 Sandia Corporation and Argonne National
00005     Laboratory.  Under the terms of Contract DE-AC04-94AL85000
00006     with Sandia Corporation, the U.S. Government retains certain
00007     rights in this software.
00008 
00009     This library is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU Lesser General Public
00011     License as published by the Free Software Foundation; either
00012     version 2.1 of the License, or (at your option) any later version.
00013 
00014     This library is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017     Lesser General Public License for more details.
00018 
00019     You should have received a copy of the GNU Lesser General Public License
00020     (lgpl.txt) along with this library; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023     [email protected], [email protected], [email protected],
00024     [email protected], [email protected], [email protected]
00025 
00026   ***************************************************************** */
00027 /*!
00028   \file   SteepestDescent.hpp
00029   \brief
00030 
00031   The SteepestDescent Class implements the steepest descent algorithm in
00032   order to move a free vertex to an optimal position given an
00033   ObjectiveFunction object and a QualityMetric object.
00034 
00035   \author Thomas Leurent
00036   \date   2002-06-13
00037 */
00038 
00039 #ifndef Mesquite_SteepestDescent_hpp
00040 #define Mesquite_SteepestDescent_hpp
00041 
00042 #include "Mesquite.hpp"
00043 #include "VertexMover.hpp"
00044 #include "PatchSetUser.hpp"
00045 
00046 namespace MBMesquite
00047 {
00048 class ObjectiveFunction;
00049 
00050 /*! \class SteepestDescent
00051 
00052     This is a very basic implementation of the steepest descent optimization algorythm.
00053  */
00054 class SteepestDescent : public VertexMover, public PatchSetUser
00055 {
00056   public:
00057     MESQUITE_EXPORT
00058     SteepestDescent( ObjectiveFunction* of );
00059 
00060     MESQUITE_EXPORT virtual ~SteepestDescent() {}
00061 
00062     MESQUITE_EXPORT virtual std::string get_name() const;
00063 
00064     MESQUITE_EXPORT virtual PatchSet* get_patch_set();
00065 
00066     MESQUITE_EXPORT
00067     bool project_gradient() const
00068     {
00069         return projectGradient;
00070     }
00071 
00072     MESQUITE_EXPORT
00073     void project_gradient( bool yesno )
00074     {
00075         projectGradient = yesno;
00076     }
00077 
00078     // bool cosine_projection_step() const
00079     //  { return cosineStep; }
00080     //
00081     // void cosine_projection_step( bool yesno )
00082     //  { cosineStep = yesno; }
00083 
00084   protected:
00085     MESQUITE_EXPORT virtual void initialize( PatchData& pd, MsqError& err );
00086     MESQUITE_EXPORT virtual void optimize_vertex_positions( PatchData& pd, MsqError& err );
00087     MESQUITE_EXPORT virtual void initialize_mesh_iteration( PatchData& pd, MsqError& err );
00088     MESQUITE_EXPORT virtual void terminate_mesh_iteration( PatchData& pd, MsqError& err );
00089     MESQUITE_EXPORT virtual void cleanup();
00090 
00091   private:
00092     bool projectGradient;
00093     // bool cosineStep;
00094     SteepestDescent( const SteepestDescent& pd );             // disable copying
00095     SteepestDescent& operator=( const SteepestDescent& pd );  // disable assignment
00096 };
00097 
00098 }  // namespace MBMesquite
00099 
00100 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines