MOAB: Mesh Oriented datABase  (version 5.3.1)
UntangleWrapper.hpp
Go to the documentation of this file.
00001 /* *****************************************************************
00002     MESQUITE -- The Mesh Quality Improvement Toolkit
00003 
00004     Copyright 2010 Sandia National Laboratories.  Developed at the
00005     University of Wisconsin--Madison under SNL contract number
00006     624796.  The U.S. Government and the University of Wisconsin
00007     retain certain rights to 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     (2010) kraftche@cae.wisc.edu
00024 
00025   ***************************************************************** */
00026 
00027 /** \file UntangleWrapper.hpp
00028  *  \brief
00029  *  \author Jason Kraftcheck
00030  */
00031 
00032 #ifndef MSQ_UNTANGLE_WRAPPER_HPP
00033 #define MSQ_UNTANGLE_WRAPPER_HPP
00034 
00035 #include "Mesquite.hpp"
00036 #include "Wrapper.hpp"
00037 
00038 namespace MBMesquite
00039 {
00040 
00041 /**\brief Wrapper that implements several TMP-based untanglers */
00042 class UntangleWrapper : public Wrapper
00043 {
00044 
00045   public:
00046     /**\brief Which quality metric to use */
00047     enum UntangleMetric
00048     {
00049         BETA,      //!< Use TMP UntangleBeta metric
00050         SIZE,      //!< Use UntangleMu(TargetSize}
00051         SHAPESIZE  //!< Use UntangleMu(TargetShapeSize}
00052     };
00053 
00054     /**\brief Specify which untangle metric to use */
00055     MESQUITE_EXPORT
00056     void set_untangle_metric( UntangleMetric metric );
00057 
00058     /**\brief Specify constant value for untangle metric */
00059     MESQUITE_EXPORT
00060     void set_metric_constant( double value );
00061 
00062     /**\brief Specify timeout after which untangler will exit */
00063     MESQUITE_EXPORT
00064     void set_cpu_time_limit( double seconds );
00065 
00066     /**\brief Specify max number of outer iterations after which untangler will exit */
00067     MESQUITE_EXPORT
00068     void set_outer_iteration_limit( int maxIt );
00069 
00070     /**\brief Specify factor by which to minimum distance a vertex must
00071      *        move in an iteration to avoid termination of the untangler */
00072     MESQUITE_EXPORT
00073     void set_vertex_movement_limit_factor( double f );
00074 
00075     MESQUITE_EXPORT
00076     UntangleWrapper();
00077 
00078     MESQUITE_EXPORT
00079     UntangleWrapper( UntangleMetric m );
00080 
00081     MESQUITE_EXPORT
00082     ~UntangleWrapper();
00083 
00084     /**\brief Check if vertex culling will be used */
00085     inline bool is_culling_enabled() const
00086     {
00087         return doCulling;
00088     }
00089 
00090     /**\brief Enable vertex culling */
00091     inline void enable_culling( bool yesno )
00092     {
00093         doCulling = yesno;
00094     }
00095 
00096     /**\brief Check if a Jacobi optimization strategy will be used */
00097     inline bool is_jacobi_optimization() const
00098     {
00099         return doJacobi;
00100     }
00101 
00102     /**\brief Check if a Gauss optimization strategy will be used */
00103     inline bool is_gauss_optimization() const
00104     {
00105         return !doJacobi;
00106     }
00107 
00108     /**\brief Use a Jacobi optimization strategy */
00109     inline void do_jacobi_optimization()
00110     {
00111         doJacobi = true;
00112     }
00113 
00114     /**\brief Use a Gauss optimization strategy */
00115     inline void do_gauss_optimization()
00116     {
00117         doJacobi = false;
00118     }
00119 
00120   protected:
00121     MESQUITE_EXPORT
00122     void run_wrapper( MeshDomainAssoc* mesh_and_domain, ParallelMesh* pmesh, Settings* settings, QualityAssessor* qa,
00123                       MsqError& err );
00124 
00125   private:
00126     UntangleMetric qualityMetric;
00127     double maxTime, movementFactor, metricConstant;
00128     int maxIterations;
00129     bool doCulling, doJacobi;
00130 };
00131 
00132 }  // namespace MBMesquite
00133 
00134 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines