MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::AWSizeB1 Class Reference

#include <AWSizeB1.hpp>

+ Inheritance diagram for MBMesquite::AWSizeB1:
+ Collaboration diagram for MBMesquite::AWSizeB1:

Public Member Functions

virtual MESQUITE_EXPORT ~AWSizeB1 ()
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.
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< 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.

Detailed Description

\( \frac{\alpha}{\omega} - \frac{\omega}{\alpha} - 2 \)

Definition at line 43 of file AWSizeB1.hpp.


Constructor & Destructor Documentation

Definition at line 47 of file AWSizeB1.cpp.

{}

Member Function Documentation

bool MBMesquite::AWSizeB1::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 49 of file AWSizeB1.cpp.

References MBMesquite::MsqError::BARRIER_VIOLATED, MBMesquite::barrier_violated_msg_aw, MBMesquite::det(), MBMesquite::AWMetric::invalid_determinant(), and MSQ_SETERR.

{
    const double alpha = det( A );
    const double omega = det( W );
    const double prod  = alpha * omega;
    if( AWMetric::invalid_determinant( prod ) )
    {
        MSQ_SETERR( err )( barrier_violated_msg_aw, MsqError::BARRIER_VIOLATED );
        return false;
    }

    result = ( alpha - omega );
    result *= result;
    result /= prod;
    return true;
}
bool MBMesquite::AWSizeB1::evaluate ( const MsqMatrix< 3, 3 > &  A,
const MsqMatrix< 3, 3 > &  W,
double &  result,
MsqError err 
) [virtual]

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

Parameters:
A3x3 active matrix
W3x3 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 89 of file AWSizeB1.cpp.

References MBMesquite::MsqError::BARRIER_VIOLATED, MBMesquite::barrier_violated_msg_aw, MBMesquite::det(), MBMesquite::AWMetric::invalid_determinant(), and MSQ_SETERR.

{
    const double alpha = det( A );
    const double omega = det( W );
    const double prod  = alpha * omega;
    if( AWMetric::invalid_determinant( prod ) )
    {
        MSQ_SETERR( err )( barrier_violated_msg_aw, MsqError::BARRIER_VIOLATED );
        return false;
    };

    result = ( alpha - omega );
    result *= result;
    result /= prod;
    return true;
}
bool MBMesquite::AWSizeB1::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 66 of file AWSizeB1.cpp.

References MBMesquite::MsqError::BARRIER_VIOLATED, MBMesquite::barrier_violated_msg_aw, MBMesquite::det(), MBMesquite::AWMetric::invalid_determinant(), MSQ_SETERR, and MBMesquite::transpose_adj().

{
    const double alpha = det( A );
    const double omega = det( W );
    const double prod  = alpha * omega;
    if( AWMetric::invalid_determinant( prod ) )
    {
        MSQ_SETERR( err )( barrier_violated_msg_aw, MsqError::BARRIER_VIOLATED );
        return false;
    }

    result = ( alpha - omega );
    result *= result;
    result /= prod;
    deriv_wrt_A = transpose_adj( A );
    deriv_wrt_A *= ( alpha * alpha - omega * omega ) / ( alpha * prod );
    return true;
}
bool MBMesquite::AWSizeB1::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.

Parameters:
A3x3 active matrix
W3x3 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}{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]\]

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 106 of file AWSizeB1.cpp.

References MBMesquite::MsqError::BARRIER_VIOLATED, MBMesquite::barrier_violated_msg_aw, MBMesquite::det(), MBMesquite::AWMetric::invalid_determinant(), MSQ_SETERR, and MBMesquite::transpose_adj().

{
    const double alpha = det( A );
    const double omega = det( W );
    const double prod  = alpha * omega;
    if( AWMetric::invalid_determinant( prod ) )
    {
        MSQ_SETERR( err )( barrier_violated_msg_aw, MsqError::BARRIER_VIOLATED );
        return false;
    }

    result = ( alpha - omega );
    result *= result;
    result /= prod;
    deriv_wrt_A = transpose_adj( A );
    deriv_wrt_A *= ( alpha * alpha - omega * omega ) / ( alpha * prod );
    return true;
}
std::string MBMesquite::AWSizeB1::get_name ( ) const [virtual]

Reimplemented from MBMesquite::AWMetricBarrier.

Definition at line 42 of file AWSizeB1.cpp.

{
    return "AWSizeB1";
}

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