MOAB: Mesh Oriented datABase
(version 5.4.1)
|
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 PowerQualityMetric.hpp 00031 \brief 00032 Header file for the MBMesquite::PowerQualityMetric class 00033 00034 \author Michael Brewer 00035 \date 2002-09-05 00036 */ 00037 00038 #ifndef PowerQualityMetric_hpp 00039 #define PowerQualityMetric_hpp 00040 00041 #include "Mesquite.hpp" 00042 #include "QualityMetric.hpp" 00043 #include "Exponent.hpp" 00044 00045 namespace MBMesquite 00046 { 00047 class MsqError; 00048 class Vector3D; 00049 00050 /*! \class PowerQualityMetric 00051 \brief Raises a single quality metrics (qMetric1) to an arbitrary 00052 power (a double value, scaleAlpha) for two- and three-diminsional 00053 elements. 00054 */ 00055 class PowerQualityMetric : public QualityMetric 00056 { 00057 public: 00058 /*! Ensures that qm1 is not NULL. If qm1 is only valid 00059 on a certain feasible, then the composite metric has the same 00060 constraint. The composite metric also has the same negate flag 00061 as qm1. 00062 */ 00063 PowerQualityMetric( QualityMetric* qm1, double pow_double ); 00064 00065 // virtual destructor ensures use of polymorphism during destruction 00066 virtual ~PowerQualityMetric(); 00067 00068 MetricType get_metric_type() const 00069 { 00070 return mMetric.get_metric_type(); 00071 } 00072 00073 std::string get_name() const; 00074 00075 int get_negate_flag() const; 00076 00077 QualityMetric* get_metric() const 00078 { 00079 return &mMetric; 00080 } 00081 00082 virtual void get_evaluations( PatchData& pd, 00083 std::vector< size_t >& handles, 00084 bool free_vertices_only, 00085 MsqError& err ); 00086 00087 virtual bool evaluate( PatchData& pd, size_t handle, double& value, MsqError& err ); 00088 00089 virtual bool evaluate_with_indices( PatchData& pd, 00090 size_t handle, 00091 double& value, 00092 std::vector< size_t >& indices, 00093 MsqError& err ); 00094 00095 virtual bool evaluate_with_gradient( PatchData& pd, 00096 size_t handle, 00097 double& value, 00098 std::vector< size_t >& indices, 00099 std::vector< Vector3D >& gradient, 00100 MsqError& err ); 00101 00102 virtual bool evaluate_with_Hessian( PatchData& pd, 00103 size_t handle, 00104 double& value, 00105 std::vector< size_t >& indices, 00106 std::vector< Vector3D >& gradient, 00107 std::vector< Matrix3D >& Hessian, 00108 MsqError& err ); 00109 00110 private: 00111 QualityMetric& mMetric; 00112 MBMesquite::Exponent mPower; 00113 }; 00114 00115 } // namespace MBMesquite 00116 00117 #endif // PowerQualityMetric_hpp