MOAB: Mesh Oriented datABase  (version 5.3.1)
moab::RefinerTagManager Class Reference

#include <RefinerTagManager.hpp>

+ Collaboration diagram for moab::RefinerTagManager:

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)
Interfaceget_input_mesh ()
Interfaceget_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)
ProcessSetget_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
Interfaceinput_mesh
Interfaceoutput_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

Detailed Description

This a class that manages which tags an edge refiner should include on output vertices created during mesh refinement. The

Author:
David Thompson
Date:
12 June 2008

Definition at line 39 of file RefinerTagManager.hpp.


Constructor & Destructor Documentation

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
}

Destruction is virtual so subclasses may clean up after refinement.

Definition at line 96 of file RefinerTagManager.cpp.

{}

Member Function Documentation

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;
}

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;
}

Definition at line 504 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.

Parameters:
[in]ent_inputAn entity on the input mesh with a global ID.
[in]ent_outputAn entity on the output mesh whose global ID should be set.
Return values:
NormallyMB_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 462 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
}

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.

Parameters:
[in]entsAn array of entities in the input mesh whose global IDs you desire
[in]nThe number of entities in the ents array.
[out]gidsA vector to contain the resulting global IDs.
Return values:
AMOAB error code as supplied by the Interface::tag_get_data() call.

Definition at line 275 of file RefinerTagManager.cpp.

References input_mesh, n, 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;
}
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.

Parameters:
[in]iAn index into the list of tags for the vertex.
[out]tagThe tag handle on the input mesh for the $i$-th vertex tag.
[out]byte_offsetThe 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;
}

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();
    }

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.

Parameters:
[in]entsAn array of entities in the output mesh whose global IDs you desire
[in]nThe number of entities in the ents array.
[out]gidsA vector to contain the resulting global IDs.
Return values:
AMOAB error code as supplied by the Interface::tag_get_data() call.

Definition at line 304 of file RefinerTagManager.cpp.

References n, 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;
}
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.

Parameters:
[in]iAn index into the list of tags for the vertex.
[out]tagThe tag handle on the output mesh for the $i$-th vertex tag.
[out]byte_offsetThe 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;
}

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;
    }

Definition at line 84 of file RefinerTagManager.hpp.

References tag_ipstatus.

    {
        return this->tag_ipstatus;
    }

Definition at line 88 of file RefinerTagManager.hpp.

References tag_ipsproc.

    {
        return this->tag_ipsproc;
    }

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();
}

Definition at line 109 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 );
    }

Definition at line 117 of file RefinerTagManager.hpp.

References current_element_procs, and set_sharing().

    {
        this->set_sharing( ent_output, this->current_element_procs );
    }

Definition at line 495 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.

Parameters:
[in]entThe entity whose ID will be set
[out]idThe global ID
Return values:
Anerror 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).

Parameters:
[in]ent_handleThe entity whose information will be set
[in]procsThe 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";
}

Member Data Documentation

std::vector< char > moab::RefinerTagManager::element_tag_data [protected]

Definition at line 150 of file RefinerTagManager.hpp.

Referenced by add_element_tag(), and reset_element_tags().

std::vector< std::pair< Tag, int > > moab::RefinerTagManager::output_element_tags [protected]
std::vector< std::pair< Tag, int > > moab::RefinerTagManager::output_vertex_tags [protected]

Definition at line 145 of file RefinerTagManager.hpp.

Referenced by get_common_processes(), and RefinerTagManager().

std::vector< int > moab::RefinerTagManager::shared_procs_in [protected]

Definition at line 146 of file RefinerTagManager.hpp.

Referenced by get_common_processes().

std::vector< int > moab::RefinerTagManager::shared_procs_out [protected]

Definition at line 147 of file RefinerTagManager.hpp.

Referenced by set_sharing().

Definition at line 138 of file RefinerTagManager.hpp.

Referenced by get_input_gids(), and RefinerTagManager().

Definition at line 137 of file RefinerTagManager.hpp.

Referenced by RefinerTagManager().

Definition at line 136 of file RefinerTagManager.hpp.

Referenced by RefinerTagManager().

Definition at line 143 of file RefinerTagManager.hpp.

Referenced by RefinerTagManager().

Definition at line 142 of file RefinerTagManager.hpp.

Referenced by RefinerTagManager().

Definition at line 139 of file RefinerTagManager.hpp.

Referenced by RefinerTagManager(), and set_sharing().

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