Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TopologyInfo Class Reference

Information about different element topologies. More...

#include <TopologyInfo.hpp>

Collaboration diagram for TopologyInfo:

Static Public Member Functions

static unsigned dimension (EntityTopology topo)
 Dimension of element topology. More...
 
static unsigned adjacent (EntityTopology topo, unsigned dimension)
 Number of adjacent entities of a specified dimension. More...
 
static unsigned sides (EntityTopology topo)
 Get number of sides a given topology type has. More...
 
static unsigned corners (EntityTopology topo)
 Get the number of defining vertices for a given element topology. More...
 
static unsigned edges (EntityTopology topo)
 Get the number of edges in a given topology. More...
 
static unsigned faces (EntityTopology topo)
 Get the number of faces in a given topology. More...
 
static void higher_order (EntityTopology topo, unsigned num_nodes, bool &midedge, bool &midface, bool &midvol, MsqError &err)
 Check which mid-nodes a higher-order element has. More...
 
static const unsigned * edge_vertices (EntityTopology topo, unsigned edge_number, MsqError &err)
 Get indices of edge ends in element connectivity array. More...
 
static const unsigned * face_vertices (EntityTopology topo, unsigned face_number, unsigned &num_vertices_out, MsqError &err)
 Get face corner indices in element connectivity array. More...
 
static const unsigned * side_vertices (EntityTopology topo, unsigned side_dimension, unsigned side_number, unsigned &num_verts_out, MsqError &err)
 Get corner indices of side. More...
 
static void side_number (EntityTopology topo, unsigned connectivity_length, unsigned node_index, unsigned &side_dimension_out, unsigned &side_number_out, MsqError &err)
 Return which side the specified mid-node lies on. More...
 
static unsigned dimension (EntityTopology topo)
 Dimension of element topology. More...
 
static unsigned adjacent (EntityTopology topo, unsigned dimension)
 Number of adjacent entities of a specified dimension. More...
 
static unsigned sides (EntityTopology topo)
 Get number of sides a given topology type has. More...
 
static unsigned corners (EntityTopology topo)
 Get the number of defining vertices for a given element topology. More...
 
static unsigned edges (EntityTopology topo)
 Get the number of edges in a given topology. More...
 
static unsigned faces (EntityTopology topo)
 Get the number of faces in a given topology. More...
 
static void higher_order (EntityTopology topo, unsigned num_nodes, bool &midedge, bool &midface, bool &midvol, MsqError &err)
 Check which mid-nodes a higher-order element has. More...
 
static const unsigned * edge_vertices (EntityTopology topo, unsigned edge_number, MsqError &err)
 Get indices of edge ends in element connectivity array. More...
 
static const unsigned * face_vertices (EntityTopology topo, unsigned face_number, unsigned &num_vertices_out, MsqError &err)
 Get face corner indices in element connectivity array. More...
 
static const unsigned * side_vertices (EntityTopology topo, unsigned side_dimension, unsigned side_number, unsigned &num_verts_out, MsqError &err)
 Get corner indices of side. More...
 
static void side_number (EntityTopology topo, unsigned connectivity_length, unsigned node_index, unsigned &side_dimension_out, unsigned &side_number_out, MsqError &err)
 Return which side the specified mid-node lies on. More...
 

Private Types

enum  {
  MAX_EDGES = 12, MAX_FACES = 6, MAX_FACE_CONN = 5, FIRST_FACE = TRIANGLE,
  LAST_FACE = QUADRILATERAL, FIRST_VOL = TETRAHEDRON, LAST_VOL = PYRAMID
}
 
enum  {
  MAX_EDGES = 12, MAX_FACES = 6, MAX_FACE_CONN = 5, FIRST_FACE = TRIANGLE,
  LAST_FACE = QUADRILATERAL, FIRST_VOL = TETRAHEDRON, LAST_VOL = PYRAMID
}
 

Private Member Functions

 TopologyInfo ()
 
 TopologyInfo ()
 

Private Attributes

unsigned dimMap [MIXED]
 Get dimension of entity given topology. More...
 
unsigned adjMap [MIXED][3]
 Get number of adj entities of dimension 0, 1 and dimension 2. More...
 
unsigned edgeMap [LAST_VOL-FIRST_FACE+1][MAX_EDGES][2]
 Vertex indices for element edges. More...
 
