MOAB: Mesh Oriented datABase  (version 5.4.1)
moab::VerdictWrapper Class Reference

#include <VerdictWrapper.hpp>

+ Collaboration diagram for moab::VerdictWrapper:

Public Member Functions

 VerdictWrapper (Interface *mb)
virtual ~VerdictWrapper ()
ErrorCode quality_measure (EntityHandle eh, QualityType q, double &quality, int num_nodes=0, EntityType etype=MBMAXTYPE, double *coords=NULL)
 return a quality for an entity
const char * quality_name (QualityType q)
 return a quality name
const char * entity_type_name (EntityType etype)
 return a string with entity type name
int num_qualities (EntityType etype)
 return an int with total available qualities for type
int possible_quality (EntityType et, QualityType q)
 return true if quality possible
ErrorCode set_size (double size)
ErrorCode all_quality_measures (EntityHandle eh, std::map< QualityType, double > &qualities)
 return all qualities for an element

Private Attributes

InterfacembImpl

Detailed Description

Examples:
LaplacianSmoother.cpp.

Definition at line 131 of file VerdictWrapper.hpp.


Constructor & Destructor Documentation

Definition at line 15 of file VerdictWrapper.cpp.

                                              : mbImpl( mb )
{
    // TODO Auto-generated constructor stub
}

Definition at line 20 of file VerdictWrapper.cpp.

{
    // TODO Auto-generated destructor stub
}

Member Function Documentation

ErrorCode moab::VerdictWrapper::all_quality_measures ( EntityHandle  eh,
std::map< QualityType, double > &  qualities 
)

return all qualities for an element

compute all qualities for an element

Parameters:
ehelement entity handle.
qslist of QualityType
qualitieslist of qualities return MB_SUCCESS Example:
      EntityHandle hex;
      std::vector<QualityType> qs;
      std::vector<double> qualities;
      all_quality_measures(hex, qs, qualities); 

Definition at line 507 of file VerdictWrapper.cpp.

