Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2010 Sandia National Laboratories. Developed at the
5 : : University of Wisconsin--Madison under SNL contract number
6 : : 624796. The U.S. Government and the University of Wisconsin
7 : : retain certain rights to 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 : : (2010) [email protected]
24 : :
25 : : ***************************************************************** */
26 : :
27 : : /** \file ShapeImprover.hpp
28 : : * \brief
29 : : * \author Jason Kraftcheck
30 : : */
31 : :
32 : : #ifndef MSQ_SHAPE_IMPROVER_HPP
33 : : #define MSQ_SHAPE_IMPROVER_HPP
34 : :
35 : : #include "Mesquite.hpp"
36 : : #include "Wrapper.hpp"
37 : :
38 : : namespace MBMesquite
39 : : {
40 : :
41 : : /**\brief Wrapper that implements TMP-based shape improvement
42 : : */
43 [ - + ]: 4 : class ShapeImprover : public Wrapper
44 : : {
45 : :
46 : : public:
47 : : MESQUITE_EXPORT
48 : : ShapeImprover();
49 : :
50 : : /*\brief Set limit on seconds of CPU time
51 : : *
52 : : * Default is no limit on CPU time.
53 : : */
54 : : MESQUITE_EXPORT
55 : : void set_cpu_time_limit( double seconds );
56 : :
57 : : /*\brief Set mean edge length factor for termination
58 : : *
59 : : * Optimization will cease when, for a given iteration,
60 : : * no vertex is moved more than beta * (mean - sigma)
61 : : * where mean is the average edge length of the initial mesh
62 : : * and sigma is the standard deviation of the edge lengths
63 : : * in the initial mesh. beta is the value passed to this
64 : : * function. beta must be greater than zero and less than one.
65 : : * The default value for beta is 10 percent of the meshes
66 : : * minimum edge length.
67 : : */
68 : : MESQUITE_EXPORT
69 : : void set_vertex_movement_limit_factor( double beta );
70 : :
71 : : MESQUITE_EXPORT
72 : : void set_parallel_iterations( int count );
73 : :
74 : : protected:
75 : : MESQUITE_EXPORT
76 : : void run_wrapper( MeshDomainAssoc* mesh_and_domain, ParallelMesh* pmesh, Settings* settings, QualityAssessor* qa,
77 : : MsqError& err );
78 : :
79 : : private:
80 : : double maxTime, mBeta;
81 : : int parallelIterations;
82 : : };
83 : :
84 : : } // namespace MBMesquite
85 : :
86 : : #endif
|