Mesh Oriented datABase  (version 5.6.0)
An array-based unstructured mesh library
moab::AdjSides< CORNERS >::Side Struct Reference

Public Member Functions

bool skin () const
 
 Side (const EntityHandle *array, int idx, EntityHandle adj, unsigned short)
 
 Side (const EntityHandle *array, int idx, EntityHandle adj, unsigned short, const short *indices)
 
bool operator== (const Side &other) const
 
 Side (const EntityHandle *array, int idx, EntityHandle adj, unsigned short)
 
 Side (const EntityHandle *array, int idx, EntityHandle adj, unsigned short, const short *indices)
 
bool operator== (const Side &other) const
 

Public Attributes

EntityHandle handles [CORNERS - 1]
 side vertices, except for implicit one More...
 
EntityHandle adj_elem
 element that this is a side of, or zero More...
 

Detailed Description

template<unsigned CORNERS>
struct moab::AdjSides< CORNERS >::Side

This struct is used to for a reduced representation of element "sides" adjacent to a give vertex. As such, it a) does not store the initial vertex that all sides are adjacent to b) orders the remaining vertices in a specific way for fast comparison.

For edge elements, only the opposite vertex is stored. For triangle elements, only the other two vertices are stored, and they are stored with the smaller of those two handles first. For quad elements, only the other three vertices are stored. They are stored such that the vertex opposite the implicit (not stored) vertex is always in slot 1. The other two vertices (in slots 0 and 2) are ordered such that the handle of the one in slot 0 is smaller than the handle in slot 2.

For each side, the adj_elem field is used to store the element that it is a side of as long as the element is considered to be on the skin. The adj_elem field is cleared (set to zero) to indicate that this side is no longer considered to be on the skin (and is the side of more than one element.)

Definition at line 1188 of file Skinner.cpp.

Constructor & Destructor Documentation

◆ Side() [1/4]

template<unsigned CORNERS>
moab::AdjSides< CORNERS >::Side::Side ( const EntityHandle array,
int  idx,
EntityHandle  adj,
unsigned short   
)
inline

construct from connectivity of side

Parameters
arrayThe connectivity of the element side.
idxThe index of the implicit vertex (contained in all sides in the list.)
adjThe element that this is a side of.

Definition at line 1203 of file Skinner.cpp.

1203  : adj_elem( adj )
1204  {
1205  switch( CORNERS )
1206  {
1207  case 3:
1208  handles[1] = array[( idx + 2 ) % CORNERS];
1209  // fall through
1210  case 2:
1211  if( 3 == CORNERS ) handles[1] = array[( idx + 2 ) % CORNERS];
1212  if( 2 <= CORNERS ) handles[0] = array[( idx + 1 ) % CORNERS];
1213  break;
1214  default:
1215  assert( false );
1216  break;
1217  }
1218  if( CORNERS == 3 && handles[1] > handles[0] ) std::swap( handles[0], handles[1] );
1219  }

References moab::AdjSides< CORNERS >::Side::handles.

◆ Side() [2/4]

template<unsigned CORNERS>
moab::AdjSides< CORNERS >::Side::Side ( const EntityHandle array,
int  idx,
EntityHandle  adj,
unsigned short  ,
const short *  indices 
)
inline

construct from connectivity of parent element

Parameters
arrayThe connectivity of the parent element
idxThe index of the implicit vertex (contained in all sides in the list.) This is an index into 'indices', not 'array'.
adjThe element that this is a side of.
indicesThe indices into 'array' at which the vertices representing the side occur.

Definition at line 1230 of file Skinner.cpp.

1231  : adj_elem( adj )
1232  {
1233  switch( CORNERS )
1234  {
1235  case 3:
1236  handles[1] = array[indices[( idx + 2 ) % CORNERS]];
1237  // fall through
1238  case 2:
1239  if( 3 == CORNERS ) handles[1] = array[indices[( idx + 2 ) % CORNERS]];
1240  if( 2 <= CORNERS ) handles[0] = array[indices[( idx + 1 ) % CORNERS]];
1241  break;
1242  default:
1243  assert( false );
1244  break;
1245  }
1246  if( CORNERS == 3 && handles[1] > handles[0] ) std::swap( handles[0], handles[1] );
1247  }

