Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2007 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 : : (2007) [email protected]
24 : :
25 : : ***************************************************************** */
26 : :
27 : : /** \file AffineMapMetric.hpp
28 : : * \brief
29 : : * \author Jason Kraftcheck
30 : : */
31 : :
32 : : #ifndef MSQ_AFFINE_MAP_METRIC_HPP
33 : : #define MSQ_AFFINE_MAP_METRIC_HPP
34 : :
35 : : #include "Mesquite.hpp"
36 : : #include "ElemSampleQM.hpp"
37 : :
38 : : namespace MBMesquite
39 : : {
40 : :
41 : : class TargetCalculator;
42 : : class WeightCalculator;
43 : : class TMetric;
44 : : template < unsigned R, unsigned C >
45 : : class MsqMatrix;
46 : :
47 : : /**\brief Compare targets to affine map to ideal element.
48 : : *
49 : : * A quality metric defined using 2D and 3D target metrics,
50 : : * where the active (A) matrix is an affine map to the ideal,
51 : : * unit-side element.
52 : : */
53 [ - + ]: 18 : class AffineMapMetric : public ElemSampleQM
54 : : {
55 : : public:
56 : : MESQUITE_EXPORT
57 : : AffineMapMetric( TargetCalculator* tc, WeightCalculator* wc, TMetric* target_metric );
58 : :
59 : : MESQUITE_EXPORT
60 : : AffineMapMetric( TargetCalculator* tc, TMetric* target_metric );
61 : :
62 : : MESQUITE_EXPORT virtual std::string get_name() const;
63 : :
64 : : MESQUITE_EXPORT virtual int get_negate_flag() const;
65 : :
66 : : MESQUITE_EXPORT virtual void get_evaluations( PatchData& pd, std::vector< size_t >& handles,
67 : : bool free_vertices_only, MsqError& err );
68 : :
69 : : MESQUITE_EXPORT virtual void get_element_evaluations( PatchData& pd, size_t elem_index,
70 : : std::vector< size_t >& handles, MsqError& err );
71 : :
72 : : MESQUITE_EXPORT virtual bool evaluate( PatchData& pd, size_t handle, double& value, MsqError& err );
73 : :
74 : : MESQUITE_EXPORT virtual bool evaluate_with_indices( PatchData& pd, size_t handle, double& value,
75 : : std::vector< size_t >& indices, MsqError& err );
76 : :
77 : : void set_target_calculator( TargetCalculator* tc )
78 : : {
79 : : targetCalc = tc;
80 : : }
81 : 2 : void set_weight_calculator( WeightCalculator* wc )
82 : : {
83 : 2 : weightCalc = wc;
84 : 2 : }
85 : : TargetCalculator* get_target_calculator() const
86 : : {
87 : : return targetCalc;
88 : : }
89 : : WeightCalculator* get_weight_calculator() const
90 : : {
91 : : return weightCalc;
92 : : }
93 : :
94 : : TMetric* get_target_metric() const
95 : : {
96 : : return targetMetric;
97 : : }
98 : : void set_target_metric( TMetric* m )
99 : : {
100 : : targetMetric = m;
101 : : }
102 : :
103 : : private:
104 : : TargetCalculator* targetCalc;
105 : : WeightCalculator* weightCalc;
106 : : TMetric* targetMetric;
107 : : };
108 : :
109 : : } // namespace MBMesquite
110 : :
111 : : #endif
|