References QuadMetricVals::area, TriMetricVals::area, TetMetricVals::aspect_beta, TetMetricVals::aspect_frobenius, TriMetricVals::aspect_frobenius, TetMetricVals::aspect_gamma, QuadMetricVals::aspect_ratio, TetMetricVals::aspect_ratio, TriMetricVals::aspect_ratio, TetMetricVals::collapse_ratio, HexMetricVals::condition, QuadMetricVals::condition, TetMetricVals::condition, TriMetricVals::condition, HexMetricVals::diagonal, HexMetricVals::dimension, HexMetricVals::distortion, QuadMetricVals::distortion, TetMetricVals::distortion, TriMetricVals::distortion, HexMetricVals::edge_ratio, QuadMetricVals::edge_ratio, TetMetricVals::edge_ratio, TriMetricVals::edge_ratio, ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), HexMetricVals::jacobian, QuadMetricVals::jacobian, TetMetricVals::jacobian, QuadMetricVals::max_aspect_frobenius, HexMetricVals::max_edge_ratio, QuadMetricVals::max_edge_ratio, QuadMetricVals::maximum_angle, TriMetricVals::maximum_angle, moab::MB_AREA, moab::MB_ASPECT_BETA, moab::MB_ASPECT_GAMMA, moab::MB_ASPECT_RATIO, moab::MB_COLLAPSE_RATIO, moab::MB_CONDITION, moab::MB_DIAGONAL, moab::MB_DIMENSION, moab::MB_DISTORTION, moab::MB_EDGE_RATIO, moab::MB_JACOBIAN, moab::MB_LENGTH, moab::MB_MAX_ASPECT_FROBENIUS, moab::MB_MAX_EDGE_RATIO, moab::MB_MAXIMUM_ANGLE, moab::MB_MED_ASPECT_FROBENIUS, moab::MB_MINIMUM_ANGLE, MB_NOT_IMPLEMENTED, moab::MB_ODDY, moab::MB_RADIUS_RATIO, moab::MB_RELATIVE_SIZE_SQUARED, moab::MB_SCALED_JACOBIAN, moab::MB_SHAPE, moab::MB_SHAPE_AND_SIZE, moab::MB_SHEAR, moab::MB_SHEAR_AND_SIZE, moab::MB_SKEW, moab::MB_STRETCH, MB_SUCCESS, moab::MB_TAPER, moab::MB_VOLUME, moab::MB_WARPAGE, MBEDGE, MBENTITYSET, MBHEX, mbImpl, MBKNIFE, MBPOLYHEDRON, MBPRISM, MBQUAD, MBTET, MBTRI, MBVERTEX, HexMetricVals::med_aspect_frobenius, QuadMetricVals::med_aspect_frobenius, QuadMetricVals::minimum_angle, TetMetricVals::minimum_angle, TriMetricVals::minimum_angle, HexMetricVals::oddy, QuadMetricVals::oddy, QuadMetricVals::radius_ratio, TetMetricVals::radius_ratio, TriMetricVals::radius_ratio, HexMetricVals::relative_size_squared, QuadMetricVals::relative_size_squared, TetMetricVals::relative_size_squared, TriMetricVals::relative_size_squared, HexMetricVals::scaled_jacobian, QuadMetricVals::scaled_jacobian, TetMetricVals::scaled_jacobian, TriMetricVals::scaled_jacobian, HexMetricVals::shape, QuadMetricVals::shape, TetMetricVals::shape, TriMetricVals::shape, HexMetricVals::shape_and_size, QuadMetricVals::shape_and_size, TetMetricVals::shape_and_size, TriMetricVals::shape_and_size, HexMetricVals::shear, QuadMetricVals::shear, HexMetricVals::shear_and_size, QuadMetricVals::shear_and_size, HexMetricVals::skew, QuadMetricVals::skew, HexMetricVals::stretch, QuadMetricVals::stretch, HexMetricVals::taper, QuadMetricVals::taper, moab::TYPE_FROM_HANDLE(), v_edge_length(), V_HEX_ALL, v_hex_quality(), v_knife_volume(), V_QUAD_ALL, v_quad_quality(), V_TET_ALL, v_tet_quality(), V_TRI_ALL, v_tri_quality(), v_wedge_volume(), HexMetricVals::volume, TetMetricVals::volume, and QuadMetricVals::warpage.

Referenced by main(), and verdict_test1().

