MOAB: Mesh Oriented datABase  (version 5.4.1)
UntangleBetaQualityMetric.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 // -*- Mode : c++; tab-width: 3; c-tab-always-indent: t; indent-tabs-mode: nil; c-basic-offset: 3
00028 // -*-
00029 
00030 /*! \file UntangleBetaQualityMetric.hpp
00031 
00032 Header file for the MBMesquite::UntangleBetaQualityMetric class
00033 
00034   \author Michael Brewer
00035   \date   2002-09-10
00036  */
00037 
00038 #ifndef UNTANGLE_BETA_QUALITY_METRIC_HPP
00039 #define UNTANGLE_BETA_QUALITY_METRIC_HPP
00040 
00041 #include "Mesquite.hpp"
00042 #include "ElementQM.hpp"
00043 #include "AveragingQM.hpp"
00044 namespace MBMesquite
00045 {
00046 /*! \class UntangleBetaQualityMetric
00047   \brief The untangle beta quality metric.
00048 
00049   Given a scalar value beta and local signed element volume alpha_i,
00050   define delta_i to be alpha_i minus beta.  The Untangle beta value
00051   is then defined as square root of the sum over sample points
00052   of the absolute value of delta_i minus delta_i, difference squared.
00053   That is, the root mean square of the difference, abs(delta_i) minus
00054   delta_i.
00055 
00056   The constructor defaults to RMS AveragingMethod and
00057   ELEMENT_VERTICES evaluationMode.  The default beta value is
00058   .05.
00059 */
00060 
00061 class UntangleBetaQualityMetric : public ElementQM, public AveragingQM
00062 {
00063   public:
00064     MESQUITE_EXPORT UntangleBetaQualityMetric( double bet = 0.05 );
00065 
00066     // virtual destructor ensures use of polymorphism during destruction
00067     MESQUITE_EXPORT virtual ~UntangleBetaQualityMetric() {}
00068 
00069     /*!Function to allow users to set the beta value after the
00070       metric has already been created. */
00071     MESQUITE_EXPORT void set_beta( double beta_in )
00072     {
00073         mBeta = beta_in;
00074     }
00075     /*!Function to allow the user to check the value of beta.*/
00076     MESQUITE_EXPORT double get_beta()
00077     {
00078         return mBeta;
00079     }
00080 
00081     MESQUITE_EXPORT virtual std::string get_name() const;
00082 
00083     MESQUITE_EXPORT virtual int get_negate_flag() const;
00084 
00085     MESQUITE_EXPORT virtual bool evaluate( PatchData& pd, size_t handle, double& value, MsqError& err );
00086 
00087   private:
00088     double mBeta;
00089 };
00090 
00091 }  // namespace MBMesquite
00092 
00093 #endif  // UntangleBetaQualityMetric_hpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines