MOAB: Mesh Oriented datABase  (version 5.2.1)
MBMesquite::AWShape2DNB2 Class Reference

#include <AWShape2DNB2.hpp>

+ Inheritance diagram for MBMesquite::AWShape2DNB2:
+ Collaboration diagram for MBMesquite::AWShape2DNB2:

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.

Detailed Description

\( |A(adj \, W) - [W ( adj\, A )]^t|^2 \)

Definition at line 42 of file AWShape2DNB2.hpp.


Constructor & Destructor Documentation

Definition at line 45 of file AWShape2DNB2.cpp.

{}

Member Function Documentation

bool MBMesquite::AWShape2DNB2::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 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.

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

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