MOAB: Mesh Oriented datABase  (version 5.3.1)
MBMesquite::AWShape2DNB1 Class Reference

#include <AWShape2DNB1.hpp>

+ Inheritance diagram for MBMesquite::AWShape2DNB1:
+ Collaboration diagram for MBMesquite::AWShape2DNB1:

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.

Detailed Description

\( |\omega A^t A - \alpha W^t W|^2 \)

Definition at line 42 of file AWShape2DNB1.hpp.


Constructor & Destructor Documentation

Definition at line 45 of file AWShape2DNB1.cpp.

{}

Member Function Documentation

bool MBMesquite::AWShape2DNB1::evaluate ( const MsqMatrix< 2, 2 > &  A,
const MsqMatrix< 2, 2 > &  W,
double &  result,
MsqError err 
) [virtual]

Evaluate \(\mu(A,W)\).

Parameters:
A2x2 active matrix
W2x2 target matrix
resultOutput: value of function
Returns:
false if function cannot be evaluated for given A and W (e.g. division by zero, etc.), true otherwise.

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.

Parameters:
A2x2 active matrix
W2x2 target matrix
resultOutput: value of function
deriv_wrt_AOutput: 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]\]

Returns:
false if function cannot be evaluated for given A and W (e.g. division by zero, etc.), true otherwise.

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";
}

List of all members.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines