![]() |
Mesh Oriented datABase
(version 5.4.1)
Array-based unstructured mesh datastructure
|
#include <SplitVertices.hpp>
Public Types | |
typedef std::vector < EntitySourceRecord > | VecType |
typedef std::vector < EntitySourceRecord > ::iterator | VecIteratorType |
Public Member Functions | |
EntitySource (int num_corners, RefinerTagManager *tag_mgr) | |
~EntitySource () | |
bool | create_element (EntityType etyp, int nconn, const EntityHandle *split_src, EntityHandle &elem_handle, std::map< ProcessSet, int > &proc_partition_counts) |
void | assign_global_ids (std::map< ProcessSet, int > &gids) |
Public Attributes | |
Interface * | mesh_out |
RefinerTagManager * | tag_manager |
ProcessSet | common_shared_procs |
int | num_corners |
A vector of pre-existing entities to a new mesh entity.
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.
Definition at line 193 of file SplitVertices.hpp.
typedef std::vector< EntitySourceRecord >::iterator moab::EntitySource::VecIteratorType |
Definition at line 197 of file SplitVertices.hpp.
typedef std::vector< EntitySourceRecord > moab::EntitySource::VecType |
Definition at line 196 of file SplitVertices.hpp.
moab::EntitySource::EntitySource | ( | int | num_corners, |
RefinerTagManager * | tag_mgr | ||
) |
Definition at line 17 of file SplitVertices.cpp.
References moab::RefinerTagManager::get_output_mesh(), mesh_out, num_corners, and tag_manager.
{
this->tag_manager = tag_mgr;
this->mesh_out = tag_mgr->get_output_mesh();
this->num_corners = nc;
}
Definition at line 24 of file SplitVertices.cpp.
{}
void moab::EntitySource::assign_global_ids | ( | std::map< ProcessSet, int > & | gids | ) |
Definition at line 44 of file SplitVertices.cpp.
References moab::Interface::get_connectivity(), moab::RefinerTagManager::get_output_gids(), mesh_out, num_corners, moab::RefinerTagManager::set_gid(), and tag_manager.
{
std::vector< EntityHandle > adjacencies;
adjacencies.resize( this->num_corners );
std::vector< EntitySourceRecord >::iterator it;
for( it = this->begin(); it != this->end(); ++it )
{
int num_nodes;
const EntityHandle* conn;
this->mesh_out->get_connectivity( it->handle, conn, num_nodes );
this->tag_manager->get_output_gids( this->num_corners, conn, it->ids );
std::sort( it->ids.begin(), it->ids.end() );
}
std::sort( this->begin(), this->end() );
for( it = this->begin(); it != this->end(); ++it )
{
int gid = gids[it->process_set]++;
this->tag_manager->set_gid( it->handle, gid );
#ifdef MB_DEBUG
std::cout << "Assigning entity: " << it->handle << " GID: " << gid << "\n";
#endif // MB_DEBUG
}
}
bool moab::EntitySource::create_element | ( | EntityType | etyp, |
int | nconn, | ||
const EntityHandle * | split_src, | ||
EntityHandle & | elem_handle, | ||
std::map< ProcessSet, int > & | proc_partition_counts | ||
) |
Definition at line 26 of file SplitVertices.cpp.
References moab::Interface::create_element(), moab::RefinerTagManager::get_element_procs(), MB_SUCCESS, mesh_out, num_corners, moab::RefinerTagManager::set_sharing(), and tag_manager.
{
// Get the global IDs of the input vertices
// int stat;
proc_partition_counts[this->tag_manager->get_element_procs()]++;
if( this->mesh_out->create_element( etyp, elem_verts, nconn, elem_handle ) != MB_SUCCESS )
{
return false;
}
this->push_back( EntitySourceRecord( this->num_corners, elem_handle, this->tag_manager->get_element_procs() ) );
this->tag_manager->set_sharing( elem_handle, this->tag_manager->get_element_procs() );
return true;
}
Definition at line 211 of file SplitVertices.hpp.
Definition at line 209 of file SplitVertices.hpp.
Referenced by assign_global_ids(), create_element(), and EntitySource().
Definition at line 212 of file SplitVertices.hpp.
Referenced by assign_global_ids(), create_element(), and EntitySource().
Definition at line 210 of file SplitVertices.hpp.
Referenced by assign_global_ids(), create_element(), and EntitySource().