Branch data Line data Source code
1 : : /* *****************************************************************
2 : : MESQUITE -- The Mesh Quality Improvement Toolkit
3 : :
4 : : Copyright 2009 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 : : (2009) [email protected]
24 : :
25 : : ***************************************************************** */
26 : :
27 : : /** \file TMixed.hpp
28 : : * \brief
29 : : * \author Jason Kraftcheck
30 : : */
31 : :
32 : : #ifndef MSQ_T_MIXED_HPP
33 : : #define MSQ_T_MIXED_HPP
34 : :
35 : : #include "Mesquite.hpp"
36 : : #include "TMetric.hpp"
37 : :
38 : : namespace MBMesquite
39 : : {
40 : :
41 : : /** \brief Use different target metrics for surface and volume elements
42 : : *
43 : : * This class can be used to set up a quality metric for which the
44 : : * target metric is different for surface elements than the one used
45 : : * for volume elements. It is typicallly used to set up an optimization
46 : : * using target metrics that aren't implemented for both topological
47 : : * dimemensions of elements.
48 : : */
49 : : class TMixed : public TMetric
50 : : {
51 : : TMetric* mu2D;
52 : : TMetric* mu3D;
53 : :
54 : : public:
55 : 46 : TMixed( TMetric* mu_2d, TMetric* mu_3d ) : mu2D( mu_2d ), mu3D( mu_3d ) {}
56 : :
57 : : MESQUITE_EXPORT virtual ~TMixed();
58 : :
59 : : MESQUITE_EXPORT virtual std::string get_name() const;
60 : :
61 : : MESQUITE_EXPORT virtual bool evaluate( const MsqMatrix< 2, 2 >& T, double& result, MsqError& err );
62 : :
63 : : MESQUITE_EXPORT virtual bool evaluate_with_grad( const MsqMatrix< 2, 2 >& T, double& result,
64 : : MsqMatrix< 2, 2 >& deriv_wrt_T, MsqError& err );
65 : :
66 : : MESQUITE_EXPORT virtual bool evaluate_with_hess( const MsqMatrix< 2, 2 >& T, double& result,
67 : : MsqMatrix< 2, 2 >& deriv_wrt_T, MsqMatrix< 2, 2 > second_wrt_T[3],
68 : : MsqError& err );
69 : :
70 : : MESQUITE_EXPORT virtual bool evaluate( const MsqMatrix< 3, 3 >& T, double& result, MsqError& err );
71 : :
72 : : MESQUITE_EXPORT virtual bool evaluate_with_grad( const MsqMatrix< 3, 3 >& T, double& result,
73 : : MsqMatrix< 3, 3 >& deriv_wrt_T, MsqError& err );
74 : :
75 : : MESQUITE_EXPORT virtual bool evaluate_with_hess( const MsqMatrix< 3, 3 >& T, double& result,
76 : : MsqMatrix< 3, 3 >& deriv_wrt_T, MsqMatrix< 3, 3 > second_wrt_T[6],
77 : : MsqError& err );
78 : : };
79 : :
80 : : } // namespace MBMesquite
81 : :
82 : : #endif
|