{
    EntityType etype = TYPE_FROM_HANDLE( eh );
    if( etype == MBPOLYHEDRON || etype == MBVERTEX || etype == MBENTITYSET )
        return MB_SUCCESS;  // no quality for polyhedron or vertex or set

    double coordinates[27][3];  // at most 27 nodes per element
    // get coordinates of points, if not passed already
    const EntityHandle* conn = NULL;
    int num_nodes;
    ErrorCode rval = mbImpl->get_connectivity( eh, conn, num_nodes );
    if( rval != MB_SUCCESS ) return rval;
    rval = mbImpl->get_coords( conn, num_nodes, &( coordinates[0][0] ) );
    if( rval != MB_SUCCESS ) return rval;

    switch( etype )
    {
        case MBEDGE: {
            double leng          = v_edge_length( 2, coordinates );
            qualities[MB_LENGTH] = leng;
            break;
        }
        case MBHEX: {
            num_nodes = 8;
            HexMetricVals hexMetric;
            v_hex_quality( num_nodes, coordinates, V_HEX_ALL, &hexMetric );
            qualities[MB_EDGE_RATIO]           = hexMetric.edge_ratio;
            qualities[MB_MAX_EDGE_RATIO]       = hexMetric.max_edge_ratio;
            qualities[MB_SKEW]                 = hexMetric.skew;
            qualities[MB_TAPER]                = hexMetric.taper;
            qualities[MB_VOLUME]               = hexMetric.volume;
            qualities[MB_STRETCH]              = hexMetric.stretch;
            qualities[MB_DIAGONAL]             = hexMetric.diagonal;
            qualities[MB_DIMENSION]            = hexMetric.dimension;
            qualities[MB_ODDY]                 = hexMetric.oddy;
            qualities[MB_MED_ASPECT_FROBENIUS] = hexMetric.med_aspect_frobenius;
            // MB_CONDITION is the same as MB_MAX_ASPECT_FROBENIUS
            qualities[MB_MAX_ASPECT_FROBENIUS]  = hexMetric.condition;
            qualities[MB_CONDITION]             = hexMetric.condition;
            qualities[MB_JACOBIAN]              = hexMetric.jacobian;
            qualities[MB_SCALED_JACOBIAN]       = hexMetric.scaled_jacobian;
            qualities[MB_SHEAR]                 = hexMetric.shear;
            qualities[MB_SHAPE]                 = hexMetric.shape;
            qualities[MB_RELATIVE_SIZE_SQUARED] = hexMetric.relative_size_squared;
            qualities[MB_SHAPE_AND_SIZE]        = hexMetric.shape_and_size;
            qualities[MB_SHEAR_AND_SIZE]        = hexMetric.shear_and_size;
            qualities[MB_DISTORTION]            = hexMetric.distortion;
            break;
        }

        case MBTET: {
            num_nodes = 4;
            TetMetricVals tetMetrics;
            v_tet_quality( num_nodes, coordinates, V_TET_ALL, &tetMetrics );
            qualities[MB_EDGE_RATIO]            = tetMetrics.edge_ratio;
            qualities[MB_RADIUS_RATIO]          = tetMetrics.radius_ratio;
            qualities[MB_ASPECT_BETA]           = tetMetrics.aspect_beta;
            qualities[MB_ASPECT_RATIO]          = tetMetrics.aspect_ratio;
            qualities[MB_ASPECT_GAMMA]          = tetMetrics.aspect_gamma;
            qualities[MB_MAX_ASPECT_FROBENIUS]  = tetMetrics.aspect_frobenius;
            qualities[MB_MINIMUM_ANGLE]         = tetMetrics.minimum_angle;
            qualities[MB_COLLAPSE_RATIO]        = tetMetrics.collapse_ratio;
            qualities[MB_VOLUME]                = tetMetrics.volume;
            qualities[MB_CONDITION]             = tetMetrics.condition;
            qualities[MB_JACOBIAN]              = tetMetrics.jacobian;
            qualities[MB_SCALED_JACOBIAN]       = tetMetrics.scaled_jacobian;
            qualities[MB_SHAPE]                 = tetMetrics.shape;
            qualities[MB_RELATIVE_SIZE_SQUARED] = tetMetrics.relative_size_squared;
            qualities[MB_SHAPE_AND_SIZE]        = tetMetrics.shape_and_size;
            qualities[MB_DISTORTION]            = tetMetrics.distortion;
            break;
        }
        case MBPRISM: {
            num_nodes            = 6;
            double volu          = v_wedge_volume( num_nodes, coordinates );
            qualities[MB_VOLUME] = volu;
            break;
        }
        case MBKNIFE: {
            num_nodes            = 7;
            double volu          = v_knife_volume( num_nodes, coordinates );
            qualities[MB_VOLUME] = volu;
            break;
        }
        case MBQUAD: {
            num_nodes = 4;
            QuadMetricVals quadMetrics;
            v_quad_quality( num_nodes, coordinates, V_QUAD_ALL, &quadMetrics );
            qualities[MB_EDGE_RATIO]            = quadMetrics.edge_ratio;
            qualities[MB_MAX_EDGE_RATIO]        = quadMetrics.max_edge_ratio;
            qualities[MB_ASPECT_RATIO]          = quadMetrics.aspect_ratio;           // 23
            qualities[MB_RADIUS_RATIO]          = quadMetrics.radius_ratio;           // 21
            qualities[MB_MED_ASPECT_FROBENIUS]  = quadMetrics.med_aspect_frobenius;   // 9
            qualities[MB_MAX_ASPECT_FROBENIUS]  = quadMetrics.max_aspect_frobenius;   // 10
            qualities[MB_SKEW]                  = quadMetrics.skew;                   // 2
            qualities[MB_TAPER]                 = quadMetrics.taper;                  // 3
            qualities[MB_WARPAGE]               = quadMetrics.warpage;                // 27
            qualities[MB_AREA]                  = quadMetrics.area;                   // 28
            qualities[MB_STRETCH]               = quadMetrics.stretch;                // 5
            qualities[MB_MINIMUM_ANGLE]         = quadMetrics.minimum_angle;          // 25
            qualities[MB_MAXIMUM_ANGLE]         = quadMetrics.maximum_angle;          // 29
            qualities[MB_ODDY]                  = quadMetrics.oddy;                   // 8
            qualities[MB_CONDITION]             = quadMetrics.condition;              // 11
            qualities[MB_JACOBIAN]              = quadMetrics.jacobian;               // 12
            qualities[MB_SCALED_JACOBIAN]       = quadMetrics.scaled_jacobian;        // 13
            qualities[MB_SHEAR]                 = quadMetrics.shear;                  // 14
            qualities[MB_SHAPE]                 = quadMetrics.shape;                  // 15
            qualities[MB_RELATIVE_SIZE_SQUARED] = quadMetrics.relative_size_squared;  // 16
            qualities[MB_SHAPE_AND_SIZE]        = quadMetrics.shape_and_size;         // 17
            qualities[MB_SHEAR_AND_SIZE]        = quadMetrics.shear_and_size;         // 18
            qualities[MB_DISTORTION]            = quadMetrics.distortion;             // 19
            break;
        }

        case MBTRI: {
            num_nodes = 3;
            TriMetricVals triMetrics;
            v_tri_quality( num_nodes, coordinates, V_TRI_ALL, &triMetrics );
            qualities[MB_EDGE_RATIO]           = triMetrics.edge_ratio;        // 0
            qualities[MB_ASPECT_RATIO]         = triMetrics.aspect_ratio;      // 23
            qualities[MB_RADIUS_RATIO]         = triMetrics.radius_ratio;      // 21
            qualities[MB_MAX_ASPECT_FROBENIUS] = triMetrics.aspect_frobenius;  // 10
            qualities[MB_AREA]                 = triMetrics.area;              // 28
            qualities[MB_MINIMUM_ANGLE]        = triMetrics.minimum_angle;     // 25
            qualities[MB_MAXIMUM_ANGLE]        = triMetrics.maximum_angle;     // 29
            qualities[MB_CONDITION]            = triMetrics.condition;         // 11
            qualities[MB_SCALED_JACOBIAN]      = triMetrics.scaled_jacobian;   // 13
            // does not exist, even though it was defined in verdict.h; remove it from there too
            // case MB_SHEAR:                func = v_tri_shear; break;                  // 14
            qualities[MB_RELATIVE_SIZE_SQUARED] = triMetrics.relative_size_squared;  // 16
            qualities[MB_SHAPE]                 = triMetrics.shape;                  // 15
            qualities[MB_SHAPE_AND_SIZE]        = triMetrics.shape_and_size;         // 17
            qualities[MB_DISTORTION]            = triMetrics.distortion;             // 19
            break;
        }
        default:
            return MB_NOT_IMPLEMENTED;
    }
    return MB_SUCCESS;
}
const char * moab::VerdictWrapper::entity_type_name ( EntityType  etype)

