1 /* *****************************************************************
2     MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4     Copyright 2004 Sandia Corporation and Argonne National
5     Laboratory.  Under the terms of Contract DE-AC04-94AL85000
6     with Sandia Corporation, the U.S. Government retains certain
7     rights in 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     diachin2@llnl.gov, djmelan@sandia.gov, mbrewer@sandia.gov,
24     pknupp@sandia.gov, tleurent@mcs.anl.gov, tmunson@mcs.anl.gov
25 
26   ***************************************************************** */
27 /*! \file VertexConditionNumberQualityMetric.hpp
28 
29 Header file for the MBMesquite::VertexConditionNumberQualityMetric class
30 
31   \author Michael Brewer
32   \date   April 14, 2003
33  */
34 
35 
36 #ifndef VertexConditionNumberQualityMetric_hpp
37 #define VertexConditionNumberQualityMetric_hpp
38 
39 #include "Mesquite.hpp"
40 #include "VertexQM.hpp"
41 #include "AveragingQM.hpp"
42 
43 namespace MBMesquite
44 {
45      /*! \class VertexConditionNumberQualityMetric
46        \brief Computes the condition numbers of the corner's of elements
47        connected to the given vertex and then averages those values.
48 
49        The metric does not use the sample point functionality or the
50        compute_weighted_jacobian.  It uses the isotropic ideal
51        element.  This metric does require a feasible region, and
52        the metric needs to be minimized.
53      */
54    class VertexConditionNumberQualityMetric : public VertexQM, public AveragingQM
55    {
56   public:
57      VertexConditionNumberQualityMetric();
58 
59        //! virtual destructor ensures use of polymorphism during destruction
~VertexConditionNumberQualityMetric()60      virtual ~VertexConditionNumberQualityMetric()
61         {}
62 
63 
64      virtual std::string get_name() const;
65 
66       //! 1 if metric should be minimized, -1 if metric should be maximized.
67      virtual int get_negate_flag() const;
68 
69      virtual
70      bool evaluate( PatchData& pd,
71                     size_t handle,
72                     double& value,
73                     MsqError& err );
74 
75      virtual
76      bool evaluate_with_indices( PatchData& pd,
77                     size_t handle,
78                     double& value,
79                     std::vector<size_t>& indices,
80                     MsqError& err );
81   };
82 
83 
84 
85 } //namespace
86 
87 #endif // VertexConditionNumberQualityMetric_hpp
88 
89