MOAB: Mesh Oriented datABase  (version 5.4.1)
QualityImprover.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   QualityImprover.hpp
00029   \brief
00030 
00031   The Quality Improver Class is the base class for all the algorythms
00032 
00033   \author Thomas Leurent
00034   \date   2002-01-17
00035 */
00036 
00037 #ifndef Mesquite_QualityImprover_hpp
00038 #define Mesquite_QualityImprover_hpp
00039 
00040 #include <string>
00041 
00042 #include "Mesquite.hpp"
00043 #include "Instruction.hpp"
00044 #include "TerminationCriterion.hpp"
00045 
00046 namespace MBMesquite
00047 {
00048 class PatchSet;
00049 class MsqError;
00050 class Mesh;
00051 class MeshDomain;
00052 class Settings;
00053 
00054 /*! \class QualityImprover
00055   \brief Base class for all quality improvers.
00056   Mote that the PatchData settings are inherited from the PathDataUser class.
00057 
00058 */
00059 class MESQUITE_EXPORT QualityImprover : public Instruction
00060 {
00061   public:
00062     // Constructor is protected ... see below.
00063 
00064     // virtual destructor ensures use of polymorphism during destruction
00065     virtual ~QualityImprover();
00066 
00067     //! Sets in the termination criterion for the concrete solver's
00068     //! optimization.
00069     void set_inner_termination_criterion( TerminationCriterion* crit )
00070     {
00071         innerTerminationCriterion = crit;
00072     }
00073     //! Sets in the termination criterion for the outer loop over
00074     //! patches.
00075     void set_outer_termination_criterion( TerminationCriterion* crit )
00076     {
00077         outerTerminationCriterion = crit;
00078     }
00079 
00080     virtual PatchSet* get_patch_set() = 0;
00081 
00082     virtual void initialize_queue( MeshDomainAssoc* mesh_and_domain, const Settings* settings, MsqError& err );
00083 
00084   protected:
00085     /*! The default constructor initialises a few member variables
00086         to default values.
00087         This can be reused by concrete class constructor. */
00088     QualityImprover();
00089 
00090     //! return the outer termination criterion pointer
00091     TerminationCriterion* get_outer_termination_criterion()
00092     {
00093         return outerTerminationCriterion;
00094     }
00095     //! return the inner termination criterion pointer
00096     TerminationCriterion* get_inner_termination_criterion()
00097     {
00098         return innerTerminationCriterion;
00099     }
00100 
00101   private:
00102     TerminationCriterion* innerTerminationCriterion;
00103     TerminationCriterion* outerTerminationCriterion;
00104     // default TerminationCriterion for outer loop will be set in constructor
00105     TerminationCriterion* defaultOuterCriterion;
00106     // default TerminationCriterion for inner loop set by concrete improver
00107     TerminationCriterion* defaultInnerCriterion;
00108 };
00109 
00110 }  // namespace MBMesquite
00111 
00112 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines