MOAB: Mesh Oriented datABase
(version 5.4.1)
|
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 (2011) [email protected] 00024 00025 ***************************************************************** */ 00026 00027 /** \file LaplaceWrapper.hpp 00028 * \brief Define LaplaceWrapper class 00029 * \author Jason Kraftcheck 00030 */ 00031 00032 #ifndef MSQ_LAPLACE_WRAPPER_HPP 00033 #define MSQ_LAPLACE_WRAPPER_HPP 00034 00035 #include "Wrapper.hpp" 00036 00037 namespace MBMesquite 00038 { 00039 00040 class LaplaceWrapper : public Wrapper 00041 { 00042 public: 00043 MESQUITE_EXPORT 00044 LaplaceWrapper(); 00045 00046 /**\brief Specify timeout after which untangler will exit 00047 * 00048 * Specify a value less than or equal to zero for no limit 00049 */ 00050 void set_cpu_time_limit( double seconds ) 00051 { 00052 maxTime = seconds; 00053 } 00054 double get_cpu_time_limit() const 00055 { 00056 return maxTime; 00057 } 00058 00059 /**\brief Specify factor by which to minimum distance a vertex must 00060 * move in an iteration to avoid termination of the untangler 00061 * 00062 * Specify a value less than or equal to zero for no limit. 00063 *\NOTE Culling cannot be done w/out a limit on vertex movement 00064 */ 00065 void set_vertex_movement_limit_factor( double f ) 00066 { 00067 movementFactor = f; 00068 } 00069 double get_vertex_movement_limit_factor() const 00070 { 00071 return movementFactor; 00072 } 00073 00074 /**\brief Specify maximum number of iterations. 00075 * 00076 * Specify a value less than or equal to zero for no limit 00077 */ 00078 void set_iteration_limit( int limit ) 00079 { 00080 iterationLimit = limit; 00081 } 00082 int get_iteration_limit() const 00083 { 00084 return iterationLimit; 00085 } 00086 00087 /**\brief Cull vertices based on movement limit */ 00088 inline void enable_culling( bool yesno ) 00089 { 00090 doCulling = yesno; 00091 } 00092 inline bool is_culling_enabled() const 00093 { 00094 return doCulling; 00095 } 00096 00097 MESQUITE_EXPORT 00098 ~LaplaceWrapper(); 00099 00100 protected: 00101 MESQUITE_EXPORT 00102 void run_wrapper( MeshDomainAssoc* mesh_and_domain, 00103 ParallelMesh* pmesh, 00104 Settings* settings, 00105 QualityAssessor* qa, 00106 MsqError& err ); 00107 00108 private: 00109 double maxTime, movementFactor; 00110 int iterationLimit; 00111 bool doCulling; 00112 }; 00113 00114 } // namespace MBMesquite 00115 00116 #endif