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

A metric for comparing a matrix A with a target matrix W. More...

#include <AWMetric.hpp>

Inheritance diagram for MBMesquite::AWMetric:

## Public Member Functions

virtual MESQUITE_EXPORT ~AWMetric ()
virtual MESQUITE_EXPORT std::string get_name () const =0
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 (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< 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_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.
virtual MESQUITE_EXPORT bool evaluate_with_hess (const MsqMatrix< 2, 2 > &A, const MsqMatrix< 2, 2 > &W, double &result, MsqMatrix< 2, 2 > &deriv_wrt_A, MsqMatrix< 2, 2 > second_wrt_A[3], MsqError &err)
Hessian of $$\mu(A,W)$$ with respect to components of A.
virtual MESQUITE_EXPORT bool evaluate_with_hess (const MsqMatrix< 3, 3 > &A, const MsqMatrix< 3, 3 > &W, double &result, MsqMatrix< 3, 3 > &deriv_wrt_A, MsqMatrix< 3, 3 > second_wrt_A[6], MsqError &err)
Hessian of $$\mu(A,W)$$ with respect to components of A.

## Static Public Member Functions

static bool invalid_determinant (double d)

## Detailed Description

A metric for comparing a matrix A with a target matrix W.

Implement a scalar function $$\mu(A,W)$$ where A and W are 2x2 or 3x3 matrices.

Definition at line 49 of file AWMetric.hpp.

## Constructor & Destructor Documentation

 MBMesquite::AWMetric::~AWMetric ( )  [virtual]

Definition at line 193 of file AWMetric.cpp.

{}


## Member Function Documentation

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

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

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

Definition at line 195 of file AWMetric.cpp.

{
return false;
}

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

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

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

Definition at line 201 of file AWMetric.cpp.

{
return false;
}

 bool MBMesquite::AWMetric::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:
 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]$
Returns:
false if function cannot be evaluated for given A and W (e.g. division by zero, etc.), true otherwise.

Definition at line 207 of file AWMetric.cpp.

