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.cpp
28 : : * \brief
29 : : * \author Jason Kraftcheck
30 : : */
31 : :
32 : : #include "Mesquite.hpp"
33 : : #include "TMetricBarrier.hpp"
34 : : #include "TMixed.hpp"
35 : : #include "MsqMatrix.hpp"
36 : : #include "MsqError.hpp"
37 : : #include <sstream>
38 : :
39 : : namespace MBMesquite
40 : : {
41 : :
42 : 6 : std::string TMixed::get_name() const
43 : : {
44 [ + - ]: 6 : std::ostringstream name;
45 [ + - ][ + - ]: 12 : name << "2D:" << mu2D->get_name() << "; "
[ + - ][ + - ]
46 [ + - ][ + - ]: 18 : << "3D:" << mu3D->get_name();
[ + - ]
47 [ + - ]: 6 : return name.str();
48 : : }
49 : :
50 [ - + ]: 46 : TMixed::~TMixed() {}
51 : :
52 : 830588 : bool TMixed::evaluate( const MsqMatrix< 2, 2 >& T, double& result, MsqError& err )
53 : : {
54 : 830588 : bool rval = mu2D->evaluate( T, result, err );
55 [ - + ][ # # ]: 830588 : MSQ_ERRZERO( err );
[ - + ]
56 : 830588 : return rval;
57 : : }
58 : :
59 : 0 : bool TMixed::evaluate( const MsqMatrix< 3, 3 >& T, double& result, MsqError& err )
60 : : {
61 : 0 : bool rval = mu3D->evaluate( T, result, err );
62 [ # # ][ # # ]: 0 : MSQ_ERRZERO( err );
[ # # ]
63 : 0 : return rval;
64 : : }
65 : :
66 : 429216 : bool TMixed::evaluate_with_grad( const MsqMatrix< 2, 2 >& T, double& result, MsqMatrix< 2, 2 >& deriv_wrt_T,
67 : : MsqError& err )
68 : : {
69 : 429216 : bool rval = mu2D->evaluate_with_grad( T, result, deriv_wrt_T, err );
70 [ - + ][ # # ]: 429216 : MSQ_ERRZERO( err );
[ - + ]
71 : 429216 : return rval;
72 : : }
73 : :
74 : 0 : bool TMixed::evaluate_with_grad( const MsqMatrix< 3, 3 >& T, double& result, MsqMatrix< 3, 3 >& deriv_wrt_T,
75 : : MsqError& err )
76 : : {
77 : 0 : bool rval = mu3D->evaluate_with_grad( T, result, deriv_wrt_T, err );
78 [ # # ][ # # ]: 0 : MSQ_ERRZERO( err );
[ # # ]
79 : 0 : return rval;
80 : : }
81 : :
82 : 0 : bool TMixed::evaluate_with_hess( const MsqMatrix< 2, 2 >& T, double& result, MsqMatrix< 2, 2 >& deriv_wrt_T,
83 : : MsqMatrix< 2, 2 > second_wrt_T[3], MsqError& err )
84 : : {
85 : 0 : bool rval = mu2D->evaluate_with_hess( T, result, deriv_wrt_T, second_wrt_T, err );
86 [ # # ][ # # ]: 0 : MSQ_ERRZERO( err );
[ # # ]
87 : 0 : return rval;
88 : : }
89 : :
90 : 0 : bool TMixed::evaluate_with_hess( const MsqMatrix< 3, 3 >& T, double& result, MsqMatrix< 3, 3 >& deriv_wrt_T,
91 : : MsqMatrix< 3, 3 > second_wrt_T[3], MsqError& err )
92 : : {
93 : 0 : bool rval = mu3D->evaluate_with_hess( T, result, deriv_wrt_T, second_wrt_T, err );
94 [ # # ][ # # ]: 0 : MSQ_ERRZERO( err );
[ # # ]
95 : 0 : return rval;
96 : : }
97 : :
98 [ + - ][ + - ]: 12 : } // namespace MBMesquite
|