Mesh Oriented datABase  (version 5.4.1)
Array-based unstructured mesh datastructure
moab::SimplexTemplateTagAssigner Class Reference

#include <SimplexTemplateTagAssigner.hpp>

+ Collaboration diagram for moab::SimplexTemplateTagAssigner:

Public Member Functions

 SimplexTemplateTagAssigner (SimplexTemplateRefiner *)
 Construct a template tag assigner.
virtual ~SimplexTemplateTagAssigner ()
 Empty destructor for good form.
virtual void operator() (const double *c0, const void *t0, EntityHandle h0, const double *cm, void *tm, const double *c1, const void *t1, EntityHandle h1)
 Given endpoint coordinates and tag values plus midpoint coordinates, compute midpoint tag values.
virtual void operator() (const void *t0, const void *t1, const void *t2, void *tp)
virtual void set_tag_manager (RefinerTagManager *tmgr)

Protected Attributes

SimplexTemplateRefinermesh_refiner
RefinerTagManagertag_manager

Detailed Description

This is an class that embodies the process of assigning tag values to new vertices based on some pre-existing neighbors in a simplicial mesh.

Author:
David Thompson
Philippe Pebay
Date:
28 December 2007

Definition at line 39 of file SimplexTemplateTagAssigner.hpp.


Constructor & Destructor Documentation

Construct a template tag assigner.

Definition at line 18 of file SimplexTemplateTagAssigner.cpp.

{
    this->mesh_refiner = r;
    this->tag_manager  = 0;
}

Empty destructor for good form.

Definition at line 25 of file SimplexTemplateTagAssigner.cpp.

{}

Member Function Documentation

void moab::SimplexTemplateTagAssigner::operator() ( const double *  c0,
const void *  t0,
EntityHandle  h0,
const double *  cm,
void *  tm,
const double *  c1,
const void *  t1,
EntityHandle  h1 
) [virtual]

Given endpoint coordinates and tag values plus midpoint coordinates, compute midpoint tag values.

Normally, this function will be invoked by the EntityRefiner before evaluate_edge is called. However, if evaluate_edge() changes the parametric coordinates of the midpoint, it should call evaluate_tags_at_midpoint() again to update any tag values; that is why this function is a member of EdgeSizeEvaluator and not EntityRefiner.

Parameters:
[in]c0Pointer to endpoint 0 coordinates. The parametric coordinates (3) are followed by world coordinates (3).
[in]t0Pointer to endpoint 0 tag values.
[in]cmPointer to midpoint coordinates. The parametric coordinates (3) are followed by world coordinates (3).
[out]tmPointer to midpoint tag values.
[in]c1Pointer to endpoint 1 coordinates. The parametric coordinates (3) are followed by world coordinates (3).
[in]t1Pointer to endpoint 1 tag values.

Definition at line 45 of file SimplexTemplateTagAssigner.cpp.

References MB_TYPE_DOUBLE.

{
    double c0m_squared = 0.;
    double c01_squared = 0.;
    for( int i = 0; i < 3; ++i )
    {
        double tmp = cm[i] - c0[i];
        c0m_squared += tmp * tmp;
        tmp = c1[i] - c0[i];
        c01_squared += tmp * tmp;
    }
    double lambda           = sqrt( c0m_squared / c01_squared );
    double one_minus_lambda = 1. - lambda;

    DataType data_type;
    int tag_size;
    int num_components;
    int num_tags = this->tag_manager->get_number_of_vertex_tags();
    Tag tag_handle;
    int tag_offset;
    for( int i = 0; i < num_tags; ++i )
    {
        this->tag_manager->get_input_vertex_tag( i, tag_handle, tag_offset );
        this->tag_manager->get_input_mesh()->tag_get_data_type( tag_handle, data_type );
        this->tag_manager->get_input_mesh()->tag_get_bytes( tag_handle, tag_size );

        switch( data_type )
        {
            case MB_TYPE_DOUBLE: {
                num_components = tag_size / sizeof( double );
                double* t0i    = (double*)( (char*)t0 + tag_offset );
                double* tmi    = (double*)( (char*)tm + tag_offset );
                double* t1i    = (double*)( (char*)t1 + tag_offset );
                for( int j = 0; j < num_components; ++j )
                    tmi[j] = one_minus_lambda * t0i[j] + lambda * t1i[j];
            }
            break;
            default:
                memcpy( (char*)tm + tag_offset, (char*)( h0 < h1 ? t0 : t1 ) + tag_offset, tag_size );
                break;
        }
    }
}
void moab::SimplexTemplateTagAssigner::operator() ( const void *  t0,
const void *  t1,
const void *  t2,
void *  tp 
) [virtual]

Definition at line 96 of file SimplexTemplateTagAssigner.cpp.

{
    (void)t0;
    (void)t1;
    (void)t2;
    (void)tp;
}

Member Data Documentation

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