{
return do_numerical_gradient( this, A, W, result, wrt_A, err );
}

 bool MBMesquite::AWMetric::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:
 A 3x3 active matrix W 3x3 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}{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.

Definition at line 213 of file AWMetric.cpp.

{
return do_numerical_gradient( this, A, W, result, wrt_A, err );
}

 bool MBMesquite::AWMetric::evaluate_with_hess ( const MsqMatrix< 2, 2 > & A, const MsqMatrix< 2, 2 > & W, double & result, MsqMatrix< 2, 2 > & deriv_wrt_A, MsqMatrix< 2, 2 > second_wrt_A[3], MsqError & err )  [virtual]

Hessian of $$\mu(A,W)$$ with respect to components of A.

Parameters:
 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. second_wrt_A Output: 4x4 matrix of second partial deriviatve of $$\mu$$ wrt each term of A, in row-major order. The symmetric matrix is decomposed into 2x2 blocks and only the upper diagonal blocks, in row-major order, are returned. $\left[\begin{array}{cc|cc} \frac{\partial^{2}\mu}{\partial A_{0,0}^2} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{0,1}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{1,0}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{1,1}} \\ \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{0,1}} & \frac{\partial^{2}\mu}{\partial A_{0,1}^2} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{1,0}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{1,1}} \\ \hline & & \frac{\partial^{2}\mu}{\partial A_{1,0}^2} & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{1,1}} \\ & & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{1,1}} & \frac{\partial^{2}\mu}{\partial A_{1,1}^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 in HessTestMetricAbs_2, MBMesquite::AWShapeSizeOrientNB1, and MBMesquite::AWSizeNB1.

Definition at line 219 of file AWMetric.cpp.

References MBMesquite::do_numerical_hessian().

{
return do_numerical_hessian( this, A, W, result, deriv_wrt_A, hess_wrt_A, err );
}

 bool MBMesquite::AWMetric::evaluate_with_hess ( const MsqMatrix< 3, 3 > & A, const MsqMatrix< 3, 3 > & W, double & result, MsqMatrix< 3, 3 > & deriv_wrt_A, MsqMatrix< 3, 3 > second_wrt_A[6], MsqError & err )  [virtual]

Hessian of $$\mu(A,W)$$ with respect to components of A.

Parameters:
 A 3x3 active matrix W 3x3 target matrix result Output: value of function deriv_wrt_A Output: partial deriviatve of $$\mu$$ wrt each term of A, evaluated at passed A. second_wrt_A Output: 9x9 matrix of second partial deriviatve of $$\mu$$ wrt each term of A, in row-major order. The symmetric matrix is decomposed into 3x3 blocks and only the upper diagonal blocks, in row-major order, are returned. $\left[\begin{array}{ccc|ccc|ccc} \frac{\partial^{2}\mu}{\partial A_{0,0}^2} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{0,1}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{0,2}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{1,0}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{1,1}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{2,0}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{2,2}} \\ \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{0,1}} & \frac{\partial^{2}\mu}{\partial A_{0,1}^2} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{0,2}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{1,0}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{1,1}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{2,0}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{2,2}} \\ \frac{\partial^{2}\mu}{\partial A_{0,0}\partial A_{0,2}} & \frac{\partial^{2}\mu}{\partial A_{0,1}\partial A_{0,2}} & \frac{\partial^{2}\mu}{\partial A_{0,2}^2} & \frac{\partial^{2}\mu}{\partial A_{0,2}\partial A_{1,0}} & \frac{\partial^{2}\mu}{\partial A_{0,2}\partial A_{1,1}} & \frac{\partial^{2}\mu}{\partial A_{0,2}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{0,2}\partial A_{2,0}} & \frac{\partial^{2}\mu}{\partial A_{0,2}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{0,2}\partial A_{2,2}} \\ \hline & & & \frac{\partial^{2}\mu}{\partial A_{1,0}^2} & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{1,1}} & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{2,0}} & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{2,2}} \\ & & & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{1,1}} & \frac{\partial^{2}\mu}{\partial A_{1,1}^2} & \frac{\partial^{2}\mu}{\partial A_{1,1}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{1,1}\partial A_{2,0}} & \frac{\partial^{2}\mu}{\partial A_{1,1}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{1,1}\partial A_{2,2}} \\ & & & \frac{\partial^{2}\mu}{\partial A_{1,0}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{1,1}\partial A_{1,2}} & \frac{\partial^{2}\mu}{\partial A_{1,2}^2} & \frac{\partial^{2}\mu}{\partial A_{1,2}\partial A_{2,0}} & \frac{\partial^{2}\mu}{\partial A_{1,2}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{1,2}\partial A_{2,2}} \\ \hline & & & & & & \frac{\partial^{2}\mu}{\partial A_{2,0}^2} & \frac{\partial^{2}\mu}{\partial A_{2,0}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{2,0}\partial A_{2,2}} \\ & & & & & & \frac{\partial^{2}\mu}{\partial A_{2,0}\partial A_{2,1}} & \frac{\partial^{2}\mu}{\partial A_{2,1}^2} & \frac{\partial^{2}\mu}{\partial A_{2,1}\partial A_{2,2}} \\ & & & & & & \frac{\partial^{2}\mu}{\partial A_{2,0}\partial A_{2,2}} & \frac{\partial^{2}\mu}{\partial A_{2,1}\partial A_{2,2}} & \frac{\partial^{2}\mu}{\partial A_{2,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 in HessTestMetricAbs_2, MBMesquite::AWShapeSizeOrientNB1, and MBMesquite::AWSizeNB1.

Definition at line 225 of file AWMetric.cpp.

References MBMesquite::do_numerical_hessian().

{
return do_numerical_hessian( this, A, W, result, deriv_wrt_A, hess_wrt_A, err );
}

 virtual MESQUITE_EXPORT std::string MBMesquite::AWMetric::get_name ( ) const [pure virtual]
 static bool MBMesquite::AWMetric::invalid_determinant ( double d )  [inline, static]

Reimplemented in MBMesquite::AWMetricBarrier, and MBMesquite::AWMetricNonBarrier.

Definition at line 237 of file AWMetric.hpp.

    {
return d < 1e-12;
}


List of all members.

The documentation for this class was generated from the following files: