MOAB: Mesh Oriented datABase  (version 5.4.1)
GradTestMetricAbs Class Reference
+ Inheritance diagram for GradTestMetricAbs:
+ Collaboration diagram for GradTestMetricAbs:

Public Member Functions

std::string get_name () const
bool evaluate (const MsqMatrix< 2, 2 > &A, const MsqMatrix< 2, 2 > &W, double &result, MsqError &)
 Evaluate \(\mu(A,W)\).
bool evaluate (const MsqMatrix< 3, 3 > &A, const MsqMatrix< 3, 3 > &W, double &result, MsqError &)
 Evaluate \(\mu(A,W)\).

Static Public Member Functions

static double grad (int r, int c)

Detailed Description

Definition at line 61 of file AWMetricTest.cpp.


Member Function Documentation

bool GradTestMetricAbs::evaluate ( const MsqMatrix< 2, 2 > &  A,
const MsqMatrix< 2, 2 > &  W,
double &  result,
MsqError err 
) [inline, 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 74 of file AWMetricTest.cpp.

References MBMesquite::grad().

Referenced by AWMetricTest::test_numerical_gradient_2D(), and AWMetricTest::test_numerical_gradient_3D().

    {
        result = 0;
        for( int r = 0; r < 2; ++r )
            for( int c = 0; c < 2; ++c )
                result += grad( r, c ) * ( A( r, c ) - W( r, c ) );
        return true;
    }
bool GradTestMetricAbs::evaluate ( const MsqMatrix< 3, 3 > &  A,
const MsqMatrix< 3, 3 > &  W,
double &  result,
MsqError err 
) [inline, 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 83 of file AWMetricTest.cpp.

References MBMesquite::grad().

    {
        result = 0;
        for( int r = 0; r < 3; ++r )
            for( int c = 0; c < 3; ++c )
                result += grad( r, c ) * ( A( r, c ) - W( r, c ) );
        return true;
    }
std::string GradTestMetricAbs::get_name ( ) const [inline, virtual]

Implements MBMesquite::AWMetric.

Definition at line 64 of file AWMetricTest.cpp.

    {
        return "GradTest";
    }
static double GradTestMetricAbs::grad ( int  r,
int  c 
) [inline, static]

Definition at line 69 of file AWMetricTest.cpp.

Referenced by AWMetricTest::test_numerical_gradient_2D(), and AWMetricTest::test_numerical_gradient_3D().

    {
        return 3 * r + c + 1;
    }

List of all members.


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