MOAB: Mesh Oriented datABase  (version 5.4.1)
MBMesquite::Sample Struct Reference

#include <Sample.hpp>

Public Types

enum  {
  SIDE_DIMENSION_BITS = 2, SIDE_NUMBER_BITS = 4, NUMBER_PACKED_BITS = SIDE_DIMENSION_BITS + SIDE_NUMBER_BITS, NUM_SAMPLE_SIDE_DIM = 1u << SIDE_DIMENSION_BITS,
  NUM_SAMPLE_SIDE_NUM = 1u << SIDE_NUMBER_BITS, SIDE_NUMBER_MASK = NUM_SAMPLE_SIDE_NUM - 1, SIDE_DIMENSON_MASK = NUM_SAMPLE_SIDE_DIM - 1
}

Public Member Functions

size_t pack () const
 Return packed representation of this sample.
void unpack (size_t packed)
 Set this sample to the values encoded in a packed sample representation.
 Sample (unsigned dim, unsigned num)
 Initialization constructor.
 Sample (size_t packed)
 Initialize from packed representation.
 Sample ()
bool operator== (const Sample &other) const
bool operator!= (const Sample &other) const
bool operator< (const Sample &other) const
bool operator> (const Sample &other) const
bool operator<= (const Sample &other) const
bool operator>= (const Sample &other) const

Public Attributes

unsigned short dimension
 The "dimension" of the sub-entity.
unsigned short number
 Canonical number in ITAPS ordering for element corners/sides.

Detailed Description

Define a logical location within an element at which the element will be "sampled" for the purpose of evaluating a quality metric. For example, specify a location at which to calculate the Jacobian of the mapping function and use it to evaluate a TMP quality metric.

Logical sample points are currently limited to corners, mid-sides (region elements have both face and edge "sides") and mid-element.

Definition at line 50 of file Sample.hpp.


Member Enumeration Documentation

anonymous enum

Constants used for a packed (minimum number of bits) representation of a sample.

Enumerator:
SIDE_DIMENSION_BITS 

Number of bits used to store the dimension of an element 'side'

SIDE_NUMBER_BITS 

Number of bits used to store the index of an element 'side' of a specific dimension

NUMBER_PACKED_BITS 
NUM_SAMPLE_SIDE_DIM 

Number of distinct side dimension values that will fit in a sample value (one greater than the largest dimension)

NUM_SAMPLE_SIDE_NUM 

Number of distinct side index values that will fit in a sample value (one greater than the largest side number)

SIDE_NUMBER_MASK 

Mask to remove side dimension bits from sample number

SIDE_DIMENSON_MASK 

Mask to remove side dimension bits from sample number

Definition at line 77 of file Sample.hpp.

    {
        /** Number of bits used to store the dimension of an element 'side' */
        SIDE_DIMENSION_BITS = 2,
        /** Number of bits used to store the index of an element 'side' of a specific dimension */
        SIDE_NUMBER_BITS   = 4,
        NUMBER_PACKED_BITS = SIDE_DIMENSION_BITS + SIDE_NUMBER_BITS,
        /** Number of distinct side dimension values that will fit
         *  in a sample value (one greater than the largest dimension) */
        NUM_SAMPLE_SIDE_DIM = 1u << SIDE_DIMENSION_BITS,
        /** Number of distinct side index values that will fit
         *  in a sample value (one greater than the largest side number) */
        NUM_SAMPLE_SIDE_NUM = 1u << SIDE_NUMBER_BITS,
        /** Mask to remove side dimension bits from sample number */
        SIDE_NUMBER_MASK = NUM_SAMPLE_SIDE_NUM - 1,
        /** Mask to remove side dimension bits from sample number */
        SIDE_DIMENSON_MASK = NUM_SAMPLE_SIDE_DIM - 1
    };

Constructor & Destructor Documentation

MBMesquite::Sample::Sample ( unsigned  dim,
unsigned  num 
) [inline]

Initialization constructor.

Definition at line 108 of file Sample.hpp.

: dimension( dim ), number( num ) {}
MBMesquite::Sample::Sample ( size_t  packed) [inline, explicit]

Initialize from packed representation.

Definition at line 110 of file Sample.hpp.

    {
        unpack( packed );
    }

Default constructor must be explicitly included if we provide other constructors Do nothing (don't waste time initilazing to zero or something, I'd rather be able to catch the use of uninitialized values using a memory checker anyway if I make such a mistake.)

Definition at line 118 of file Sample.hpp.

{}

Member Function Documentation

bool MBMesquite::Sample::operator!= ( const Sample other) const [inline]

Definition at line 124 of file Sample.hpp.

References pack().

    {
        return pack() != other.pack();
    }
bool MBMesquite::Sample::operator< ( const Sample other) const [inline]

Definition at line 128 of file Sample.hpp.

References pack().

    {
        return pack() < other.pack();
    }
bool MBMesquite::Sample::operator<= ( const Sample other) const [inline]

Definition at line 136 of file Sample.hpp.

References pack().

    {
        return pack() <= other.pack();
    }
bool MBMesquite::Sample::operator== ( const Sample other) const [inline]

Definition at line 120 of file Sample.hpp.

References pack().

    {
        return pack() == other.pack();
    }