return a string with entity type name

Definition at line 483 of file VerdictWrapper.cpp.

References moab::nameType.

Referenced by main().

{
    return nameType[etype];
}
int moab::VerdictWrapper::num_qualities ( EntityType  etype)

return an int with total available qualities for type

Definition at line 487 of file VerdictWrapper.cpp.

References moab::numQualities.

Referenced by main().

{
    return numQualities[etype];
}
int moab::VerdictWrapper::possible_quality ( EntityType  et,
QualityType  q 
)

return true if quality possible

Definition at line 491 of file VerdictWrapper.cpp.

References moab::possibleQuality.

Referenced by main().

{
    return possibleQuality[et][q];
}
ErrorCode moab::VerdictWrapper::quality_measure ( EntityHandle  eh,
QualityType  q,
double &  quality,
int  num_nodes = 0,
EntityType  etype = MBMAXTYPE,
double *  coords = NULL 
)

return a quality for an entity

compute the quality for an element; the coordinates and number of nodes can be passed if available

Parameters:
ehelement entity handle.
qquality requested
qualityoutput
num_nodesoptional, number of vertices
coordsoptions, interleaved coordinates return MB_SUCCESS Example:
    EntityHandle hex;
    double jac;
    rval = quality_measure(hex, MB_JACOBIAN, jac); 