unsigned faceMap [LAST_VOL-FIRST_VOL+1][MAX_FACES][MAX_FACE_CONN]
 Vertex indices for element faces. More...
 

Static Private Attributes

static TopologyInfo instance
 

Detailed Description

Information about different element topologies.

Definition at line 38 of file includeLinks/TopologyInfo.hpp.

Member Enumeration Documentation

Constructor & Destructor Documentation

TopologyInfo ( )
private

Definition at line 38 of file Mesh/TopologyInfo.cpp.

References TopologyInfo::adjMap, TopologyInfo::dimMap, TopologyInfo::edgeMap, TopologyInfo::faceMap, TopologyInfo::FIRST_FACE, TopologyInfo::FIRST_VOL, Mesquite::HEXAHEDRON, Mesquite::POLYGON, Mesquite::POLYHEDRON, Mesquite::PRISM, Mesquite::PYRAMID, Mesquite::QUADRILATERAL, Mesquite::SEPTAHEDRON, Mesquite::TETRAHEDRON, and Mesquite::TRIANGLE.

39 {
40  memset( dimMap, 0, sizeof(dimMap) );
41  memset( adjMap, 0, sizeof(adjMap) );
42  memset( edgeMap, 0, sizeof(edgeMap) );
43  memset( faceMap, 0, sizeof(faceMap) );
44 
45  dimMap[POLYGON ] = 2;
46  dimMap[TRIANGLE] = 2;
47  dimMap[QUADRILATERAL] = 2;
48  dimMap[POLYHEDRON] = 3;
49  dimMap[TETRAHEDRON] = 3;
50  dimMap[HEXAHEDRON] = 3;
51  dimMap[PRISM] = 3;
52  dimMap[PYRAMID] = 3;
53  dimMap[SEPTAHEDRON] = 3;
54 
55  adjMap[TRIANGLE][0] = 3;
56  adjMap[TRIANGLE][1] = 3;
57 
58  adjMap[QUADRILATERAL][0] = 4;
59  adjMap[QUADRILATERAL][1] = 4;
60 
61  adjMap[TETRAHEDRON][0] = 4;
62  adjMap[TETRAHEDRON][1] = 6;
63  adjMap[TETRAHEDRON][2] = 4;
64 
65  adjMap[HEXAHEDRON][0] = 8;
66  adjMap[HEXAHEDRON][1] = 12;
67  adjMap[HEXAHEDRON][2] = 6;
68 
69  adjMap[PRISM][0] = 6;
70  adjMap[PRISM][1] = 9;
71  adjMap[PRISM][2] = 5;
72 
73  adjMap[PYRAMID][0] = 5;
74  adjMap[PYRAMID][1] = 8;
75  adjMap[PYRAMID][2] = 5;
76 
77  adjMap[SEPTAHEDRON][0] = 7;
78  adjMap[SEPTAHEDRON][1] = 11;
79  adjMap[SEPTAHEDRON][2] = 6; /* See description in TSTT mesh interface doc */
80 
81  int side;
82  for (side = 0; side < 3; ++side)
83  {
84  edgeMap[TRIANGLE-FIRST_FACE][side][0] = side;
85  edgeMap[TRIANGLE-FIRST_FACE][side][1] = (side+1)%3;
86  }
87  for (side = 0; side < 4; ++side)
88  {
89  edgeMap[QUADRILATERAL-FIRST_FACE][side][0] = side;
90  edgeMap[QUADRILATERAL-FIRST_FACE][side][1] = (side+1)%4;
91  }
92  for (side = 0; side < 3; ++side)
93  {
94  edgeMap[TETRAHEDRON-FIRST_FACE][side][0] = side;
95  edgeMap[TETRAHEDRON-FIRST_FACE][side][1] = (side+1)%3;
96  }
97  for (side = 3; side < 6; ++side)
98  {
99  edgeMap[TETRAHEDRON-FIRST_FACE][side][0] = side -3 ;
100  edgeMap[TETRAHEDRON-FIRST_FACE][side][1] = 3;
101  }
102  for (side = 0; side < 4; ++side)
103  {
104  edgeMap[HEXAHEDRON-FIRST_FACE][side][0] = side;
105  edgeMap[HEXAHEDRON-FIRST_FACE][side][1] = (side+1)%4;
106  }
107  for (side = 4; side < 8; ++side)
108  {
109  edgeMap[HEXAHEDRON-FIRST_FACE][side][0] = side - 4;
110  edgeMap[HEXAHEDRON-FIRST_FACE][side][1] = side;
111  }
112  for (side = 8; side < 12; ++side)
113  {
114  edgeMap[HEXAHEDRON-FIRST_FACE][side][0] = side - 4;
115  edgeMap[HEXAHEDRON-FIRST_FACE][side][1] = 4+(side+1)%4;
116  }
117  for (side = 0; side < 3; ++side)
118  {
119  edgeMap[PRISM-FIRST_FACE][side][0] = side;
120  edgeMap[PRISM-FIRST_FACE][side][1] = (side+1)%3;
121  }
122  for (side = 3; side < 6; ++side)
123  {
124  edgeMap[PRISM-FIRST_FACE][side][0] = side - 3;
125  edgeMap[PRISM-FIRST_FACE][side][1] = side;
126  }
127  for (side = 6; side < 9; ++side)
128  {
129  edgeMap[PRISM-FIRST_FACE][side][0] = side-3;
130  edgeMap[PRISM-FIRST_FACE][side][1] = 3+(side+1)%3;
131  }
132  for (side = 0; side < 4; ++side)
133  {
134  edgeMap[PYRAMID-FIRST_FACE][side][0] = side;
135  edgeMap[PYRAMID-FIRST_FACE][side][1] = (side+1)%4;
136  }
137  for (side = 4; side < 8; ++side)
138  {
139  edgeMap[PYRAMID-FIRST_FACE][side][0] = side - 4;
140  edgeMap[PYRAMID-FIRST_FACE][side][1] = 4;
141  }
142 
143  for (side = 0; side < 3; ++side)
144  {
145  faceMap[TETRAHEDRON-FIRST_VOL][side][0] = 3;
146  faceMap[TETRAHEDRON-FIRST_VOL][side][1] = side;
147  faceMap[TETRAHEDRON-FIRST_VOL][side][2] = (side+1)%3;
148  faceMap[TETRAHEDRON-FIRST_VOL][side][3] = 3;
149  }
150  faceMap[TETRAHEDRON-FIRST_VOL][3][0] = 3;
151  faceMap[TETRAHEDRON-FIRST_VOL][3][1] = 2;
152  faceMap[TETRAHEDRON-FIRST_VOL][3][2] = 1;
153  faceMap[TETRAHEDRON-FIRST_VOL][3][3] = 0;
154 
155  for (side = 0; side < 4; ++side)
156  {
157  faceMap[HEXAHEDRON-FIRST_VOL][side][0] = 4;
158  faceMap[HEXAHEDRON-FIRST_VOL][side][1] = side;
159  faceMap[HEXAHEDRON-FIRST_VOL][side][2] = (side+1)%4;
160  faceMap[HEXAHEDRON-FIRST_VOL][side][3] = 4+(side+1)%4;
161  faceMap[HEXAHEDRON-FIRST_VOL][side][4] = side + 4;
162  }
163  faceMap[HEXAHEDRON-FIRST_VOL][4][0] = 4;
164  faceMap[HEXAHEDRON-FIRST_VOL][4][1] = 3;
165  faceMap[HEXAHEDRON-FIRST_VOL][4][2] = 2;
166  faceMap[HEXAHEDRON-FIRST_VOL][4][3] = 1;
167  faceMap[HEXAHEDRON-FIRST_VOL][4][4] = 0;
168  faceMap[HEXAHEDRON-FIRST_VOL][5][0] = 4;
169  faceMap[HEXAHEDRON-FIRST_VOL][5][1] = 4;
170  faceMap[HEXAHEDRON-FIRST_VOL][5][2] = 5;
171  faceMap[HEXAHEDRON-FIRST_VOL][5][3] = 6;
172  faceMap[HEXAHEDRON-FIRST_VOL][5][4] = 7;
173 
174  for (side = 0; side < 4; ++side)
175  {
176  faceMap[PYRAMID-FIRST_VOL][side][0] = 3;
177  faceMap[PYRAMID-FIRST_VOL][side][1] = side;
178  faceMap[PYRAMID-FIRST_VOL][side][2] = (side+1)%4;
179  faceMap[PYRAMID-FIRST_VOL][side][3] = 4;
180  }
181  faceMap[PYRAMID-FIRST_VOL][4][0] = 4;
182  faceMap[PYRAMID-FIRST_VOL][4][1] = 3;
183  faceMap[PYRAMID-FIRST_VOL][4][2] = 2;
184  faceMap[PYRAMID-FIRST_VOL][4][3] = 1;
185  faceMap[PYRAMID-FIRST_VOL][4][4] = 0;
186 
187  for (side = 0; side < 3; ++side)
188  {
189  faceMap[PRISM-FIRST_VOL][side][0] = 4;
190  faceMap[PRISM-FIRST_VOL][side][1] = side;
191  faceMap[PRISM-FIRST_VOL][side][2] = (side+1)%3;
192  faceMap[PRISM-FIRST_VOL][side][3] = 3+(side+1)%3;
193  faceMap[PRISM-FIRST_VOL][side][4] = side + 3;
194  }
195  faceMap[PRISM-FIRST_VOL][3][0] = 3;
196  faceMap[PRISM-FIRST_VOL][3][1] = 2;
197  faceMap[PRISM-FIRST_VOL][3][2] = 1;
198  faceMap[PRISM-FIRST_VOL][3][3] = 0;
199  faceMap[PRISM-FIRST_VOL][4][0] = 3;
200  faceMap[PRISM-FIRST_VOL][4][1] = 3;
201  faceMap[PRISM-FIRST_VOL][4][2] = 4;
202  faceMap[PRISM-FIRST_VOL][4][3] = 5;
203 }
unsigned dimMap[MIXED]
Get dimension of entity given topology.
unsigned faceMap[LAST_VOL-FIRST_VOL+1][MAX_FACES][MAX_FACE_CONN]
Vertex indices for element faces.
unsigned edgeMap[LAST_VOL-FIRST_FACE+1][MAX_EDGES][2]
Vertex indices for element edges.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.
TopologyInfo ( )
private

