MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <AWUntangleBeta.hpp>
Public Member Functions | |
MESQUITE_EXPORT | AWUntangleBeta (double gamma=0.5) |
virtual MESQUITE_EXPORT | ~AWUntangleBeta () |
virtual MESQUITE_EXPORT std::string | get_name () const |
virtual MESQUITE_EXPORT bool | evaluate (const MsqMatrix< 2, 2 > &A, const MsqMatrix< 2, 2 > &W, double &result, MsqError &err) |
Evaluate \(\mu(A,W)\). | |
virtual MESQUITE_EXPORT bool | evaluate (const MsqMatrix< 3, 3 > &A, const MsqMatrix< 3, 3 > &W, double &result, MsqError &err) |
Evaluate \(\mu(A,W)\). | |
virtual MESQUITE_EXPORT bool | evaluate_with_grad (const MsqMatrix< 2, 2 > &A, const MsqMatrix< 2, 2 > &W, double &result, MsqMatrix< 2, 2 > &deriv_wrt_A, MsqError &err) |
Gradient of \(\mu(A,W)\) with respect to components of A. | |
virtual MESQUITE_EXPORT bool | evaluate_with_grad (const MsqMatrix< 3, 3 > &A, const MsqMatrix< 3, 3 > &W, double &result, MsqMatrix< 3, 3 > &deriv_wrt_A, MsqError &err) |
Gradient of \(\mu(A,W)\) with respect to components of A. | |
Private Member Functions | |
template<unsigned D> | |
bool | eval (const MsqMatrix< D, D > &A, const MsqMatrix< D, D > &W, double &result) |
template<unsigned D> | |
bool | grad (const MsqMatrix< D, D > &A, const MsqMatrix< D, D > &W, double &result, MsqMatrix< D, D > &first) |
Private Attributes | |
double | mGamma |
\( \left\{ |\alpha - \gamma \, \omega| - ( \alpha - \gamma \, \omega ) \right\}^p \)
Definition at line 42 of file AWUntangleBeta.hpp.
MESQUITE_EXPORT MBMesquite::AWUntangleBeta::AWUntangleBeta | ( | double | gamma = 0.5 | ) | [inline] |
Definition at line 49 of file AWUntangleBeta.hpp.
: mGamma( gamma ) {}
MBMesquite::AWUntangleBeta::~AWUntangleBeta | ( | ) | [virtual] |
Definition at line 46 of file AWUntangleBeta.cpp.
{}
bool MBMesquite::AWUntangleBeta::eval | ( | const MsqMatrix< DIM, DIM > & | A, |
const MsqMatrix< DIM, DIM > & | W, | ||
double & | result | ||
) | [inline, private] |
Definition at line 51 of file AWUntangleBeta.cpp.
References MBMesquite::det(), mGamma, and MBMesquite::P.
virtual MESQUITE_EXPORT bool MBMesquite::AWUntangleBeta::evaluate | ( | const MsqMatrix< 2, 2 > & | A, |
const MsqMatrix< 2, 2 > & | W, | ||
double & | result, | ||
MsqError & | err | ||
) | [virtual] |
Evaluate \(\mu(A,W)\).
A | 2x2 active matrix |
W | 2x2 target matrix |
result | Output: value of function |
Reimplemented from MBMesquite::AWMetric.
virtual MESQUITE_EXPORT bool MBMesquite::AWUntangleBeta::evaluate | ( | const MsqMatrix< 3, 3 > & | A, |
const MsqMatrix< 3, 3 > & | W, | ||
double & | result, | ||
MsqError & | err | ||
) | [virtual] |
Evaluate \(\mu(A,W)\).
A | 3x3 active matrix |
W | 3x3 target matrix |
result | Output: value of function |
Reimplemented from MBMesquite::AWMetric.
virtual MESQUITE_EXPORT bool MBMesquite::AWUntangleBeta::evaluate_with_grad | ( | const MsqMatrix< 2, 2 > & | A, |
const MsqMatrix< 2, 2 > & | W, | ||
double & | result, | ||
MsqMatrix< 2, 2 > & | deriv_wrt_A, | ||
MsqError & | err | ||
) | [virtual] |
Gradient of \(\mu(A,W)\) with respect to components of A.
A | 2x2 active matrix |
W | 2x2 target matrix |
result | Output: value of function |
deriv_wrt_A | Output: partial deriviatve of \(\mu\) wrt each term of A, evaluated at passed A. \[\left[\begin{array}{cc} \frac{\partial\mu}{\partial A_{0,0}} & \frac{\partial\mu}{\partial A_{0,1}} \\ \frac{\partial\mu}{\partial A_{1,0}} & \frac{\partial\mu}{\partial A_{1,1}} \\ \end{array}\right]\] |
Reimplemented from MBMesquite::AWMetric.
virtual MESQUITE_EXPORT bool MBMesquite::AWUntangleBeta::evaluate_with_grad | ( | const MsqMatrix< 3, 3 > & | A, |
const MsqMatrix< 3, 3 > & | W, | ||
double & | result, | ||
MsqMatrix< 3, 3 > & | deriv_wrt_A, | ||
MsqError & | err | ||
) | [virtual] |
Gradient of \(\mu(A,W)\) with respect to components of A.
A | 3x3 active matrix |
W | 3x3 target matrix |
result | Output: value of function |
deriv_wrt_A | Output: partial deriviatve of \(\mu\) wrt each term of A, evaluated at passed A. \[\left[\begin{array}{ccc} \frac{\partial\mu}{\partial A_{0,0}} & \frac{\partial\mu}{\partial A_{0,1}} & \frac{\partial\mu}{\partial A_{0,2}} \\ \frac{\partial\mu}{\partial A_{1,0}} & \frac{\partial\mu}{\partial A_{1,1}} & \frac{\partial\mu}{\partial A_{1,2}} \\ \frac{\partial\mu}{\partial A_{2,0}} & \frac{\partial\mu}{\partial A_{2,1}} & \frac{\partial\mu}{\partial A_{2,2}} \end{array}\right]\] |
Reimplemented from MBMesquite::AWMetric.
std::string MBMesquite::AWUntangleBeta::get_name | ( | ) | const [virtual] |
Implements MBMesquite::AWMetric.
Definition at line 41 of file AWUntangleBeta.cpp.
{ return "AWUntangleBeta"; }
bool MBMesquite::AWUntangleBeta::grad | ( | const MsqMatrix< DIM, DIM > & | A, |
const MsqMatrix< DIM, DIM > & | W, | ||
double & | result, | ||
MsqMatrix< DIM, DIM > & | first | ||
) | [inline, private] |
Definition at line 65 of file AWUntangleBeta.cpp.
References MBMesquite::det(), mGamma, MBMesquite::P, and MBMesquite::transpose_adj().
{ const double alpha = det( A ); const double omega = det( W ); double tmp = 2 * ( mGamma * omega - alpha ); if( tmp < 0.0 ) { result = 0.0; deriv = MsqMatrix< DIM, DIM >( 0.0 ); return true; } double prod = 1.0; for( int i = 1; i < P; ++i ) prod *= tmp; result = prod * tmp; deriv = -2 * P * prod * transpose_adj( A ); return true; }
double MBMesquite::AWUntangleBeta::mGamma [private] |
Definition at line 45 of file AWUntangleBeta.hpp.