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