Member Function Documentation

static unsigned adjacent ( EntityTopology  topo,
unsigned  dimension 
)
inlinestatic

Number of adjacent entities of a specified dimension.

For a given element topology, get the number of adjacent entities of the specified dimension.

Definition at line 51 of file includeLinks/TopologyInfo.hpp.

References TopologyInfo::adjMap, TopologyInfo::dimension(), TopologyInfo::instance, and Mesquite::MIXED.

Referenced by TopologyInfo::edges(), and TopologyInfo::faces().

52  { return (topo >= MIXED || dimension > 2) ? 0 : instance.adjMap[topo][dimension]; }
static unsigned dimension(EntityTopology topo)
Dimension of element topology.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned adjacent ( EntityTopology  topo,
unsigned  dimension 
)
inlinestatic

Number of adjacent entities of a specified dimension.

For a given element topology, get the number of adjacent entities of the specified dimension.

Definition at line 51 of file src/Mesh/TopologyInfo.hpp.

References TopologyInfo::adjMap, TopologyInfo::dimension(), TopologyInfo::instance, and Mesquite::MIXED.

52  { return (topo >= MIXED || dimension > 2) ? 0 : instance.adjMap[topo][dimension]; }
static unsigned dimension(EntityTopology topo)
Dimension of element topology.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.

