MOAB: Mesh Oriented datABase  (version 5.4.1)
smoab::ExtractShell Class Reference

#include <ExtractShell.h>

+ Collaboration diagram for smoab::ExtractShell:

Public Member Functions

 ExtractShell (const smoab::CellSets volCells, const smoab::Interface &interface)
bool findSkins (smoab::CellSets &surfaceCellSets)

Private Attributes

const smoab::InterfaceInterface
smoab::CellSets VCells

Detailed Description

Definition at line 12 of file ExtractShell.h.


Constructor & Destructor Documentation

smoab::ExtractShell::ExtractShell ( const smoab::CellSets  volCells,
const smoab::Interface interface 
) [inline]

Definition at line 18 of file ExtractShell.h.

        : Interface( interface ), VCells( volCells )
    {
    }

Member Function Documentation

bool smoab::ExtractShell::findSkins ( smoab::CellSets surfaceCellSets)

Definition at line 27 of file ExtractShell.h.

References moab::Range::begin(), smoab::Interface::createAdjacencies(), moab::Range::end(), smoab::detail::UsageTable::incrementUsage(), moab::Range::insert(), smoab::detail::UsageTable::multipleUsage(), smoab::Interface::remove(), smoab::Interface::sideElements(), smoab::detail::UsageTable::singleUsage(), and VCells.

{
    typedef smoab::Range::const_iterator Iterator;

    typedef smoab::CellSets::const_iterator SetIterator;

    smoab::Range cellsToRemove;
    for( SetIterator set = this->VCells.begin(); set != this->VCells.end(); ++set )
    {
        const smoab::Range& cells = set->cells();
        this->Interface.createAdjacencies( set->cells(), 2 );

        //we create the usage table for each iteration so that we only
        //get the shell of each cell set. If we used the table between
        //sets we would get the shell of the combined sets
        smoab::detail::UsageTable table;
        for( Iterator i = cells.begin(); i != cells.end(); ++i )
        {
            std::vector< smoab::EntityHandle > faceCells = this->Interface.sideElements( *i, 2 );

            //the usage id allows you to label cells when going into the table
            //so that you can extract multiple shells where each is based on
            //a single region id.
            std::vector< int > regionId( 1, faceCells.size() );
            table.incrementUsage( faceCells, regionId );
        }
        smoab::Range surfaceCells = table.singleUsage();

        //create a new cell set that
        smoab::CellSet surfaceSet( set->entity(), surfaceCells );
        surfaceCellSets.push_back( surfaceSet );

        smoab::Range subsetToRemove = table.multipleUsage();
        cellsToRemove.insert( subsetToRemove.begin(), subsetToRemove.end() );
    }

    //we will remove all cells that have multiple usages from the moab database
    //I really don't care if they already existed or not.
    this->Interface.remove( cellsToRemove );
    return true;
}

Member Data Documentation

Definition at line 14 of file ExtractShell.h.

Definition at line 15 of file ExtractShell.h.

Referenced by findSkins().

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