Definition at line 140 of file VerdictWrapper.cpp.

References ErrorCode, moab::Interface::get_connectivity(), moab::Interface::get_coords(), moab::MB_AREA, moab::MB_ASPECT_BETA, moab::MB_ASPECT_GAMMA, moab::MB_ASPECT_RATIO, moab::MB_COLLAPSE_RATIO, moab::MB_CONDITION, moab::MB_DIAGONAL, moab::MB_DIMENSION, moab::MB_DISTORTION, moab::MB_EDGE_RATIO, moab::MB_JACOBIAN, moab::MB_LENGTH, moab::MB_MAX_ASPECT_FROBENIUS, moab::MB_MAX_EDGE_RATIO, moab::MB_MAXIMUM_ANGLE, moab::MB_MED_ASPECT_FROBENIUS, moab::MB_MINIMUM_ANGLE, MB_NOT_IMPLEMENTED, moab::MB_ODDY, moab::MB_RADIUS_RATIO, moab::MB_RELATIVE_SIZE_SQUARED, moab::MB_SCALED_JACOBIAN, moab::MB_SHAPE, moab::MB_SHAPE_AND_SIZE, moab::MB_SHEAR, moab::MB_SHEAR_AND_SIZE, moab::MB_SKEW, moab::MB_STRETCH, MB_SUCCESS, moab::MB_TAPER, moab::MB_VOLUME, moab::MB_WARPAGE, MBEDGE, MBHEX, mbImpl, MBKNIFE, MBPOLYHEDRON, MBPRISM, MBQUAD, MBTET, MBTRI, moab::possibleQuality, moab::TYPE_FROM_HANDLE(), v_edge_length(), v_hex_condition(), v_hex_diagonal(), v_hex_dimension(), v_hex_distortion(), v_hex_edge_ratio(), v_hex_jacobian(), v_hex_max_aspect_frobenius(), v_hex_max_edge_ratio(), v_hex_med_aspect_frobenius(), v_hex_oddy(), v_hex_relative_size_squared(), v_hex_scaled_jacobian(), v_hex_shape(), v_hex_shape_and_size(), v_hex_shear(), v_hex_shear_and_size(), v_hex_skew(), v_hex_stretch(), v_hex_taper(), v_hex_volume(), v_knife_volume(), v_quad_area(), v_quad_aspect_ratio(), v_quad_condition(), v_quad_distortion(), v_quad_edge_ratio(), v_quad_jacobian(), v_quad_max_aspect_frobenius(), v_quad_max_edge_ratio(), v_quad_maximum_angle(), v_quad_med_aspect_frobenius(), v_quad_minimum_angle(), v_quad_oddy(), v_quad_radius_ratio(), v_quad_relative_size_squared(), v_quad_scaled_jacobian(), v_quad_shape(), v_quad_shape_and_size(), v_quad_shear(), v_quad_shear_and_size(), v_quad_skew(), v_quad_stretch(), v_quad_taper(), v_quad_warpage(), v_tet_aspect_beta(), v_tet_aspect_frobenius(), v_tet_aspect_gamma(), v_tet_aspect_ratio(), v_tet_collapse_ratio(), v_tet_condition(), v_tet_distortion(), v_tet_edge_ratio(), v_tet_jacobian(), v_tet_minimum_angle(), v_tet_radius_ratio(), v_tet_relative_size_squared(), v_tet_scaled_jacobian(), v_tet_shape(), v_tet_shape_and_size(), v_tet_volume(), v_tri_area(), v_tri_aspect_frobenius(), v_tri_aspect_ratio(), v_tri_condition(), v_tri_distortion(), v_tri_edge_ratio(), v_tri_maximum_angle(), v_tri_minimum_angle(), v_tri_radius_ratio(), v_tri_relative_size_squared(), v_tri_scaled_jacobian(), v_tri_shape(), v_tri_shape_and_size(), and v_wedge_volume().