References moab::AdjSides< CORNERS >::Side::handles.

◆ Side() [3/4]

moab::AdjSides::Side< 4 >::Side ( const EntityHandle array,
int  idx,
EntityHandle  adj,
unsigned short   
)

construct from connectivity of side

Parameters
arrayThe connectivity of the element side.
idxThe index of the implicit vertex (contained in all sides in the list.)
adjThe element that this is a side of.

Definition at line 1398 of file Skinner.cpp.

1398  : adj_elem( adj )
1399 {
1400  const unsigned int CORNERS = 4;
1401  handles[2] = array[( idx + 3 ) % CORNERS];
1402  handles[1] = array[( idx + 2 ) % CORNERS];
1403  handles[0] = array[( idx + 1 ) % CORNERS];
1404  if( handles[2] > handles[0] ) std::swap( handles[0], handles[2] );
1405 }

References moab::AdjSides< CORNERS >::Side::handles.

◆ Side() [4/4]

moab::AdjSides::Side< 4 >::Side ( const EntityHandle array,
int  idx,
EntityHandle  adj,
unsigned short  ,
const short *  indices 
)

construct from connectivity of parent element

Parameters
arrayThe connectivity of the parent element
idxThe index of the implicit vertex (contained in all sides in the list.) This is an index into 'indices', not 'array'.
adjThe element that this is a side of.
indicesThe indices into 'array' at which the vertices representing the side occur.

Definition at line 1417 of file Skinner.cpp.

1418  : adj_elem( adj )
1419 {
1420  const unsigned int CORNERS = 4;
1421  handles[2] = array[indices[( idx + 3 ) % CORNERS]];
1422  handles[1] = array[indices[( idx + 2 ) % CORNERS]];
1423  handles[0] = array[indices[( idx + 1 ) % CORNERS]];
1424  if( handles[2] > handles[0] ) std::swap( handles[0], handles[2] );
1425 }

References moab::AdjSides< CORNERS >::Side::handles.

Member Function Documentation

◆ operator==() [1/2]

template<unsigned CORNERS>
bool moab::AdjSides< CORNERS >::Side::operator== ( const Side other) const
inline

Definition at line 1251 of file Skinner.cpp.

1252  {
1253  switch( CORNERS )
1254  {
1255  case 3:
1256  return handles[0] == other.handles[0] && handles[1] == other.handles[1];
1257  case 2:
1258  return handles[0] == other.handles[0];
1259  default:
1260  assert( false );
1261  return false;
1262  }
1263  }

References moab::AdjSides< CORNERS >::Side::handles.

◆ operator==() [2/2]

bool moab::AdjSides::Side< 4 >::operator== ( const Side other) const

Definition at line 1430 of file Skinner.cpp.

1431 {
1432  return handles[0] == other.handles[0] && handles[1] == other.handles[1] && handles[2] == other.handles[2];
1433 }

References moab::AdjSides< CORNERS >::Side::handles.

◆ skin()

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

Definition at line 1192 of file Skinner.cpp.

1193  {
1194  return 0 != adj_elem;
1195  }

References moab::AdjSides< CORNERS >::Side::adj_elem.

Member Data Documentation

◆ adj_elem

template<unsigned CORNERS>
EntityHandle moab::AdjSides< CORNERS >::Side::adj_elem

element that this is a side of, or zero

Definition at line 1191 of file Skinner.cpp.

Referenced by moab::AdjSides< CORNERS >::Side::skin().

◆ handles

template<unsigned CORNERS>
EntityHandle moab::AdjSides< CORNERS >::Side::handles[CORNERS - 1]

side vertices, except for implicit one

Definition at line 1190 of file Skinner.cpp.

Referenced by moab::AdjSides< CORNERS >::Side::operator==(), and moab::AdjSides< CORNERS >::Side::Side().


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