Here is the call graph for this function:

static unsigned corners ( EntityTopology  topo)
inlinestatic

Get the number of defining vertices for a given element topology.

Get the number of corner vertices necessary to define an element of the specified topology. This is the number of nodes a linear element of the specified topology will have.

Definition at line 71 of file includeLinks/TopologyInfo.hpp.

References TopologyInfo::adjMap, TopologyInfo::instance, and Mesquite::MIXED.

Referenced by MeshImplData::clear_element(), MeshImplData::copy_mesh(), MeshImplData::element_topology(), MeanMidNodeMover::loop_over_mesh(), MeshImplData::num_vertex_uses(), MeshImplData::set_element(), TopologyInfo::side_vertices(), and MsqMeshEntity::vertex_count().

72  { return topo >= MIXED ? 0 : instance.adjMap[topo][0]; }
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.

Here is the caller graph for this function:

static unsigned corners ( EntityTopology  topo)
inlinestatic

Get the number of defining vertices for a given element topology.

Get the number of corner vertices necessary to define an element of the specified topology. This is the number of nodes a linear element of the specified topology will have.

Definition at line 71 of file src/Mesh/TopologyInfo.hpp.

References TopologyInfo::adjMap, TopologyInfo::instance, and Mesquite::MIXED.

72  { return topo >= MIXED ? 0 : instance.adjMap[topo][0]; }
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.
static unsigned dimension ( EntityTopology  topo)
inlinestatic

Dimension of element topology.

Definition at line 43 of file includeLinks/TopologyInfo.hpp.

References TopologyInfo::dimMap, TopologyInfo::instance, and Mesquite::MIXED.

Referenced by TopologyInfo::adjacent(), MeshImplData::has_adjacent_elements(), TopologyInfo::side_vertices(), and MeshImplData::skin().

44  { return topo >= MIXED ? 0: instance.dimMap[topo]; }
unsigned dimMap[MIXED]
Get dimension of entity given topology.

Here is the caller graph for this function:

static unsigned dimension ( EntityTopology  topo)
inlinestatic

Dimension of element topology.

Definition at line 43 of file src/Mesh/TopologyInfo.hpp.

References TopologyInfo::dimMap, TopologyInfo::instance, and Mesquite::MIXED.

44  { return topo >= MIXED ? 0: instance.dimMap[topo]; }
unsigned dimMap[MIXED]
Get dimension of entity given topology.
const unsigned * edge_vertices ( EntityTopology  topo,
unsigned  edge_number,
MsqError err 
)
static

Get indices of edge ends in element connectivity array.

Definition at line 255 of file Mesh/TopologyInfo.cpp.

References TopologyInfo::edgeMap, TopologyInfo::edges(), TopologyInfo::FIRST_FACE, TopologyInfo::instance, MsqError::INVALID_ARG, TopologyInfo::LAST_VOL, and MSQ_SETERR.

Referenced by TopologyInfo::side_vertices().

258 {
259  if (topo < (EntityTopology)FIRST_FACE ||
260  topo > (EntityTopology)LAST_VOL ||
261  edge >= edges( topo ) )
262  {
264  topo = (EntityTopology)FIRST_FACE;
265  edge = 0;
266  }
267 
268  return instance.edgeMap[topo-FIRST_FACE][edge];
269 }
EntityTopology
Definition: Mesquite.hpp:92
unsigned edgeMap[LAST_VOL-FIRST_FACE+1][MAX_EDGES][2]
Vertex indices for element edges.
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
static unsigned edges(EntityTopology topo)
Get the number of edges in a given topology.

Here is the call graph for this function:

Here is the caller graph for this function:

static const unsigned* edge_vertices ( EntityTopology  topo,
unsigned  edge_number,
MsqError err 
)
static

Get indices of edge ends in element connectivity array.

static unsigned edges ( EntityTopology  topo)
inlinestatic

Get the number of edges in a given topology.

Definition at line 75 of file src/Mesh/TopologyInfo.hpp.

References TopologyInfo::adjacent().

76  { return adjacent(topo, 1); }
static unsigned adjacent(EntityTopology topo, unsigned dimension)
Number of adjacent entities of a specified dimension.

Here is the call graph for this function:

static unsigned edges ( EntityTopology  topo)
inlinestatic

Get the number of edges in a given topology.

Definition at line 75 of file includeLinks/TopologyInfo.hpp.

References TopologyInfo::adjacent().

Referenced by TopologyInfo::edge_vertices(), TopologyInfo::higher_order(), and TopologyInfo::side_number().

76  { return adjacent(topo, 1); }
static unsigned adjacent(EntityTopology topo, unsigned dimension)
Number of adjacent entities of a specified dimension.

Here is the call graph for this function:

Here is the caller graph for this function:

const unsigned * face_vertices ( EntityTopology  topo,
unsigned  face_number,
unsigned &  num_vertices_out,
MsqError err 
)
static

Get face corner indices in element connectivity array.

Definition at line 271 of file Mesh/TopologyInfo.cpp.

References face, TopologyInfo::faceMap, TopologyInfo::faces(), TopologyInfo::FIRST_VOL, TopologyInfo::instance, MsqError::INVALID_ARG, TopologyInfo::LAST_VOL, and MSQ_SETERR.

Referenced by TopologyInfo::side_vertices().

275 {
276  if (topo < (EntityTopology)FIRST_VOL ||
277  topo > (EntityTopology)LAST_VOL ||
278  face >= faces( topo ) )
279  {
281  topo = (EntityTopology)FIRST_VOL;
282  face = 0;
283  }
284 
285  length = instance.faceMap[topo-FIRST_VOL][face][0];
286  return instance.faceMap[topo-FIRST_VOL][face] + 1;
287 }
unsigned faceMap[LAST_VOL-FIRST_VOL+1][MAX_FACES][MAX_FACE_CONN]
Vertex indices for element faces.
Definition: face.h:90
EntityTopology
Definition: Mesquite.hpp:92
static unsigned faces(EntityTopology topo)
Get the number of faces in a given topology.
double length(Vector3D *const v, int n)
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
static T_VertexSet * face
Definition: vinci_lass.c:79

Here is the call graph for this function:

Here is the caller graph for this function:

static const unsigned* face_vertices ( EntityTopology  topo,
unsigned  face_number,
unsigned &  num_vertices_out,
MsqError err 
)
static

Get face corner indices in element connectivity array.

static unsigned faces ( EntityTopology  topo)
inlinestatic

Get the number of faces in a given topology.

Definition at line 79 of file src/Mesh/TopologyInfo.hpp.

References TopologyInfo::adjacent().

80  { return adjacent(topo, 2 ); }
static unsigned adjacent(EntityTopology topo, unsigned dimension)
Number of adjacent entities of a specified dimension.

Here is the call graph for this function:

static unsigned faces ( EntityTopology  topo)
inlinestatic

Get the number of faces in a given topology.

Definition at line 79 of file includeLinks/TopologyInfo.hpp.

References TopologyInfo::adjacent().

Referenced by TopologyInfo::face_vertices(), TopologyInfo::higher_order(), and TopologyInfo::side_number().

80  { return adjacent(topo, 2 ); }
static unsigned adjacent(EntityTopology topo, unsigned dimension)
Number of adjacent entities of a specified dimension.

Here is the call graph for this function:

Here is the caller graph for this function:

static void higher_order ( EntityTopology  topo,
unsigned  num_nodes,
bool &  midedge,
bool &  midface,
bool &  midvol,
MsqError err 
)
static

Check which mid-nodes a higher-order element has.

Assuming at most one mid-node per sub-entity per dimension (i.e. at most one mid-edge node, at most one mid-face node, etc.) determine which mid-nodes are present given the topology and total number of nodes.

void higher_order ( EntityTopology  topo,
unsigned  num_nodes,
bool &  midedge,
bool &  midface,
bool &  midvol,
MsqError err 
)
static

Check which mid-nodes a higher-order element has.

Assuming at most one mid-node per sub-entity per dimension (i.e. at most one mid-edge node, at most one mid-face node, etc.) determine which mid-nodes are present given the topology and total number of nodes.

Definition at line 205 of file Mesh/TopologyInfo.cpp.

References TopologyInfo::adjMap, TopologyInfo::dimMap, TopologyInfo::edges(), TopologyInfo::faces(), TopologyInfo::instance, MsqError::INVALID_ARG, MsqError::INVALID_STATE, Mesquite::MIXED, and MSQ_SETERR.

211 {
212  midedge = midface = midvol = false;
213  if (topo >= MIXED || num_nodes < instance.adjMap[topo][0])
214  {
215  MSQ_SETERR(err)("Invalid element topology", MsqError::INVALID_ARG);
216  return;
217  }
218 
219  unsigned dim = instance.dimMap[topo];
220  assert( num_nodes >= instance.adjMap[topo][0] );
221  unsigned nodes = num_nodes - instance.adjMap[topo][0];
222  unsigned edges = instance.adjMap[topo][1];
223  unsigned faces = instance.adjMap[topo][2];
224  if (edges && nodes >= edges)
225  {
226  nodes -= edges;
227  midedge = true;
228  }
229  if (faces && nodes >= faces)
230  {
231  nodes -= faces;
232  midface = true;
233  }
234  if (1 == nodes)
235  {
236  if (2 == dim)
237  {
238  nodes -= 1;
239  midface = true;
240  }
241  else if(3 == dim)
242  {
243  nodes -= 1;
244  midvol = true;
245  }
246  }
247 
248  if (nodes)
249  {
250  MSQ_SETERR(err)("Invalid element topology", MsqError::INVALID_STATE);
251  }
252 }
unsigned dimMap[MIXED]
Get dimension of entity given topology.
static unsigned faces(EntityTopology topo)
Get the number of faces in a given topology.
const int num_nodes
Definition: ex1.C:96
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
static unsigned edges(EntityTopology topo)
Get the number of edges in a given topology.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.
object is in an invalid state

Here is the call graph for this function:

void side_number ( EntityTopology  topo,
unsigned  connectivity_length,
unsigned  node_index,
unsigned &  side_dimension_out,
unsigned &  side_number_out,
MsqError err 
)
static

Return which side the specified mid-node lies on.

Given an non-linear element type (specified by the topology and lenght of the connectiivty array) and the index of a node in the element's connectivity array, return the lower-dimension entity (side) of the element the mid-node lies on.

Parameters
topoElement topology
connectivity_lengthNumber of nodes in element
node_indexWhich node of the element
side_dimension_outThe dimension of the side containing the midnode (0 = vertex, 1 = edge, 2 = face, 3 = volume)
side_number_outThe canonical number of the side

Definition at line 326 of file Mesh/TopologyInfo.cpp.

References TopologyInfo::adjMap, TopologyInfo::dimMap, TopologyInfo::edges(), TopologyInfo::faces(), TopologyInfo::instance, MsqError::INVALID_ARG, Mesquite::MIXED, and MSQ_SETERR.

Referenced by MeshImplData::copy_higher_order(), and MeanMidNodeMover::loop_over_mesh().

332 {
333  if (topo >= (EntityTopology)MIXED || num_nodes < instance.adjMap[topo][0])
334  {
335  MSQ_SETERR(err)("Invalid element topology", MsqError::INVALID_ARG);
336  return;
337  }
338 
339  unsigned nodes = instance.adjMap[topo][0];
340  unsigned edges = instance.adjMap[topo][1];
341  unsigned faces = instance.adjMap[topo][2];
342  side_num_out = node_index;
343 
344  if (side_num_out < nodes)
345  {
346  side_dim_out = 0;
347  return;
348  }
349  num_nodes -= nodes;
350  side_num_out -= nodes;
351 
352  if (edges && num_nodes >= edges)
353  {
354  if (side_num_out < edges)
355  {
356  side_dim_out = 1;
357  return;
358  }
359  num_nodes -= edges;
360  side_num_out -= edges;
361  }
362  if (faces && num_nodes >= faces)
363  {
364  if (side_num_out < faces)
365  {
366  side_dim_out = 2;
367  return;
368  }
369  num_nodes -= faces;
370  side_num_out -= faces;
371  }
372  if (side_num_out == 0)
373  {
374  side_dim_out = instance.dimMap[topo];
375  side_num_out = 0;
376  return;
377  }
378 
380 }
unsigned dimMap[MIXED]
Get dimension of entity given topology.
EntityTopology
Definition: Mesquite.hpp:92
static unsigned faces(EntityTopology topo)
Get the number of faces in a given topology.
const int num_nodes
Definition: ex1.C:96
invalid function argument passed
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
static unsigned edges(EntityTopology topo)
Get the number of edges in a given topology.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.

Here is the call graph for this function:

Here is the caller graph for this function:

static void side_number ( EntityTopology  topo,
unsigned  connectivity_length,
unsigned  node_index,
unsigned &  side_dimension_out,
unsigned &  side_number_out,
MsqError err 
)
static

Return which side the specified mid-node lies on.

Given an non-linear element type (specified by the topology and lenght of the connectiivty array) and the index of a node in the element's connectivity array, return the lower-dimension entity (side) of the element the mid-node lies on.

Parameters
topoElement topology
connectivity_lengthNumber of nodes in element
node_indexWhich node of the element
side_dimension_outThe dimension of the side containing the midnode (0 = vertex, 1 = edge, 2 = face, 3 = volume)
side_number_outThe canonical number of the side
static const unsigned* side_vertices ( EntityTopology  topo,
unsigned  side_dimension,
unsigned  side_number,
unsigned &  num_verts_out,
MsqError err 
)
static

Get corner indices of side.

Get the indices into element connectivity list for the corners/ends of the specified side of the element. If the passed dimension equals that of the specified topology, the side number is ignored and all the corners of the element are returned. Fails if side dimension greater than the dimension of the specified topology type.

const unsigned * side_vertices ( EntityTopology  topo,
unsigned  side_dimension,
unsigned  side_number,
unsigned &  num_verts_out,
MsqError err 
)
static