Referenced by get_max_volume(), perform_laplacian_smoothing(), verdict_test1(), and verdict_unit_tests().

{
    double coordinates[27][3];  // at most 27 nodes per element

    if( 0 == num_nodes && NULL == coords )
    {
        etype = TYPE_FROM_HANDLE( eh );
        if( possibleQuality[etype][q] == 0 ) return MB_NOT_IMPLEMENTED;

        // get coordinates of points, if not passed already
        const EntityHandle* conn = NULL;
        // int num_nodes;
        ErrorCode rval = mbImpl->get_connectivity( eh, conn, num_nodes );
        if( rval != MB_SUCCESS ) return rval;
        if( etype != MBPOLYHEDRON )
        {
            rval = mbImpl->get_coords( conn, num_nodes, &( coordinates[0][0] ) );
            if( rval != MB_SUCCESS ) return rval;
        }
    }
    else
    {
        if( num_nodes > 27 ) return MB_FAILURE;
        for( int i = 0; i < num_nodes; i++ )
        {
            for( int j = 0; j < 3; j++ )
                coordinates[i][j] = coords[3 * i + j];
        }
    }
    VerdictFunction func = 0;

    switch( etype )
    {
        case MBHEX: {
            num_nodes = 8;
            switch( q )
            {
                case MB_EDGE_RATIO:
                    func = v_hex_edge_ratio;
                    break;  // 0
                case MB_MAX_EDGE_RATIO:
                    func = v_hex_max_edge_ratio;
                    break;  // 1
                case MB_SKEW:
                    func = v_hex_skew;
                    break;  // 2
                case MB_TAPER:
                    func = v_hex_taper;
                    break;  // 3
                case MB_VOLUME:
                    func = v_hex_volume;
                    break;  // 4
                case MB_STRETCH:
                    func = v_hex_stretch;
                    break;  // 5
                case MB_DIAGONAL:
                    func = v_hex_diagonal;
                    break;  // 6
                case MB_DIMENSION:
                    func = v_hex_dimension;
                    break;  // 7
                case MB_ODDY:
                    func = v_hex_oddy;
                    break;  // 8
                case MB_MED_ASPECT_FROBENIUS:
                    func = v_hex_med_aspect_frobenius;
                    break;  // 9
                case MB_MAX_ASPECT_FROBENIUS:
                    func = v_hex_max_aspect_frobenius;
                    break;  // 10
                case MB_CONDITION:
                    func = v_hex_condition;
                    break;  // 11
                case MB_JACOBIAN:
                    func = v_hex_jacobian;
                    break;  // 12
                case MB_SCALED_JACOBIAN:
                    func = v_hex_scaled_jacobian;
                    break;  // 13
                case MB_SHEAR:
                    func = v_hex_shear;
                    break;  // 14
                case MB_SHAPE:
                    func = v_hex_shape;
                    break;  // 15
                case MB_RELATIVE_SIZE_SQUARED:
                    func = v_hex_relative_size_squared;
                    break;  // 16
                case MB_SHAPE_AND_SIZE:
                    func = v_hex_shape_and_size;
                    break;  // 17
                case MB_SHEAR_AND_SIZE:
                    func = v_hex_shear_and_size;
                    break;  // 18
                case MB_DISTORTION:
                    func = v_hex_distortion;
                    break;  // 19
                default:
                    return MB_FAILURE;
            }
            break;
        }
        case MBEDGE: {
            num_nodes = 2;
            switch( q )
            {
                case MB_LENGTH:
                    func = v_edge_length;
                    break;  // 20
                default:
                    return MB_FAILURE;
            }
            break;
        }
        case MBTET: {
            num_nodes = 4;
            switch( q )
            {
                case MB_EDGE_RATIO:
                    func = v_tet_edge_ratio;
                    break;  // 0 //! Calculates tet edge ratio metric.
                case MB_RADIUS_RATIO:
                    func = v_tet_radius_ratio;
                    break;  // 21
                case MB_ASPECT_BETA:
                    func = v_tet_aspect_beta;
                    break;  // 22
                case MB_ASPECT_RATIO:
                    func = v_tet_aspect_ratio;
                    break;  // 23
                case MB_ASPECT_GAMMA:
                    func = v_tet_aspect_gamma;
                    break;  // 24
                case MB_MAX_ASPECT_FROBENIUS:
                    func = v_tet_aspect_frobenius;
                    break;  // 10
                case MB_MINIMUM_ANGLE:
                    func = v_tet_minimum_angle;
                    break;  // 25
                case MB_COLLAPSE_RATIO:
                    func = v_tet_collapse_ratio;
                    break;  // 26
                case MB_VOLUME:
                    func = v_tet_volume;
                    break;  // 4
                case MB_CONDITION:
                    func = v_tet_condition;
                    break;  // 11
                case MB_JACOBIAN:
                    func = v_tet_jacobian;
                    break;  // 12
                case MB_SCALED_JACOBIAN:
                    func = v_tet_scaled_jacobian;
                    break;  // 13
                case MB_SHAPE:
                    func = v_tet_shape;
                    break;  // 15
                case MB_RELATIVE_SIZE_SQUARED:
                    func = v_tet_relative_size_squared;
                    break;  // 16
                case MB_SHAPE_AND_SIZE:
                    func = v_tet_shape_and_size;
                    break;  // 17
                case MB_DISTORTION:
                    func = v_tet_distortion;
                    break;  // 19
                default:
                    return MB_FAILURE;
            }
            break;
        }
        case MBPRISM: {
            num_nodes = 6;
            switch( q )
            {
                case MB_VOLUME:
                    func = v_wedge_volume;
                    break;  // 4
                default:
                    return MB_FAILURE;
            }
            break;
        }
        case MBKNIFE: {
            num_nodes = 7;
            switch( q )
            {
                case MB_VOLUME:
                    func = v_knife_volume;
                    break;  // 4
                default:
                    return MB_FAILURE;
            }
            break;
        }
        case MBQUAD: {
            num_nodes = 4;
            switch( q )
            {
                case MB_EDGE_RATIO:
                    func = v_quad_edge_ratio;
                    break;  // 0
                case MB_MAX_EDGE_RATIO:
                    func = v_quad_max_edge_ratio;
                    break;  // 1
                case MB_ASPECT_RATIO:
                    func = v_quad_aspect_ratio;
                    break;  // 23
                case MB_RADIUS_RATIO:
                    func = v_quad_radius_ratio;
                    break;  // 21
                case MB_MED_ASPECT_FROBENIUS:
                    func = v_quad_med_aspect_frobenius;
                    break;  // 9
                case MB_MAX_ASPECT_FROBENIUS:
                    func = v_quad_max_aspect_frobenius;
                    break;  // 10
                case MB_SKEW:
                    func = v_quad_skew;
                    break;  // 2
                case MB_TAPER:
                    func = v_quad_taper;
                    break;  // 3
                case MB_WARPAGE:
                    func = v_quad_warpage;
                    break;  // 27
                case MB_AREA:
                    func = v_quad_area;
                    break;  // 28
                case MB_STRETCH:
                    func = v_quad_stretch;
                    break;  // 5
                case MB_MINIMUM_ANGLE:
                    func = v_quad_minimum_angle;
                    break;  // 25
                case MB_MAXIMUM_ANGLE:
                    func = v_quad_maximum_angle;
                    break;  // 29
                case MB_ODDY:
                    func = v_quad_oddy;
                    break;  // 8
                case MB_CONDITION:
                    func = v_quad_condition;
                    break;  // 11
                case MB_JACOBIAN:
                    func = v_quad_jacobian;
                    break;  // 12
                case MB_SCALED_JACOBIAN:
                    func = v_quad_scaled_jacobian;
                    break;  // 13
                case MB_SHEAR:
                    func = v_quad_shear;
                    break;  // 14
                case MB_SHAPE:
                    func = v_quad_shape;
                    break;  // 15
                case MB_RELATIVE_SIZE_SQUARED:
                    func = v_quad_relative_size_squared;
                    break;  // 16
                case MB_SHAPE_AND_SIZE:
                    func = v_quad_shape_and_size;
                    break;  // 17
                case MB_SHEAR_AND_SIZE:
                    func = v_quad_shear_and_size;
                    break;  // 18
                case MB_DISTORTION:
                    func = v_quad_distortion;
                    break;  // 19
                default:
                    return MB_FAILURE;
            }
            break;
        }

        case MBTRI: {
            num_nodes = 3;
            switch( q )
            {
                case MB_EDGE_RATIO:
                    func = v_tri_edge_ratio;
                    break;  // 0
                case MB_ASPECT_RATIO:
                    func = v_tri_aspect_ratio;
                    break;  // 23
                case MB_RADIUS_RATIO:
                    func = v_tri_radius_ratio;
                    break;  // 21
                case MB_MAX_ASPECT_FROBENIUS:
                    func = v_tri_aspect_frobenius;
                    break;  // 10
                case MB_AREA:
                    func = v_tri_area;
                    break;  // 28
                case MB_MINIMUM_ANGLE:
                    func = v_tri_minimum_angle;
                    break;  // 25
                case MB_MAXIMUM_ANGLE:
                    func = v_tri_maximum_angle;
                    break;  // 29
                case MB_CONDITION:
                    func = v_tri_condition;
                    break;  // 11
                case MB_SCALED_JACOBIAN:
                    func = v_tri_scaled_jacobian;
                    break;  // 13
                // does not exist, even though it was defined in verdict.h; remove it from there too
                // case MB_SHEAR:                func = v_tri_shear; break;                  // 14
                case MB_RELATIVE_SIZE_SQUARED:
                    func = v_tri_relative_size_squared;
                    break;  // 16
                case MB_SHAPE:
                    func = v_tri_shape;
                    break;  // 15
                case MB_SHAPE_AND_SIZE:
                    func = v_tri_shape_and_size;
                    break;  // 17
                case MB_DISTORTION:
                    func = v_tri_distortion;
                    break;  // 19
                default:
                    return MB_FAILURE;
            }
            break;
        }
        default:
            break;  // some have no measures
    }

    if( !func ) return MB_NOT_IMPLEMENTED;
    // actual computation happens here
    quality = ( *func )( num_nodes, coordinates );

    return MB_SUCCESS;
}

return a quality name

return quality name (convert an enum QualityType to a string)

Parameters:
qquality type return string Example:
    const char * name = quality_name(MB_JACOBIAN); 

Definition at line 479 of file VerdictWrapper.cpp.

References moab::nameQuality.

Referenced by main(), and verdict_test1().

{
    return nameQuality[q];
}

Definition at line 497 of file VerdictWrapper.cpp.

References MB_SUCCESS, v_set_hex_size(), v_set_quad_size(), v_set_tet_size(), and v_set_tri_size().

Referenced by main(), perform_laplacian_smoothing(), and verdict_test1().

{
    // set the sizes for all of them; maybe we can set by type, this should be enough for simplicity
    v_set_hex_size( size );
    v_set_tet_size( size );
    v_set_quad_size( size );
    v_set_tri_size( size );
    return MB_SUCCESS;
}

Member Data Documentation

Definition at line 189 of file VerdictWrapper.hpp.

Referenced by all_quality_measures(), and quality_measure().

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