Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
includeLinks/TopologyInfo.hpp
Go to the documentation of this file.
1 /* *****************************************************************
2  MESQUITE -- The Mesh Quality Improvement Toolkit
3 
4  Copyright 2004 Lawrence Livermore National Laboratory. Under
5  the terms of Contract B545069 with the University of Wisconsin --
6  Madison, Lawrence Livermore National Laboratory retains certain
7  rights in this software.
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Lesser General Public
11  License as published by the Free Software Foundation; either
12  version 2.1 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  (lgpl.txt) along with this library; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 
23  kraftche@cae.wisc.edu
24 
25  ***************************************************************** */
26 
27 #ifndef MESQUITE_TOPOLOGY_INFO_HPP
28 #define MESQUITE_TOPOLOGY_INFO_HPP
29 
30 #include "Mesquite.hpp"
31 
32 namespace Mesquite
33 {
34 
35 class MsqError;
36 
39 {
40  public:
41 
43  static unsigned dimension( EntityTopology topo )
44  { return topo >= MIXED ? 0: instance.dimMap[topo]; }
45 
51  static unsigned adjacent( EntityTopology topo, unsigned dimension )
52  { return (topo >= MIXED || dimension > 2) ? 0 : instance.adjMap[topo][dimension]; }
53 
61  static unsigned sides( EntityTopology topo )
62  { return (topo >= MIXED || instance.dimMap[topo] < 1) ? 0 :
63  instance.adjMap[topo][instance.dimMap[topo]-1]; }
64 
71  static unsigned corners( EntityTopology topo )
72  { return topo >= MIXED ? 0 : instance.adjMap[topo][0]; }
73 
75  static unsigned edges( EntityTopology topo )
76  { return adjacent(topo, 1); }
77 
79  static unsigned faces( EntityTopology topo )
80  { return adjacent(topo, 2 ); }
81 
89  static void higher_order( EntityTopology topo, unsigned num_nodes,
90  bool& midedge, bool& midface, bool& midvol,
91  MsqError &err );
92 
94  static const unsigned* edge_vertices( EntityTopology topo,
95  unsigned edge_number,
96  MsqError& err );
97 
99  static const unsigned* face_vertices( EntityTopology topo,
100  unsigned face_number,
101  unsigned& num_vertices_out,
102  MsqError& err );
103 
113  static const unsigned* side_vertices( EntityTopology topo,
114  unsigned side_dimension,
115  unsigned side_number,
116  unsigned& num_verts_out,
117  MsqError& err );
118 
119 
120 
136  static void side_number( EntityTopology topo,
137  unsigned connectivity_length,
138  unsigned node_index,
139  unsigned& side_dimension_out,
140  unsigned& side_number_out,
141  MsqError& err );
142 
143  private:
144 
145  enum {
146  MAX_EDGES = 12,
153  };
154 
155  unsigned dimMap[MIXED];
156  unsigned adjMap[MIXED][3];
161 
162  TopologyInfo();
163 
165 
166 };
167 
168 } //namespace Mesquite
169 
170 #endif
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.
static unsigned adjacent(EntityTopology topo, unsigned dimension)
Number of adjacent entities of a specified dimension.
Used to hold the error state and return it to the application.
EntityTopology
Definition: Mesquite.hpp:92
unsigned edgeMap[LAST_VOL-FIRST_FACE+1][MAX_EDGES][2]
Vertex indices for element edges.
static unsigned faces(EntityTopology topo)
Get the number of faces in a given topology.
const int num_nodes
Definition: ex1.C:96
static unsigned sides(EntityTopology topo)
Get number of sides a given topology type has.
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.
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.
static unsigned corners(EntityTopology topo)
Get the number of defining vertices for a given element topology.
static unsigned edges(EntityTopology topo)
Get the number of edges in a given 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.
unsigned adjMap[MIXED][3]
Get number of adj entities of dimension 0, 1 and dimension 2.
Information about different element topologies.
static const unsigned * side_vertices(EntityTopology topo, unsigned side_dimension, unsigned side_number, unsigned &num_verts_out, MsqError &err)
Get corner indices of side.
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.