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

Public Member Functions

 CachedTargetCalculator ()
virtual bool get_3D_target (PatchData &, size_t elem, Sample sample, MsqMatrix< 3, 3 > &result, MsqError &)
 Get a target matrix.
virtual bool get_2D_target (PatchData &, size_t elem, Sample sample, MsqMatrix< 2, 2 > &result, MsqError &)
 Get a target matrix.
virtual bool get_surface_target (PatchData &, size_t elem, Sample sample, MsqMatrix< 3, 2 > &result, MsqError &)
 Get a target matrix.
void clear ()
unsigned calls_3d () const
unsigned calls_2d () const
unsigned calls_surf () const
void surf_orient (bool value)
virtual bool have_surface_orient () const
 Use 3x2 W for surface elements if true, 2x2 W if false.

Static Public Member Functions

static MsqMatrix< 3, 3 > make_3d (size_t elem, Sample sample)
static MsqMatrix< 2, 2 > make_2d (size_t elem, Sample sample)
static MsqMatrix< 3, 2 > make_surf (size_t elem, Sample sample)

Private Attributes

unsigned called_3d
unsigned called_2d
unsigned called_surf
bool surfOrientFlag

Detailed Description

Definition at line 89 of file CachingTargetTest.cpp.


Constructor & Destructor Documentation

Definition at line 100 of file CachingTargetTest.cpp.

: called_3d( 0 ), called_2d( 0 ), called_surf( 0 ), surfOrientFlag( true ) {}

Member Function Documentation

unsigned CachedTargetCalculator::calls_2d ( ) const [inline]

Definition at line 135 of file CachingTargetTest.cpp.

    {
        return called_2d;
    }
unsigned CachedTargetCalculator::calls_3d ( ) const [inline]

Definition at line 130 of file CachingTargetTest.cpp.

    {
        return called_3d;
    }
unsigned CachedTargetCalculator::calls_surf ( ) const [inline]

Definition at line 140 of file CachingTargetTest.cpp.

    {
        return called_surf;
    }
void CachedTargetCalculator::clear ( ) [inline]

Definition at line 123 of file CachingTargetTest.cpp.

    {
        called_3d   = 0;
        called_2d   = 0;
        called_surf = 0;
    }
virtual bool CachedTargetCalculator::get_2D_target ( PatchData pd,
size_t  element,
Sample  sample,
MsqMatrix< 2, 2 > &  W_out,
MsqError err 
) [inline, virtual]

Get a target matrix.

Parameters:
pdThe current PatchData
elementThe index an element within the patch data.
sampleThe sample point in the element.
W_outThe resulting target matrix.

Implements MBMesquite::TargetCalculator.

Definition at line 109 of file CachingTargetTest.cpp.

    {
        ++called_2d;
        result = make_2d( elem, sample );
        return true;
    }
virtual bool CachedTargetCalculator::get_3D_target ( PatchData pd,
size_t  element,
Sample  sample,
MsqMatrix< 3, 3 > &  W_out,
MsqError err 
) [inline, virtual]

Get a target matrix.

Parameters:
pdThe current PatchData
elementThe index an element within the patch data.
sampleThe sample point in the element.
W_outThe resulting target matrix.

Implements MBMesquite::TargetCalculator.

Definition at line 102 of file CachingTargetTest.cpp.

    {
        ++called_3d;
        result = make_3d( elem, sample );
        return true;
    }
virtual bool CachedTargetCalculator::get_surface_target ( PatchData pd,
size_t  element,
Sample  sample,
MsqMatrix< 3, 2 > &  W_out,
MsqError err 
) [inline, virtual]

Get a target matrix.

Parameters:
pdThe current PatchData
elementThe index an element within the patch data.
sampleThe sample point in the element.
W_outThe resulting target matrix.

Implements MBMesquite::TargetCalculator.

Definition at line 116 of file CachingTargetTest.cpp.

    {
        ++called_surf;
        result = make_surf( elem, sample );
        return true;
    }
virtual bool CachedTargetCalculator::have_surface_orient ( ) const [inline, virtual]

Use 3x2 W for surface elements if true, 2x2 W if false.

If true, then the targets for surface elements attempt some control of orientation and therefore get_surface_target must be used to get the targets. If false, then the target contains no orientation data and is therefore the same as the corresponding 2D target for surface elements. In this case, get_2D_target should be used.

Implements MBMesquite::TargetCalculator.

Definition at line 150 of file CachingTargetTest.cpp.

    {
        return surfOrientFlag;
    }
MsqMatrix< 2, 2 > CachedTargetCalculator::make_2d ( size_t  elem,
Sample  sample 
) [static]

Definition at line 163 of file CachingTargetTest.cpp.

References MBMesquite::Sample::dimension, and MBMesquite::Sample::number.

Referenced by CachingTargetTest::test_2d_target_subpatch(), and CachingTargetTest::test_2d_target_values().

{
    double v              = 100. * elem + 4 * sample.number + sample.dimension + 1;
    const double values[] = { v, 0, 0, 1 / v };
    return MsqMatrix< 2, 2 >( values );
}
MsqMatrix< 3, 3 > CachedTargetCalculator::make_3d ( size_t  elem,
Sample  sample 
) [static]

Definition at line 156 of file CachingTargetTest.cpp.

References MBMesquite::Sample::dimension, and MBMesquite::Sample::number.

Referenced by CachingTargetTest::test_3d_target_subpatch(), and CachingTargetTest::test_3d_target_values().

{
    double v              = 100. * elem + 4 * sample.number + sample.dimension + 1;
    const double values[] = { v, 0, 0, 0, v, 0, 0, 0, 1 / v };
    return MsqMatrix< 3, 3 >( values );
}
MsqMatrix< 3, 2 > CachedTargetCalculator::make_surf ( size_t  elem,
Sample  sample 
) [static]

Definition at line 170 of file CachingTargetTest.cpp.

References MBMesquite::Sample::dimension, and MBMesquite::Sample::number.

Referenced by CachingTargetTest::test_surface_target_subpatch(), and CachingTargetTest::test_surface_target_values().

{
    double v              = 100. * elem + 4 * sample.number + sample.dimension + 1;
    const double values[] = { v, 0, 0, v, 0.5 * v, 0.5 * v };
    return MsqMatrix< 3, 2 >( values );
}
void CachedTargetCalculator::surf_orient ( bool  value) [inline]

Definition at line 145 of file CachingTargetTest.cpp.

References value().


Member Data Documentation

Definition at line 92 of file CachingTargetTest.cpp.

Definition at line 92 of file CachingTargetTest.cpp.

Definition at line 92 of file CachingTargetTest.cpp.

Definition at line 93 of file CachingTargetTest.cpp.

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