MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <AWShape2DNB2.hpp>
Public Member Functions | |
virtual MESQUITE_EXPORT | ~AWShape2DNB2 () |
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_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. |
\( |A(adj \, W) - [W ( adj\, A )]^t|^2 \)
Definition at line 42 of file AWShape2DNB2.hpp.
MBMesquite::AWShape2DNB2::~AWShape2DNB2 | ( | ) | [virtual] |
Definition at line 45 of file AWShape2DNB2.cpp.
{}
bool MBMesquite::AWShape2DNB2::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.
Definition at line 47 of file AWShape2DNB2.cpp.
References MBMesquite::adj(), MBMesquite::det(), and MBMesquite::sqr_Frobenius().
{ result = sqr_Frobenius( A * adj( W ) ); result += sqr_Frobenius( W * adj( A ) ); result -= 4 * det( A ) * det( W ); return true; }
bool MBMesquite::AWShape2DNB2::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.
Definition at line 55 of file AWShape2DNB2.cpp.
References MBMesquite::adj(), MBMesquite::det(), MBMesquite::sqr_Frobenius(), and MBMesquite::transpose().
{ const double alpha = det( A ); const double omega = det( W ); const MsqMatrix< 2, 2 > adjA = adj( A ); result = sqr_Frobenius( A * adj( W ) ); result += sqr_Frobenius( W * adjA ); result -= 4 * alpha * omega; deriv_wrt_A = A * adj( transpose( W ) * W ); deriv_wrt_A -= omega * transpose( adjA ); deriv_wrt_A *= 4; return true; }
std::string MBMesquite::AWShape2DNB2::get_name | ( | ) | const [virtual] |
Reimplemented from MBMesquite::AWMetricNonBarrier.
Definition at line 40 of file AWShape2DNB2.cpp.
{ return "AWShape2DNB2"; }