bool MBMesquite::Sample::operator> ( const Sample other) const [inline]

Definition at line 132 of file Sample.hpp.

References pack().

    {
        return pack() > other.pack();
    }
bool MBMesquite::Sample::operator>= ( const Sample other) const [inline]

Definition at line 140 of file Sample.hpp.

References pack().

    {
        return pack() >= other.pack();
    }
size_t MBMesquite::Sample::pack ( ) const [inline]

Return packed representation of this sample.

Definition at line 97 of file Sample.hpp.

Referenced by MBMesquite::ElemSampleQM::handle(), operator!=(), operator<(), operator<=(), operator==(), operator>(), and operator>=().

    {
        return ( ( (size_t)dimension ) << SIDE_NUMBER_BITS ) | number;
    }
void MBMesquite::Sample::unpack ( size_t  packed) [inline]

Set this sample to the values encoded in a packed sample representation.

Definition at line 102 of file Sample.hpp.


Member Data Documentation

The "dimension" of the sub-entity.

Possible values are [0-3]:

  • 0 : sample at the location of a corner vertex
  • 1 : sample at the center of an edge
  • 2 : sample at the center of a surface element or the center of one face of a volume element
  • 3 : sample at the center of a volume element

Definition at line 60 of file Sample.hpp.

Referenced by MBMesquite::NodeSet::clear_node(), MBMesquite::LinearTriangle::coefficients(), MBMesquite::LinearTetrahedron::coefficients(), MBMesquite::LinearPrism::coefficients(), MBMesquite::LinearHexahedron::coefficients(), MBMesquite::LinearQuadrilateral::coefficients(), MBMesquite::TriLagrangeShape::coefficients(), MBMesquite::QuadLagrangeShape::coefficients(), MBMesquite::TetLagrangeShape::coefficients(), MBMesquite::LinearPyramid::coefficients(), MBMesquite::HexLagrangeShape::coefficients(), MBMesquite::LinearPrism::derivatives(), MBMesquite::LinearHexahedron::derivatives(), MBMesquite::TriLagrangeShape::derivatives(), MBMesquite::LinearQuadrilateral::derivatives(), MBMesquite::QuadLagrangeShape::derivatives(), MBMesquite::TetLagrangeShape::derivatives(), MBMesquite::LinearPyramid::derivatives(), MBMesquite::HexLagrangeShape::derivatives(), MBMesquite::AffineMapMetric::evaluate(), FauxMetric< B >::evaluate(), MBMesquite::AffineMapMetric::evaluate_with_indices(), FauxMetric< B >::evaluate_with_indices(), MBMesquite::PatchData::get_domain_normal_at_sample(), MBMesquite::LinearPyramid::ideal(), CachedTargetCalculator::make_2d(), CachedTargetCalculator::make_3d(), CachedTargetCalculator::make_surf(), FakeTargetCalc::make_value(), MBMesquite::NodeSet::node(), MBMesquite::NodeSet::num_before(), MBMesquite::operator<<(), MBMesquite::NodeSet::position(), MBMesquite::NodeSet::set_node(), and test_handle().

Canonical number in ITAPS ordering for element corners/sides.

The dimension specifies which set of sub-entities that the sample my be on. The number specifies which entity within that subset. For example, if dimension == 1 then the sample point is at the center of one of the element edges. The number then specifies which edge of the element, where edges are ordered according to the ITAPS ordering.

For mid-region or mid-face of a surface element, the number should be zero.

Definition at line 73 of file Sample.hpp.

Referenced by MBMesquite::NodeSet::clear_node(), MBMesquite::LinearTriangle::coefficients(), MBMesquite::LinearTetrahedron::coefficients(), MBMesquite::LinearPrism::coefficients(), MBMesquite::LinearHexahedron::coefficients(), MBMesquite::LinearQuadrilateral::coefficients(), MBMesquite::TriLagrangeShape::coefficients(), MBMesquite::QuadLagrangeShape::coefficients(), MBMesquite::TetLagrangeShape::coefficients(), MBMesquite::LinearPyramid::coefficients(), MBMesquite::HexLagrangeShape::coefficients(), MBMesquite::LinearPrism::derivatives(), MBMesquite::LinearHexahedron::derivatives(), MBMesquite::TriLagrangeShape::derivatives(), MBMesquite::LinearQuadrilateral::derivatives(), MBMesquite::QuadLagrangeShape::derivatives(), MBMesquite::TetLagrangeShape::derivatives(), MBMesquite::LinearPyramid::derivatives(), MBMesquite::HexLagrangeShape::derivatives(), MBMesquite::AffineMapMetric::evaluate(), FauxMetric< B >::evaluate(), MBMesquite::AffineMapMetric::evaluate_with_indices(), FauxMetric< B >::evaluate_with_indices(), MBMesquite::PatchData::get_domain_normal_at_sample(), MBMesquite::LinearPyramid::ideal(), CachedTargetCalculator::make_2d(), CachedTargetCalculator::make_3d(), CachedTargetCalculator::make_surf(), FakeTargetCalc::make_value(), MBMesquite::NodeSet::node(), MBMesquite::NodeSet::num_before(), MBMesquite::operator<<(), MBMesquite::NodeSet::position(), MBMesquite::NodeSet::set_node(), and test_handle().

List of all members.


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