Mesh Oriented datABase  (version 5.6.0)
An array-based unstructured mesh library
moab::AdjSides< CORNERS > Class Template Reference
+ Collaboration diagram for moab::AdjSides< CORNERS >:

Classes

struct  Side
 

Public Types

typedef std::vector< Side >::iterator iterator
 
typedef std::vector< Side >::const_iterator const_iterator
 

Public Member Functions

const_iterator begin () const
 
const_iterator end () const
 
void clear ()
 
bool empty () const
 
 AdjSides ()
 
size_t num_skin () const
 
void insert (const EntityHandle *handles, int skip_idx, EntityHandle adj_elem, unsigned short elem_side)
 insert side, specifying side connectivity More...
 
void insert (const EntityHandle *handles, int skip_idx, EntityHandle adj_elem, unsigned short elem_side, const short *indices)
 insert side, specifying list of indices into parent element connectivity. More...
 
bool find_and_unmark (const EntityHandle *other, int skip_index, EntityHandle &elem_out)
 Search list for a given side, and if found, mark as not skin. More...
 

Private Attributes

std::vector< Sidedata
 List of sides. More...
 
size_t skin_count
 Cached count of sides that are skin. More...
 

Detailed Description

template<unsigned CORNERS>
class moab::AdjSides< CORNERS >

Definition at line 1164 of file Skinner.cpp.

Member Typedef Documentation

◆ const_iterator

template<unsigned CORNERS>
typedef std::vector< Side >::const_iterator moab::AdjSides< CORNERS >::const_iterator

Definition at line 1272 of file Skinner.cpp.

◆ iterator

template<unsigned CORNERS>
typedef std::vector< Side >::iterator moab::AdjSides< CORNERS >::iterator

Definition at line 1271 of file Skinner.cpp.

Constructor & Destructor Documentation

◆ AdjSides()

template<unsigned CORNERS>
moab::AdjSides< CORNERS >::AdjSides ( )
inline

Definition at line 1292 of file Skinner.cpp.

1292 : skin_count( 0 ) {}

Member Function Documentation

◆ begin()

template<unsigned CORNERS>
const_iterator moab::AdjSides< CORNERS >::begin ( ) const
inline

Definition at line 1273 of file Skinner.cpp.

1274  {
1275  return data.begin();
1276  }

References moab::AdjSides< CORNERS >::data.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

◆ clear()

template<unsigned CORNERS>
void moab::AdjSides< CORNERS >::clear ( )
inline

Definition at line 1282 of file Skinner.cpp.

1283  {
1284  data.clear();
1285  skin_count = 0;
1286  }

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

◆ empty()

template<unsigned CORNERS>
bool moab::AdjSides< CORNERS >::empty ( ) const
inline

Definition at line 1287 of file Skinner.cpp.

1288  {
1289  return data.empty();
1290  }

References moab::AdjSides< CORNERS >::data.

◆ end()

template<unsigned CORNERS>
const_iterator moab::AdjSides< CORNERS >::end ( ) const
inline

Definition at line 1277 of file Skinner.cpp.

1278  {
1279  return data.end();
1280  }

References moab::AdjSides< CORNERS >::data.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

◆ find_and_unmark()

template<unsigned CORNERS>
bool moab::AdjSides< CORNERS >::find_and_unmark ( const EntityHandle other,
int  skip_index,
EntityHandle elem_out 
)
inline

Search list for a given side, and if found, mark as not skin.

Parameters
otherConnectivity of side
skip_indexIndex in 'other' at which implicit vertex occurs.
elem_outIf return value is true, the element that the side is a side of. If return value is false, not set.
Returns
true if found and marked not-skin, false if not found.

Given the connectivity of some existing element, check if it occurs in the list. If it does, clear the "is skin" state of the side so that we know that we don't need to later create the side element.

Definition at line 1375 of file Skinner.cpp.

1376  {
1377  Side s( other, skip_index, 0, 0 );
1378  iterator p = std::find( data.begin(), data.end(), s );
1379  if( p == data.end() || !p->adj_elem )
1380  return false;
1381  else
1382  {
1383  elem_out = p->adj_elem;
1384  p->adj_elem = 0; // clear "is skin" state for side
1385  --skin_count; // decrement cached count of skin sides
1386  return true;
1387  }
1388  }

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

◆ insert() [1/2]

template<unsigned CORNERS>
void moab::AdjSides< CORNERS >::insert ( const EntityHandle handles,
int  skip_idx,
EntityHandle  adj_elem,
unsigned short  elem_side 
)
inline

insert side, specifying side connectivity

Either insert a new side, or if the side is already in the list, mark it as not on the skin.

Parameters
handlesThe connectivity of the element side.
skip_idxThe index of the implicit vertex (contained in all sides in the list.)
adj_elemThe element that this is a side of.
elem_sideWhich side of adj_elem are we storing (CN side number.)

Definition at line 1311 of file Skinner.cpp.

1312  {
1313  Side side( handles, skip_idx, adj_elem, elem_side );
1314  iterator p = std::find( data.begin(), data.end(), side );
1315  if( p == data.end() )
1316  {
1317  data.push_back( side );
1318  ++skin_count; // not in list yet, so skin side (so far)
1319  }
1320  else if( p->adj_elem )
1321  {
1322  p->adj_elem = 0; // mark as not on skin
1323  --skin_count; // decrement cached count of skin elements
1324  }
1325  }

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

◆ insert() [2/2]

template<unsigned CORNERS>
void moab::AdjSides< CORNERS >::insert ( const EntityHandle handles,
int  skip_idx,
EntityHandle  adj_elem,
unsigned short  elem_side,
const short *  indices 
)
inline

insert side, specifying list of indices into parent element connectivity.

Either insert a new side, or if the side is already in the list, mark it as not on the skin.

Parameters
handlesThe connectivity of the parent element
skip_idxThe index of the implicit vertex (contained in all sides in the list.) This is an index into 'indices', not 'handles'.
adj_elemThe element that this is a side of (parent handle).
indicesThe indices into 'handles' at which the vertices representing the side occur.
elem_sideWhich side of adj_elem are we storing (CN side number.)

Definition at line 1343 of file Skinner.cpp.

1348  {
1349  Side side( handles, skip_idx, adj_elem, elem_side, indices );
1350  iterator p = std::find( data.begin(), data.end(), side );
1351  if( p == data.end() )
1352  {
1353  data.push_back( side );
1354  ++skin_count; // not in list yet, so skin side (so far)
1355  }
1356  else if( p->adj_elem )
1357  {
1358  p->adj_elem = 0; // mark as not on skin
1359  --skin_count; // decrement cached count of skin elements
1360  }
1361  }

References moab::AdjSides< CORNERS >::data, and moab::AdjSides< CORNERS >::skin_count.

◆ num_skin()

template<unsigned CORNERS>
size_t moab::AdjSides< CORNERS >::num_skin ( ) const
inline

Definition at line 1294 of file Skinner.cpp.

1295  {
1296  return skin_count;
1297  }

References moab::AdjSides< CORNERS >::skin_count.

Referenced by moab::Skinner::find_skin_vertices_2D(), and moab::Skinner::find_skin_vertices_3D().

Member Data Documentation

◆ data

◆ skin_count

template<unsigned CORNERS>
size_t moab::AdjSides< CORNERS >::skin_count
private

The documentation for this class was generated from the following file: