MOAB: Mesh Oriented datABase  (version 5.3.1)
moab::SplitVertices< _n > Class Template Reference

A dictionary of new vertices. More...

#include <SplitVertices.hpp>

+ Inheritance diagram for moab::SplitVertices< _n >:
+ Collaboration diagram for moab::SplitVertices< _n >:

Public Types

typedef std::map
< SplitVertexIndex< _n >
, EntityHandle
MapType
typedef std::map
< SplitVertexIndex< _n >
, EntityHandle >::iterator 
MapIteratorType

Public Member Functions

 SplitVertices (RefinerTagManager *tag_mgr)
virtual ~SplitVertices ()
virtual bool find_or_create (const EntityHandle *split_src, const double *coords, EntityHandle &vert_handle, std::map< ProcessSet, int > &proc_partition_counts, bool handles_on_output_mesh)
virtual void assign_global_ids (std::map< ProcessSet, int > &gids)

Detailed Description

template<int _n>
class moab::SplitVertices< _n >

A dictionary of new vertices.

A map from a set of pre-existing vertices to a new mesh vertex.

This is used as a dictionary to determine whether a new vertex should be created on the given n-simplex (n being the template parameter) or whether it has already been created as part of the refinement of a neighboring entity.

An array of existing vertex ids used as a key in a dictionary of new vertices.

Definition at line 216 of file SplitVertices.hpp.


Member Typedef Documentation

template<int _n>
typedef std::map< SplitVertexIndex< _n >, EntityHandle >::iterator moab::SplitVertices< _n >::MapIteratorType

Definition at line 220 of file SplitVertices.hpp.

template<int _n>
typedef std::map< SplitVertexIndex< _n >, EntityHandle > moab::SplitVertices< _n >::MapType

Definition at line 219 of file SplitVertices.hpp.


Constructor & Destructor Documentation

template<int _n>
moab::SplitVertices< _n >::SplitVertices ( RefinerTagManager tag_mgr)

Definition at line 232 of file SplitVertices.hpp.

References moab::SplitVerticesBase::split_gids.

                                                               : SplitVerticesBase( tag_mgr )
{
    this->split_gids.resize( _n );
}
template<int _n>
moab::SplitVertices< _n >::~SplitVertices ( ) [virtual]

Definition at line 238 of file SplitVertices.hpp.

{
}

Member Function Documentation

template<int _n>
void moab::SplitVertices< _n >::assign_global_ids ( std::map< ProcessSet, int > &  gids) [virtual]

Implements moab::SplitVerticesBase.

Definition at line 273 of file SplitVertices.hpp.

{
    typename std::map< SplitVertexIndex< _n >, EntityHandle >::iterator it;
    for( it = this->begin(); it != this->end(); ++it )
    {
        int gid = gids[it->first.process_set]++;
        this->tag_manager->set_gid( it->second, gid );
#ifdef MB_DEBUG
        std::cout << "Assigning entity: " << it->first << " GID: " << gid << "\n";
#endif  // MB_DEBUG
    }
}
template<int _n>
bool moab::SplitVertices< _n >::find_or_create ( const EntityHandle split_src,
const double *  coords,
EntityHandle vert_handle,
std::map< ProcessSet, int > &  proc_partition_counts,
bool  handles_on_output_mesh 
) [virtual]

Implements moab::SplitVerticesBase.

Definition at line 243 of file SplitVertices.hpp.

References MB_SUCCESS, and moab::SplitVertexIndex< _n >::set_common_processes().

{
    // Get the global IDs of the input vertices
    if( handles_on_output_mesh ) { this->tag_manager->get_output_gids( _n, split_src, this->split_gids ); }
    else
    {
        this->tag_manager->get_input_gids( _n, split_src, this->split_gids );
    }
    SplitVertexIndex< _n > key( &this->split_gids[0] );
    MapIteratorType it = this->find( key );
    if( it == this->end() )
    {
#ifdef MB_DEBUG
        std::cout << " wrt output: " << handles_on_output_mesh << " ";
#endif  // MB_DEBUG
        this->tag_manager->get_common_processes( _n, split_src, this->common_shared_procs, handles_on_output_mesh );
        proc_partition_counts[this->common_shared_procs]++;
        key.set_common_processes( this->common_shared_procs );
        if( this->mesh_out->create_vertex( coords + 3, vert_handle ) != MB_SUCCESS ) { return false; }
        ( *this )[key] = vert_handle;
        this->tag_manager->set_sharing( vert_handle, this->common_shared_procs );
        return true;
    }
    vert_handle = it->second;
    return false;
}

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