MOAB: Mesh Oriented datABase
(version 5.4.1)
|
#include <RefinerTagManager.hpp>
Public Member Functions | |
RefinerTagManager (Interface *in_mesh, Interface *out_mesh) | |
Construct an evaluator. | |
virtual | ~RefinerTagManager () |
Destruction is virtual so subclasses may clean up after refinement. | |
void | reset_vertex_tags () |
int | add_vertex_tag (Tag tag_handle) |
int | get_vertex_tag_size () const |
Return the number of bytes to allocate for tag data per point. | |
int | get_number_of_vertex_tags () const |
Return the number of tags that will be output with each new vertex. | |
void | reset_element_tags () |
int | add_element_tag (Tag tag_handle) |
int | get_element_tag_size () const |
Return the number of bytes to allocate for tag data per point. | |
int | get_number_of_element_tags () const |
Return the number of tags that will be output with each new element. | |
void | create_output_tags () |
Populate the list of output tags to match the list of input tags. | |
void | get_input_vertex_tag (int i, Tag &tag, int &byte_offset) |
Return the tag handle and its offset in the array of tag data of each vertex. | |
void | get_output_vertex_tag (int i, Tag &tag, int &byte_offset) |
Return the tag handle and its offset in the array of tag data of each vertex. | |
void | get_input_element_tag (int i, Tag &tag, int &byte_offset) |
void | get_output_element_tag (int i, Tag &tag, int &byte_offset) |
Interface * | get_input_mesh () |
Interface * | get_output_mesh () |
Tag | input_parallel_status () |
Tag | input_shared_proc () |
Tag | input_shared_procs () |
int | get_input_gids (int n, const EntityHandle *ents, std::vector< int > &gids) |
Retrieve the global ID of each input entity and push it onto the output vector. | |
int | get_output_gids (int n, const EntityHandle *ents, std::vector< int > &gids) |
Retrieve the global ID of each output entity and push it onto the output vector. | |
int | set_gid (EntityHandle ent, int gid) |
Assign a global ID to an output entity. | |
int | copy_gid (EntityHandle ent_input, EntityHandle ent_output) |
Copy a global ID from an entity of the input mesh to an entity of the output mesh. | |
void | set_sharing (EntityHandle ent_handle, ProcessSet &procs) |
Set parallel status and sharing process list on an entity. | |
void | get_common_processes (int num, const EntityHandle *src, ProcessSet &common_shared_procs, bool on_output_mesh=true) |
Determine the subset of processes which all share the specified entities. | |
void | set_element_tags_from_ent (EntityHandle ent_input) |
void | assign_element_tags (EntityHandle ent_output) |
void | set_element_procs_from_ent (EntityHandle ent_input) |
ProcessSet & | get_element_procs () |
void | set_element_sharing (EntityHandle ent_output) |
Protected Member Functions | |
void | create_tag_internal (Tag, int) |
Protected Attributes | |
std::vector< std::pair< Tag, int > > | input_vertex_tags |
std::vector< std::pair< Tag, int > > | output_vertex_tags |
std::vector< std::pair< Tag, int > > | input_element_tags |
std::vector< std::pair< Tag, int > > | output_element_tags |
int | vertex_size |
int | element_size |
Interface * | input_mesh |
Interface * | output_mesh |
Tag | tag_ipstatus |
Tag | tag_ipsprocs |
Tag | tag_ipsproc |
Tag | tag_ipshands |
Tag | tag_ipshand |
Tag | tag_igid |
Tag | tag_opstatus |
Tag | tag_opsprocs |
Tag | tag_opsproc |
Tag | tag_opshands |
Tag | tag_opshand |
Tag | tag_ogid |
int | rank |
std::vector< int > | shared_procs_in |
std::vector< int > | shared_procs_out |
ProcessSet | current_shared_procs |
ProcessSet | current_element_procs |
std::vector< char > | element_tag_data |
This a class that manages which tags an edge refiner should include on output vertices created during mesh refinement. The
Definition at line 39 of file RefinerTagManager.hpp.
moab::RefinerTagManager::RefinerTagManager | ( | Interface * | in_mesh, |
Interface * | out_mesh | ||
) |
Construct an evaluator.
Definition at line 18 of file RefinerTagManager.cpp.
References moab::ParallelComm::get_pcomm(), moab::ParallelComm::get_shared_proc_tags(), GLOBAL_ID_TAG_NAME, moab::Interface::globalId_tag(), input_mesh, MPI_COMM_WORLD, output_mesh, moab::ParallelComm::proc_config(), moab::ProcConfig::proc_rank(), rank, reset_element_tags(), reset_vertex_tags(), tag_igid, tag_ipshand, tag_ipshands, tag_ipsproc, tag_ipsprocs, tag_ipstatus, tag_ogid, tag_opshand, tag_opshands, tag_opsproc, tag_opsprocs, and tag_opstatus.
: shared_procs_in( 5 * MAX_SHARING_PROCS, -1 ), shared_procs_out( MAX_SHARING_PROCS, -1 ) { assert( in_mesh ); if( !out_mesh ) out_mesh = in_mesh; this->input_mesh = in_mesh; this->output_mesh = out_mesh; this->reset_vertex_tags(); this->reset_element_tags(); ParallelComm* ipcomm = ParallelComm::get_pcomm( this->input_mesh, 0 ); ParallelComm* opcomm = 0; if( this->output_mesh != this->input_mesh ) { opcomm = ParallelComm::get_pcomm( this->output_mesh, 0 ); if( !opcomm ) { #ifdef MB_DEBUG std::cout << "Creating opcomm: " << opcomm << "\n"; #endif // MB_DEBUG opcomm = new ParallelComm( this->output_mesh, MPI_COMM_WORLD ); } } else { opcomm = ipcomm; } if( ipcomm ) { ipcomm->get_shared_proc_tags( this->tag_ipsproc, this->tag_ipsprocs, this->tag_ipshand, this->tag_ipshands, this->tag_ipstatus ); } else { this->tag_ipsproc = this->tag_ipsprocs = 0; this->tag_ipshand = this->tag_ipshands = 0; this->tag_ipstatus = 0; } if( opcomm ) { opcomm->get_shared_proc_tags( this->tag_opsproc, this->tag_opsprocs, this->tag_opshand, this->tag_opshands, this->tag_opstatus ); } else { this->tag_opsproc = this->tag_opsprocs = 0; this->tag_opshand = this->tag_opshands = 0; this->tag_opstatus = 0; } this->rank = ipcomm ? ipcomm->proc_config().proc_rank() : ( opcomm ? opcomm->proc_config().proc_rank() : 0 ); // Create the mesh global ID tags if they aren't already there. this->tag_igid = this->input_mesh->globalId_tag(); if( this->tag_igid == 0 ) { throw new std::logic_error( "Unable to find input mesh global ID tag \"" GLOBAL_ID_TAG_NAME "\"" ); } this->tag_ogid = this->output_mesh->globalId_tag(); if( this->tag_ogid == 0 ) { throw new std::logic_error( "Unable to find/create output mesh global ID tag \"" GLOBAL_ID_TAG_NAME "\"" ); } #ifdef MB_DEBUG std::cout << "psproc: " << this->tag_ipsproc << ", " << this->tag_opsproc << "\n" << "psprocs: " << this->tag_ipsprocs << ", " << this->tag_opsprocs << "\n" << "pshand: " << this->tag_ipshand << ", " << this->tag_opshand << "\n" << "pshands: " << this->tag_ipshands << ", " << this->tag_opshands << "\n" << "pstatus: " << this->tag_ipstatus << ", " << this->tag_opstatus << "\n" << "gid: " << this->tag_igid << ", " << this->tag_ogid << "\n"; #endif // MB_DEBUG }
moab::RefinerTagManager::~RefinerTagManager | ( | ) | [virtual] |
Destruction is virtual so subclasses may clean up after refinement.
Definition at line 96 of file RefinerTagManager.cpp.
{}
int moab::RefinerTagManager::add_element_tag | ( | Tag | tag_handle | ) |
Add a tag to the list of tag values that will appear past the element coordinates. The return value is the offset into each element coordinate pointer (p0, p1, p2) where the tag value(s) will be stored.
Definition at line 181 of file RefinerTagManager.cpp.
References element_size, element_tag_data, input_element_tags, input_mesh, MB_SUCCESS, MB_TAG_BIT, moab::Interface::tag_get_bytes(), moab::Interface::tag_get_type(), and TagType.
{ int offset = this->element_size; // old size is offset of tag being added int tag_size; TagType tagType; if( this->input_mesh->tag_get_bytes( tag_handle, tag_size ) != MB_SUCCESS ) return -1; if( this->input_mesh->tag_get_type( tag_handle, tagType ) != MB_SUCCESS ) return -1; if( tagType == MB_TAG_BIT ) { // Pad any bit tags to a size in full bytes. tag_size = ( tag_size % 8 ? 1 : 0 ) + ( tag_size / 8 ); } // Now pad so that the next tag will be word-aligned: while( tag_size % sizeof( int ) ) ++tag_size; this->element_size += tag_size; this->element_tag_data.resize( this->element_size ); this->input_element_tags.push_back( std::pair< Tag, int >( tag_handle, offset ) ); return offset; }
int moab::RefinerTagManager::add_vertex_tag | ( | Tag | tag_handle | ) |
Add a tag to the list of tag values that will appear past the vertex coordinates. The return value is the offset into each vertex coordinate pointer (p0, p1, p2) where the tag value(s) will be stored.
Definition at line 134 of file RefinerTagManager.cpp.
References input_mesh, input_vertex_tags, MB_SUCCESS, MB_TAG_BIT, moab::Interface::tag_get_bytes(), moab::Interface::tag_get_type(), TagType, and vertex_size.
Referenced by moab::MeshRefiner::add_vertex_tag().
{ int offset = this->vertex_size; // old size is offset of tag being added int tag_size; TagType tagType; if( this->input_mesh->tag_get_bytes( tag_handle, tag_size ) != MB_SUCCESS ) return -1; if( this->input_mesh->tag_get_type( tag_handle, tagType ) != MB_SUCCESS ) return -1; if( tagType == MB_TAG_BIT ) { // Pad any bit tags to a size in full bytes. tag_size = ( tag_size % 8 ? 1 : 0 ) + ( tag_size / 8 ); } // Now pad so that the next tag will be word-aligned: while( tag_size % sizeof( int ) ) ++tag_size; this->vertex_size += tag_size; this->input_vertex_tags.push_back( std::pair< Tag, int >( tag_handle, offset ) ); return offset; }
void moab::RefinerTagManager::assign_element_tags | ( | EntityHandle | ent_output | ) |
Definition at line 506 of file RefinerTagManager.cpp.
References output_element_tags, output_mesh, and moab::Interface::tag_set_data().
Referenced by moab::MeshOutputFunctor::operator()(), and moab::MeshRefiner::refine().
{ std::vector< std::pair< Tag, int > >::iterator it; for( it = this->output_element_tags.begin(); it != this->output_element_tags.end(); ++it ) { this->output_mesh->tag_set_data( it->first, &ent_output, 1, &this->element_tag_data[it->second] ); } }
int moab::RefinerTagManager::copy_gid | ( | EntityHandle | ent_input, |
EntityHandle | ent_output | ||
) |
Copy a global ID from an entity of the input mesh to an entity of the output mesh.
[in] | ent_input | An entity on the input mesh with a global ID. |
[in] | ent_output | An entity on the output mesh whose global ID should be set. |
Normally | MB_SUCCESS, but returns other values if tag_get_data or tag_set_data fail. |
Definition at line 335 of file RefinerTagManager.cpp.
References input_mesh, MB_SUCCESS, output_mesh, moab::Interface::tag_get_data(), tag_ogid, and moab::Interface::tag_set_data().
Referenced by moab::MeshRefiner::refine().
{ int gid = -1; int status; if( ( status = this->input_mesh->tag_get_data( this->tag_igid, &ent_input, 1, &gid ) ) == MB_SUCCESS ) { status = this->output_mesh->tag_set_data( this->tag_ogid, &ent_output, 1, &gid ); } return status; }
Populate the list of output tags to match the list of input tags.
When the input mesh and output mesh pointers are identical, this simply copies the list of input tags. When the two meshes are distinct, the corresponding tags are created on the output mesh.
Definition at line 220 of file RefinerTagManager.cpp.
References create_tag_internal(), input_element_tags, input_mesh, input_vertex_tags, output_element_tags, output_mesh, and output_vertex_tags.
Referenced by moab::MeshRefiner::refine().
{ if( this->input_mesh == this->output_mesh ) { this->output_vertex_tags = this->input_vertex_tags; this->output_element_tags = this->input_element_tags; return; } std::vector< std::pair< Tag, int > >::iterator it; for( it = this->input_vertex_tags.begin(); it != this->input_vertex_tags.end(); ++it ) { this->create_tag_internal( it->first, it->second ); } }
void moab::RefinerTagManager::create_tag_internal | ( | Tag | tag_in, |
int | offset | ||
) | [protected] |
Definition at line 464 of file RefinerTagManager.cpp.
References ErrorCode, input_mesh, MB_TAG_BYTES, MB_TAG_EXCL, output_mesh, output_vertex_tags, moab::Interface::tag_get_bytes(), moab::Interface::tag_get_data_type(), moab::Interface::tag_get_default_value(), moab::Interface::tag_get_handle(), moab::Interface::tag_get_name(), moab::Interface::tag_get_type(), and TagType.
Referenced by create_output_tags().
{ std::pair< Tag, int > tag_rec; std::vector< char > tag_default; std::string tag_name; TagType tag_type; DataType tag_data_type; int tag_size; tag_rec.second = offset; this->input_mesh->tag_get_name( tag_in, tag_name ); this->input_mesh->tag_get_bytes( tag_in, tag_size ); this->input_mesh->tag_get_type( tag_in, tag_type ); this->input_mesh->tag_get_data_type( tag_in, tag_data_type ); this->input_mesh->tag_get_default_value( tag_in, (void*)&tag_default[0] ); tag_default.resize( tag_size ); ErrorCode res = this->output_mesh->tag_get_handle( tag_name.c_str(), tag_size, tag_data_type, tag_rec.first, tag_type | MB_TAG_BYTES | MB_TAG_EXCL, &tag_default[0] ); #ifdef MB_DEBUG std::cout << "Creating output tag: \"" << tag_name.c_str() << "\" handle: " << tag_rec.first << " input handle: " << tag_in << "\n"; #endif // MB_DEBUG if( res == MB_FAILURE ) { std::cerr << "Could not create output tag name: \"" << tag_name.c_str() << "\" type: " << tag_type << " data type: " << tag_data_type << "\n"; } else { this->output_vertex_tags.push_back( tag_rec ); } }
void moab::RefinerTagManager::get_common_processes | ( | int | num, |
const EntityHandle * | src, | ||
ProcessSet & | common_shared_procs, | ||
bool | on_output_mesh = true |
||
) |
Determine the subset of processes which all share the specified entities.
This is used to determine which processes an output entity should reside on when it is defined using several input entities (such as vertices).
Definition at line 391 of file RefinerTagManager.cpp.
References moab::ProcessSet::clear(), current_shared_procs, input_mesh, moab::ProcessSet::intersect(), MB_SUCCESS, mesh, output_mesh, rank, moab::ProcessSet::set_process_member(), moab::ProcessSet::set_process_members(), shared_procs_in, moab::Interface::tag_get_data(), tag_ipsproc, tag_ipsprocs, tag_opsproc, tag_opsprocs, and moab::ProcessSet::unite().
Referenced by set_element_procs_from_ent().
{ Interface* mesh; Tag psproc; Tag psprocs; if( on_output_mesh ) { mesh = this->output_mesh; psproc = this->tag_opsproc; psprocs = this->tag_opsprocs; } else { mesh = this->input_mesh; psproc = this->tag_ipsproc; psprocs = this->tag_ipsprocs; } bool first_ent = true; common_shared_procs.clear(); for( int i = 0; i < num; ++i ) { EntityHandle ent_in = src[i]; // std::cout << "<(" << ent_in << ")>"; int stat; bool got = false; this->current_shared_procs.clear(); stat = mesh->tag_get_data( psproc, &ent_in, 1, &this->shared_procs_in[0] ); if( stat == MB_SUCCESS && this->shared_procs_in[0] != -1 ) { got = true; // std::cout << " s" << this->rank << " s" << this->shared_procs_in[0] << " | "; this->shared_procs_in[1] = -1; } stat = mesh->tag_get_data( psprocs, &ent_in, 1, &this->shared_procs_in[0] ); if( stat == MB_SUCCESS && this->shared_procs_in[0] != -1 ) { got = true; /* int i; for ( i = 0; i < MAX_SHARING_PROCS && this->shared_procs_in[i] != -1; ++ i ) std::cout << " m" << this->shared_procs_in[i]; std::cout << " | "; */ } if( got ) { this->current_shared_procs.set_process_members( this->shared_procs_in ); this->current_shared_procs.set_process_member( this->rank ); if( first_ent ) { common_shared_procs.unite( this->current_shared_procs ); first_ent = false; } else { common_shared_procs.intersect( this->current_shared_procs ); } } else { // not shared, but everthing exists on this process, so make sure that bit is set... common_shared_procs.set_process_member( this->rank ); } } #ifdef MB_DEBUG std::cout << " Common procs " << common_shared_procs; std::cout << "\n"; #endif // MB_DEBUG }
ProcessSet& moab::RefinerTagManager::get_element_procs | ( | ) | [inline] |
Definition at line 115 of file RefinerTagManager.hpp.
References current_element_procs.
Referenced by moab::EntitySource::create_element().
{ return this->current_element_procs; }
int moab::RefinerTagManager::get_element_tag_size | ( | ) | const [inline] |
Return the number of bytes to allocate for tag data per point.
Definition at line 58 of file RefinerTagManager.hpp.
References element_size.
{ return this->element_size; }
void moab::RefinerTagManager::get_input_element_tag | ( | int | i, |
Tag & | tag, | ||
int & | byte_offset | ||
) |
int moab::RefinerTagManager::get_input_gids | ( | int | n, |
const EntityHandle * | ents, | ||
std::vector< int > & | gids | ||
) |
Retrieve the global ID of each input entity and push it onto the output vector.
The gids array is emptied by this call before any new values are added. Note that this routine fetches global IDs from the input mesh, not the output mesh; your entity handles must be from the input mesh.
[in] | ents | An array of entities in the input mesh whose global IDs you desire |
[in] | n | The number of entities in the ents array. |
[out] | gids | A vector to contain the resulting global IDs. |
A | MOAB error code as supplied by the Interface::tag_get_data() call. |
Definition at line 275 of file RefinerTagManager.cpp.
References input_mesh, moab::Interface::tag_get_data(), and tag_igid.
Referenced by moab::MeshOutputFunctor::map_vertex().
{ int stat = 0; gids.clear(); for( int i = 0; i < n; ++i ) { int gid = -1; stat |= this->input_mesh->tag_get_data( this->tag_igid, ents + i, 1, &gid ); gids.push_back( gid ); } return stat; }
Interface* moab::RefinerTagManager::get_input_mesh | ( | ) | [inline] |
Definition at line 75 of file RefinerTagManager.hpp.
References input_mesh.
Referenced by moab::MeshOutputFunctor::MeshOutputFunctor(), moab::SimplexTemplateRefiner::prepare(), moab::EntityRefiner::prepare(), and moab::SimplexTemplateRefiner::refine_entity().
{ return this->input_mesh; }
void moab::RefinerTagManager::get_input_vertex_tag | ( | int | i, |
Tag & | tag, | ||
int & | byte_offset | ||
) |
Return the tag handle and its offset in the array of tag data of each vertex.
[in] | i | An index into the list of tags for the vertex. |
[out] | tag | The tag handle on the input mesh for the $i$-th vertex tag. |
[out] | byte_offset | The offset (in bytes) of the start of this tag's data in a vertex tag record. |
Definition at line 243 of file RefinerTagManager.cpp.
References input_vertex_tags.
Referenced by moab::SimplexTemplateRefiner::refine_entity().
{ std::vector< std::pair< Tag, int > >::iterator it = this->input_vertex_tags.begin() + i; tag = it->first; byte_offset = it->second; }
int moab::RefinerTagManager::get_number_of_element_tags | ( | ) | const [inline] |
Return the number of tags that will be output with each new element.
Definition at line 62 of file RefinerTagManager.hpp.
References input_element_tags.
{ return this->input_element_tags.size(); }
int moab::RefinerTagManager::get_number_of_vertex_tags | ( | ) | const [inline] |
Return the number of tags that will be output with each new vertex.
Definition at line 51 of file RefinerTagManager.hpp.
References input_vertex_tags.
Referenced by moab::MeshOutputFunctor::assign_tags(), and moab::SimplexTemplateRefiner::refine_entity().
{ return this->input_vertex_tags.size(); }
void moab::RefinerTagManager::get_output_element_tag | ( | int | i, |
Tag & | tag, | ||
int & | byte_offset | ||
) |
int moab::RefinerTagManager::get_output_gids | ( | int | n, |
const EntityHandle * | ents, | ||
std::vector< int > & | gids | ||
) |
Retrieve the global ID of each output entity and push it onto the output vector.
The gids array is emptied by this call before any new values are added. Note that this routine fetches global IDs from the output mesh, not the input mesh; your entity handles must be from the output mesh. Also, be aware that many output entities will not have global IDs assigned; only those vertices which exist in the input mesh are guaranteed to have global IDs assigned to them -- vertices that only exist in the output mesh and all higher-dimensional output entities have no global IDs assigned until after a complete subdivision pass has been made.
[in] | ents | An array of entities in the output mesh whose global IDs you desire |
[in] | n | The number of entities in the ents array. |
[out] | gids | A vector to contain the resulting global IDs. |
A | MOAB error code as supplied by the Interface::tag_get_data() call. |
Definition at line 304 of file RefinerTagManager.cpp.
References output_mesh, moab::Interface::tag_get_data(), and tag_ogid.
Referenced by moab::EntitySource::assign_global_ids().
{ int stat = 0; gids.clear(); for( int i = 0; i < n; ++i ) { int gid = -1; stat |= this->output_mesh->tag_get_data( this->tag_ogid, ents + i, 1, &gid ); gids.push_back( gid ); } return stat; }
Interface* moab::RefinerTagManager::get_output_mesh | ( | ) | [inline] |
Definition at line 79 of file RefinerTagManager.hpp.
References output_mesh.
Referenced by moab::EntitySource::EntitySource(), moab::MeshOutputFunctor::MeshOutputFunctor(), moab::SimplexTemplateRefiner::prepare(), and moab::SplitVerticesBase::SplitVerticesBase().
{ return this->output_mesh; }
void moab::RefinerTagManager::get_output_vertex_tag | ( | int | i, |
Tag & | tag, | ||
int & | byte_offset | ||
) |
Return the tag handle and its offset in the array of tag data of each vertex.
[in] | i | An index into the list of tags for the vertex. |
[out] | tag | The tag handle on the output mesh for the $i$-th vertex tag. |
[out] | byte_offset | The offset (in bytes) of the start of this tag's data in a vertex tag record. |
Definition at line 257 of file RefinerTagManager.cpp.
References output_vertex_tags.
Referenced by moab::MeshOutputFunctor::assign_tags().
{ std::vector< std::pair< Tag, int > >::iterator it = this->output_vertex_tags.begin() + i; tag = it->first; byte_offset = it->second; }
int moab::RefinerTagManager::get_vertex_tag_size | ( | ) | const [inline] |
Return the number of bytes to allocate for tag data per point.
Definition at line 47 of file RefinerTagManager.hpp.
References vertex_size.
Referenced by moab::EntityRefiner::heap_tag_storage(), and moab::EntityRefiner::update_heap_size().
{ return this->vertex_size; }
Tag moab::RefinerTagManager::input_parallel_status | ( | ) | [inline] |
Definition at line 84 of file RefinerTagManager.hpp.
References tag_ipstatus.
{ return this->tag_ipstatus; }
Tag moab::RefinerTagManager::input_shared_proc | ( | ) | [inline] |
Definition at line 88 of file RefinerTagManager.hpp.
References tag_ipsproc.
{ return this->tag_ipsproc; }
Tag moab::RefinerTagManager::input_shared_procs | ( | ) | [inline] |
Definition at line 92 of file RefinerTagManager.hpp.
References tag_ipsprocs.
{ return this->tag_ipsprocs; }
Clear the list of tag values that will appear past the element coordinates in p0, p1, and p2.
Definition at line 169 of file RefinerTagManager.cpp.
References element_size, element_tag_data, input_element_tags, and output_element_tags.
Referenced by RefinerTagManager().
{ this->element_size = 0; this->input_element_tags.clear(); this->output_element_tags.clear(); this->element_tag_data.clear(); }
Clear the list of tag values that will appear past the vertex coordinates in p0, p1, and p2.
Definition at line 123 of file RefinerTagManager.cpp.
References input_vertex_tags, output_vertex_tags, and vertex_size.
Referenced by RefinerTagManager(), and moab::MeshRefiner::reset_vertex_tags().
{ this->vertex_size = 0; this->input_vertex_tags.clear(); this->output_vertex_tags.clear(); }
void moab::RefinerTagManager::set_element_procs_from_ent | ( | EntityHandle | ent_input | ) | [inline] |
Definition at line 111 of file RefinerTagManager.hpp.
References current_element_procs, and get_common_processes().
Referenced by moab::MeshRefiner::refine().
{ this->get_common_processes( 1, &ent_input, this->current_element_procs, false ); }
void moab::RefinerTagManager::set_element_sharing | ( | EntityHandle | ent_output | ) | [inline] |
Definition at line 119 of file RefinerTagManager.hpp.
References current_element_procs, and set_sharing().
{ this->set_sharing( ent_output, this->current_element_procs ); }
void moab::RefinerTagManager::set_element_tags_from_ent | ( | EntityHandle | ent_input | ) |
Definition at line 497 of file RefinerTagManager.cpp.
References input_element_tags, input_mesh, and moab::Interface::tag_get_data().
Referenced by moab::MeshRefiner::refine().
{ std::vector< std::pair< Tag, int > >::iterator it; for( it = this->input_element_tags.begin(); it != this->input_element_tags.end(); ++it ) { this->input_mesh->tag_get_data( it->first, &ent_input, 1, &this->element_tag_data[it->second] ); } }
int moab::RefinerTagManager::set_gid | ( | EntityHandle | ent, |
int | gid | ||
) |
Assign a global ID to an output entity.
[in] | ent | The entity whose ID will be set |
[out] | id | The global ID |
An | error code as returned by Interface::tag_set_data(). |
Definition at line 323 of file RefinerTagManager.cpp.
References output_mesh, tag_ogid, and moab::Interface::tag_set_data().
Referenced by moab::EntitySource::assign_global_ids(), and moab::MeshOutputFunctor::map_vertex().
{ return this->output_mesh->tag_set_data( this->tag_ogid, &ent, 1, &gid ); }
void moab::RefinerTagManager::set_sharing | ( | EntityHandle | ent_handle, |
ProcessSet & | procs | ||
) |
Set parallel status and sharing process list on an entity.
This sets tag values for the PARALLEL_STATUS and one of PARALLEL_SHARED_PROC or PARALLEL_SHARED_PROCS tags if procs contains any processes (the current process is assumed not to be set in procs).
[in] | ent_handle | The entity whose information will be set |
[in] | procs | The set of sharing processes. |
Definition at line 355 of file RefinerTagManager.cpp.
References moab::ProcessSet::get_process_members(), output_mesh, PSTATUS_INTERFACE, PSTATUS_NOT_OWNED, PSTATUS_SHARED, shared_procs_out, tag_opsproc, tag_opsprocs, tag_opstatus, and moab::Interface::tag_set_data().
Referenced by moab::EntitySource::create_element(), and set_element_sharing().
{ int pstat; if( procs.get_process_members( this->rank, this->shared_procs_out ) ) pstat = PSTATUS_SHARED | PSTATUS_INTERFACE; else pstat = PSTATUS_SHARED | PSTATUS_INTERFACE | PSTATUS_NOT_OWNED; if( this->shared_procs_out[0] >= 0 ) { // assert( MAX_SHARING_PROCS > 1 ); // Since get_process_members pads to MAX_SHARING_PROCS, this will be work: if( this->shared_procs_out[1] <= 0 ) { // std::cout << " (proc )"; this->output_mesh->tag_set_data( this->tag_opsproc, &ent_handle, 1, &this->shared_procs_out[0] ); this->output_mesh->tag_set_data( this->tag_opstatus, &ent_handle, 1, &pstat ); } else { // std::cout << " (procS)"; this->output_mesh->tag_set_data( this->tag_opsprocs, &ent_handle, 1, &this->shared_procs_out[0] ); this->output_mesh->tag_set_data( this->tag_opstatus, &ent_handle, 1, &pstat ); } } else { // std::cout << " (none )"; } // std::cout << " new pstat: " << pstat << "\n"; }
Definition at line 151 of file RefinerTagManager.hpp.
Referenced by get_element_procs(), set_element_procs_from_ent(), and set_element_sharing().
Definition at line 150 of file RefinerTagManager.hpp.
Referenced by get_common_processes().
int moab::RefinerTagManager::element_size [protected] |
Definition at line 132 of file RefinerTagManager.hpp.
Referenced by add_element_tag(), get_element_tag_size(), and reset_element_tags().
std::vector< char > moab::RefinerTagManager::element_tag_data [protected] |
Definition at line 152 of file RefinerTagManager.hpp.
Referenced by add_element_tag(), and reset_element_tags().
std::vector< std::pair< Tag, int > > moab::RefinerTagManager::input_element_tags [protected] |
Definition at line 129 of file RefinerTagManager.hpp.
Referenced by add_element_tag(), create_output_tags(), get_number_of_element_tags(), reset_element_tags(), and set_element_tags_from_ent().
Interface* moab::RefinerTagManager::input_mesh [protected] |
Definition at line 133 of file RefinerTagManager.hpp.
Referenced by add_element_tag(), add_vertex_tag(), copy_gid(), create_output_tags(), create_tag_internal(), get_common_processes(), get_input_gids(), get_input_mesh(), RefinerTagManager(), and set_element_tags_from_ent().
std::vector< std::pair< Tag, int > > moab::RefinerTagManager::input_vertex_tags [protected] |
Definition at line 127 of file RefinerTagManager.hpp.
Referenced by add_vertex_tag(), create_output_tags(), get_input_vertex_tag(), get_number_of_vertex_tags(), and reset_vertex_tags().
std::vector< std::pair< Tag, int > > moab::RefinerTagManager::output_element_tags [protected] |
Definition at line 130 of file RefinerTagManager.hpp.
Referenced by assign_element_tags(), create_output_tags(), and reset_element_tags().
Interface* moab::RefinerTagManager::output_mesh [protected] |
Definition at line 134 of file RefinerTagManager.hpp.
Referenced by assign_element_tags(), copy_gid(), create_output_tags(), create_tag_internal(), get_common_processes(), get_output_gids(), get_output_mesh(), RefinerTagManager(), set_gid(), and set_sharing().
std::vector< std::pair< Tag, int > > moab::RefinerTagManager::output_vertex_tags [protected] |
Definition at line 128 of file RefinerTagManager.hpp.
Referenced by create_output_tags(), create_tag_internal(), get_output_vertex_tag(), and reset_vertex_tags().
int moab::RefinerTagManager::rank [protected] |
Definition at line 147 of file RefinerTagManager.hpp.
Referenced by get_common_processes(), and RefinerTagManager().
std::vector< int > moab::RefinerTagManager::shared_procs_in [protected] |
Definition at line 148 of file RefinerTagManager.hpp.
Referenced by get_common_processes().
std::vector< int > moab::RefinerTagManager::shared_procs_out [protected] |
Definition at line 149 of file RefinerTagManager.hpp.
Referenced by set_sharing().
Tag moab::RefinerTagManager::tag_igid [protected] |
Definition at line 140 of file RefinerTagManager.hpp.
Referenced by get_input_gids(), and RefinerTagManager().
Tag moab::RefinerTagManager::tag_ipshand [protected] |
Definition at line 139 of file RefinerTagManager.hpp.
Referenced by RefinerTagManager().
Tag moab::RefinerTagManager::tag_ipshands [protected] |
Definition at line 138 of file RefinerTagManager.hpp.
Referenced by RefinerTagManager().
Tag moab::RefinerTagManager::tag_ipsproc [protected] |
Definition at line 137 of file RefinerTagManager.hpp.
Referenced by get_common_processes(), input_shared_proc(), and RefinerTagManager().
Tag moab::RefinerTagManager::tag_ipsprocs [protected] |
Definition at line 136 of file RefinerTagManager.hpp.
Referenced by get_common_processes(), input_shared_procs(), and RefinerTagManager().
Tag moab::RefinerTagManager::tag_ipstatus [protected] |
Definition at line 135 of file RefinerTagManager.hpp.
Referenced by input_parallel_status(), and RefinerTagManager().
Tag moab::RefinerTagManager::tag_ogid [protected] |
Definition at line 146 of file RefinerTagManager.hpp.
Referenced by copy_gid(), get_output_gids(), RefinerTagManager(), and set_gid().
Tag moab::RefinerTagManager::tag_opshand [protected] |
Definition at line 145 of file RefinerTagManager.hpp.
Referenced by RefinerTagManager().
Tag moab::RefinerTagManager::tag_opshands [protected] |
Definition at line 144 of file RefinerTagManager.hpp.
Referenced by RefinerTagManager().
Tag moab::RefinerTagManager::tag_opsproc [protected] |
Definition at line 143 of file RefinerTagManager.hpp.
Referenced by get_common_processes(), RefinerTagManager(), and set_sharing().
Tag moab::RefinerTagManager::tag_opsprocs [protected] |
Definition at line 142 of file RefinerTagManager.hpp.
Referenced by get_common_processes(), RefinerTagManager(), and set_sharing().
Tag moab::RefinerTagManager::tag_opstatus [protected] |
Definition at line 141 of file RefinerTagManager.hpp.
Referenced by RefinerTagManager(), and set_sharing().
int moab::RefinerTagManager::vertex_size [protected] |
Definition at line 131 of file RefinerTagManager.hpp.
Referenced by add_vertex_tag(), get_vertex_tag_size(), and reset_vertex_tags().