Mesh Oriented datABase  (version 5.5.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 1144 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 1252 of file Skinner.cpp.

◆ iterator

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

Definition at line 1251 of file Skinner.cpp.

Constructor & Destructor Documentation

◆ AdjSides()

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

Definition at line 1272 of file Skinner.cpp.

1272 : skin_count( 0 ) {}

Member Function Documentation

◆ begin()

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

Definition at line 1253 of file Skinner.cpp.

1254  {
1255  return data.begin();
1256  }

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 1262 of file Skinner.cpp.

1263  {
1264  data.clear();
1265  skin_count = 0;
1266  }

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 1267 of file Skinner.cpp.

1268  {
1269  return data.empty();
1270  }

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

◆ end()

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

Definition at line 1257 of file Skinner.cpp.

1258  {
1259  return data.end();
1260  }

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 1355 of file Skinner.cpp.

1356  {
1357  Side s( other, skip_index, 0, 0 );
1358  iterator p = std::find( data.begin(), data.end(), s );
1359  if( p == data.end() || !p->adj_elem )
1360  return false;
1361  else
1362  {
1363  elem_out = p->adj_elem;
1364  p->adj_elem = 0; // clear "is skin" state for side
1365  --skin_count; // decrement cached count of skin sides
1366  return true;
1367  }
1368  }

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 1291 of file Skinner.cpp.

1292  {
1293  Side side( handles, skip_idx, adj_elem, elem_side );
1294  iterator p = std::find( data.begin(), data.end(), side );
1295  if( p == data.end() )
1296  {
1297  data.push_back( side );
1298  ++skin_count; // not in list yet, so skin side (so far)
1299  }
1300  else if( p->adj_elem )
1301  {
1302  p->adj_elem = 0; // mark as not on skin
1303  --skin_count; // decrement cached count of skin elements
1304  }
1305  }

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 1323 of file Skinner.cpp.

1328  {
1329  Side side( handles, skip_idx, adj_elem, elem_side, indices );
1330  iterator p = std::find( data.begin(), data.end(), side );
1331  if( p == data.end() )
1332  {
1333  data.push_back( side );
1334  ++skin_count; // not in list yet, so skin side (so far)
1335  }
1336  else if( p->adj_elem )
1337  {
1338  p->adj_elem = 0; // mark as not on skin
1339  --skin_count; // decrement cached count of skin elements
1340  }
1341  }

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 1274 of file Skinner.cpp.

1275  {
1276  return skin_count;
1277  }

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: