NEMoSys  0.63.0
A modular, extensible resource with robust automated mesh generation, mesh quality analysis, adaptive mesh refinement, and data transfer between arbitrary meshes.
NEM::GEO::hmxShape Class Reference

This class wraps around abstract class rocPackShape. More...

Detailed Description

This particular shape is called "HMX", which is a shape of "Octogen" crystal. Ref -> https://en.wikipedia.org/wiki/HMX

Definition at line 45 of file hmxShape.H.

Public Member Functions

 hmxShape ()
 hmxShape class standard constructor More...
 
 ~hmxShape ()
 hmxShape class standard destructor More...
 
std::vector< std::vector< double > > getVertices () override
 Gets vertices of pack shapes. More...
 
std::vector< std::vector< int > > getFaces () override
 Gets faces of pack shapes. More...
 

Static Public Member Functions

static std::shared_ptr< rocPackShapegetShape (const std::string &shapeName)
 Creates shape object for requsted shape. More...
 

Inherits NEM::GEO::rocPackShape.

Constructor & Destructor Documentation

◆ hmxShape()

NEM::GEO::hmxShape::hmxShape ( )

Definition at line 43 of file hmxShape.C.

44 {
45  // Noething
46 }

◆ ~hmxShape()

NEM::GEO::hmxShape::~hmxShape ( )

Definition at line 48 of file hmxShape.C.

49 {
50  // Noething
51 }

Member Function Documentation

◆ getFaces()

std::vector< std::vector< int > > NEM::GEO::hmxShape::getFaces ( )
overridevirtual

Implements NEM::GEO::rocPackShape.

Definition at line 153 of file hmxShape.C.

154 {
155  // Adding face data
156  std::vector<std::vector<int>> faces;
157  faces.resize(12);
158 
159  faces[0].resize(5);
160  faces[0][0] = 0;
161  faces[0][1] = 7;
162  faces[0][2] = 6;
163  faces[0][3] = 8;
164  faces[0][4] = 1;
165 
166  faces[1].resize(5);
167  faces[1][0] = 2;
168  faces[1][1] = 9;
169  faces[1][2] = 10;
170  faces[1][3] = 11;
171  faces[1][4] = 3;
172 
173  faces[2].resize(5);
174  faces[2][0] = 0;
175  faces[2][1] = 1;
176  faces[2][2] = 14;
177  faces[2][3] = 12;
178  faces[2][4] = 13;
179 
180  faces[3].resize(5);
181  faces[3][0] = 2;
182  faces[3][1] = 3;
183  faces[3][2] = 17;
184  faces[3][3] = 16;
185  faces[3][4] = 15;
186 
187  faces[4].resize(4);
188  faces[4][0] = 6;
189  faces[4][1] = 7;
190  faces[4][2] = 10;
191  faces[4][3] = 9;
192 
193  faces[5].resize(4);
194  faces[5][0] = 12;
195  faces[5][1] = 15;
196  faces[5][2] = 16;
197  faces[5][3] = 13;
198 
199  faces[6].resize(5);
200  faces[6][0] = 2;
201  faces[6][1] = 4;
202  faces[6][2] = 8;
203  faces[6][3] = 6;
204  faces[6][4] = 9;
205 
206  faces[7].resize(5);
207  faces[7][0] = 0;
208  faces[7][1] = 5;
209  faces[7][2] = 11;
210  faces[7][3] = 10;
211  faces[7][4] = 7;
212 
213  faces[8].resize(5);
214  faces[8][0] = 2;
215  faces[8][1] = 15;
216  faces[8][2] = 12;
217  faces[8][3] = 14;
218  faces[8][4] = 4;
219 
220  faces[9].resize(5);
221  faces[9][0] = 0;
222  faces[9][1] = 13;
223  faces[9][2] = 16;
224  faces[9][3] = 17;
225  faces[9][4] = 5;
226 
227  faces[10].resize(4);
228  faces[10][0] = 1;
229  faces[10][1] = 8;
230  faces[10][2] = 4;
231  faces[10][3] = 14;
232 
233  faces[11].resize(4);
234  faces[11][0] = 3;
235  faces[11][1] = 11;
236  faces[11][2] = 5;
237  faces[11][3] = 17;
238 
239  return faces;
240 }

◆ getShape()

std::shared_ptr< rocPackShape > NEM::GEO::rocPackShape::getShape ( const std::string &  shapeName)
staticinherited
Parameters
shapeNameName of shape requested Shape pointer

Definition at line 38 of file rocPackShape.C.

Referenced by NEM::GEO::rocPack::rocParser().

39  {
40  if (shapeName == "hmx") {
41  std::shared_ptr<hmxShape> assignShape(new hmxShape());
42  return assignShape;
43  } else if (shapeName == "petn") {
44  std::shared_ptr<petnShape> assignShape(new petnShape());
45  return assignShape;
46  } else if (shapeName == "icosidodecahedron") {
47  std::shared_ptr<icosidodecahedronShape> assignShape(
48  new icosidodecahedronShape());
49  return assignShape;
50  } else {
51  std::cerr << "The " << shapeName << " shape is not supported yet!"
52  << std::endl;
53  throw;
54  }
55 }

◆ getVertices()

std::vector< std::vector< double > > NEM::GEO::hmxShape::getVertices ( )
overridevirtual

Implements NEM::GEO::rocPackShape.

Definition at line 53 of file hmxShape.C.

54 {
55  // Adding vertex data
56  std::vector<std::vector<double>> verts;
57  verts.resize(18);
58 
59  verts[0].resize(3);
60  verts[0][0] = -1.3973946670992046;
61  verts[0][1] = 0.8294297402753090;
62  verts[0][2] = 0.7394707591127669;
63 
64  verts[1].resize(3);
65  verts[1][0] = -0.6657703416741856;
66  verts[1][1] = -1.3009854568631263;
67  verts[1][2] = 0.4264290990409822;
68 
69  verts[2].resize(3);
70  verts[2][0] = 1.3973947035090559;
71  verts[2][1] = -0.8294297602140067;
72  verts[2][2] = -0.7394707784531516;
73 
74  verts[3].resize(3);
75  verts[3][0] = 0.6657703744131530;
76  verts[3][1] = 1.3009854476136657;
77  verts[3][2] = -0.4264291168106977;
78 
79  verts[4].resize(3);
80  verts[4][0] = 0.3835703684025527;
81  verts[4][1] = -1.5974467033338673;
82  verts[4][2] = -0.1431211054793107;
83 
84  verts[5].resize(3);
85  verts[5][0] = -0.3835703227123897;
86  verts[5][1] = 1.5974466904254172;
87  verts[5][2] = 0.1431210806800808;
88 
89  verts[6].resize(3);
90  verts[6][0] = -0.6302224609427972;
91  verts[6][1] = -0.9781790576670774;
92  verts[6][2] = -1.1521344230410329;
93 
94  verts[7].resize(3);
95  verts[7][0] = -1.1453321714573643;
96  verts[7][1] = 0.5217677283235427;
97  verts[7][2] = -0.9317333328983531;
98 
99  verts[8].resize(3);
100  verts[8][0] = -0.5198978031779152;
101  verts[8][1] = -1.4790343116441396;
102  verts[8][2] = -0.5407230456136918;
103 
104  verts[9].resize(3);
105  verts[9][0] = -0.1637657754207528;
106  verts[9][1] = -0.6248174097886718;
107  verts[9][2] = -1.4265126187846873;
108 
109  verts[10].resize(3);
110  verts[10][0] = -0.6788754859353187;
111  verts[10][1] = 0.8751293762019474;
112  verts[10][2] = -1.2061115286420081;
113 
114  verts[11].resize(3);
115  verts[11][0] = -0.2376977860165109;
116  verts[11][1] = 1.4193978378419216;
117  verts[11][2] = -0.8240310520377883;
118 
119  verts[12].resize(3);
120  verts[12][0] = 0.6788754551281021;
121  verts[12][1] = -0.8751294321178871;
122  verts[12][2] = 1.2061114962377961;
123 
124  verts[13].resize(3);
125  verts[13][0] = 0.1637657886385562;
126  verts[13][1] = 0.6248173573382960;
127  verts[13][2] = 1.4265126656883920;
128 
129  verts[14].resize(3);
130  verts[14][0] = 0.2376977724807246;
131  verts[14][1] = -1.4193978708317796;
132  verts[14][2] = 0.8240309982418957;
133 
134  verts[15].resize(3);
135  verts[15][0] = 1.1453321406501467;
136  verts[15][1] = -0.5217677842394817;
137  verts[15][2] = 0.9317333004941414;
138 
139  verts[16].resize(3);
140  verts[16][0] = 0.6302224741606013;
141  verts[16][1] = 0.9781790052167011;
142  verts[16][2] = 1.1521344699447380;
143 
144  verts[17].resize(3);
145  verts[17][0] = 0.5198978428216525;
146  verts[17][1] = 1.4790342828404699;
147  verts[17][2] = 0.5407230876168944;
148 
149  return verts;
150 
151 }

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