Get corner indices of side.

Get the indices into element connectivity list for the corners/ends of the specified side of the element. If the passed dimension equals that of the specified topology, the side number is ignored and all the corners of the element are returned. Fails if side dimension greater than the dimension of the specified topology type.

Definition at line 292 of file Mesh/TopologyInfo.cpp.

References TopologyInfo::corners(), TopologyInfo::dimension(), TopologyInfo::edge_vertices(), TopologyInfo::face_vertices(), MsqError::INVALID_ARG, and MSQ_SETERR.

Referenced by MeshImplData::copy_higher_order(), MeanMidNodeMover::loop_over_mesh(), and MeshImplData::skin().

297 {
298  static const unsigned all[] = { 0, 1, 2, 3, 4, 5, 6, 7 };
299  const unsigned* result;
300 
301  if (dim != 0 && dim == dimension(topo))
302  {
303  count_out = corners( topo );
304  result = all;
305  }
306  else if (dim == 1)
307  {
308  count_out = 2;
309  result = edge_vertices( topo, side, err );
310  }
311  else if( dim == 2)
312  {
313  result = face_vertices( topo, side, count_out, err );
314  }
315  else
316  {
318  count_out = 0;
319  result = 0;
320  }
321  return result;
322 }
invalid function argument passed
static unsigned dimension(EntityTopology topo)
Dimension of element topology.
static const unsigned * edge_vertices(EntityTopology topo, unsigned edge_number, MsqError &err)
Get indices of edge ends in element connectivity array.
#define MSQ_SETERR(err)
Macro to set error - use err.clear() to clear.
static unsigned corners(EntityTopology topo)
Get the number of defining vertices for a given element topology.
static const unsigned * face_vertices(EntityTopology topo, unsigned face_number, unsigned &num_vertices_out, MsqError &err)
Get face corner indices in element connectivity array.

Here is the call graph for this function:

Here is the caller graph for this function:

static unsigned sides ( EntityTopology  topo)
inlinestatic

Get number of sides a given topology type has.

Get the number of sides for a given element topology. Returns the number of adjacent entities of one less dimension. The number of faces for a volume element and the number of edges for a face element

Definition at line 61 of file src/Mesh/TopologyInfo.hpp.

References TopologyInfo::adjMap, TopologyInfo::dimMap, TopologyInfo::instance, and Mesquite::MIXED.

62  { return (topo >= MIXED || instance.dimMap[topo] < 1) ? 0 :
63  instance.adjMap[topo][instance.dimMap[topo]-1]; }
unsigned dimMap[MIXED]
Get dimension of entity given topology.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.
static unsigned sides ( EntityTopology  topo)
inlinestatic

Get number of sides a given topology type has.

Get the number of sides for a given element topology. Returns the number of adjacent entities of one less dimension. The number of faces for a volume element and the number of edges for a face element

Definition at line 61 of file includeLinks/TopologyInfo.hpp.

References TopologyInfo::adjMap, TopologyInfo::dimMap, TopologyInfo::instance, and Mesquite::MIXED.

Referenced by MeshImplData::skin().

62  { return (topo >= MIXED || instance.dimMap[topo] < 1) ? 0 :
63  instance.adjMap[topo][instance.dimMap[topo]-1]; }
unsigned dimMap[MIXED]
Get dimension of entity given topology.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.

Here is the caller graph for this function:

Member Data Documentation

unsigned adjMap
private

Get number of adj entities of dimension 0, 1 and dimension 2.

Definition at line 156 of file includeLinks/TopologyInfo.hpp.

Referenced by TopologyInfo::adjacent(), TopologyInfo::corners(), TopologyInfo::higher_order(), TopologyInfo::side_number(), TopologyInfo::sides(), and TopologyInfo::TopologyInfo().

unsigned dimMap
private
unsigned edgeMap
private

Vertex indices for element edges.

Definition at line 158 of file includeLinks/TopologyInfo.hpp.

Referenced by TopologyInfo::edge_vertices(), and TopologyInfo::TopologyInfo().

unsigned faceMap
private

Vertex indices for element faces.

Definition at line 160 of file includeLinks/TopologyInfo.hpp.

Referenced by TopologyInfo::face_vertices(), and TopologyInfo::TopologyInfo().


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