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::petnShape Class Reference

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

Detailed Description

This particular shape is called "PETN", which is a shape of "Pentaerythritol tetranitrate" crystal. Ref -> https://en.wikipedia.org/wiki/Pentaerythritol_tetranitrate

Definition at line 46 of file petnShape.H.

Public Member Functions

 petnShape ()
 petnShape class standard constructor More...
 
 ~petnShape ()
 petnShape 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

◆ petnShape()

NEM::GEO::petnShape::petnShape ( )

Definition at line 43 of file petnShape.C.

44 {
45  // Nothing
46 }

◆ ~petnShape()

NEM::GEO::petnShape::~petnShape ( )

Definition at line 48 of file petnShape.C.

49 {
50  // Nothing
51 }

Member Function Documentation

◆ getFaces()

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

Implements NEM::GEO::rocPackShape.

Definition at line 153 of file petnShape.C.

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

Implements NEM::GEO::rocPackShape.

Definition at line 54 of file petnShape.C.

55 {
56  // Adding vertex data
57  std::vector<std::vector<double>> verts;
58  verts.resize(18);
59 
60  verts[0].resize(3);
61  verts[0][0] = 0.00;
62  verts[0][1] = -0.45;
63  verts[0][2] = 0.00;
64 
65  verts[1].resize(3);
66  verts[1][0] = 0.20;
67  verts[1][1] = -0.25;
68  verts[1][2] = -0.20;
69 
70  verts[2].resize(3);
71  verts[2][0] = 0.20;
72  verts[2][1] = -0.35;
73  verts[2][2] = 0.00;
74 
75  verts[3].resize(3);
76  verts[3][0] = 0.00;
77  verts[3][1] = -0.35;
78  verts[3][2] = -0.20;
79 
80  verts[4].resize(3);
81  verts[4][0] = 0.20;
82  verts[4][1] = -0.25;
83  verts[4][2] = 0.20;
84 
85  verts[5].resize(3);
86  verts[5][0] = 0.00;
87  verts[5][1] = -0.35;
88  verts[5][2] = 0.20;
89 
90  verts[6].resize(3);
91  verts[6][0] = -0.20;
92  verts[6][1] = -0.25;
93  verts[6][2] = 0.20;
94 
95  verts[7].resize(3);
96  verts[7][0] = -0.20;
97  verts[7][1] = -0.35;
98  verts[7][2] = 0.00;
99 
100  verts[8].resize(3);
101  verts[8][0] = -0.20;
102  verts[8][1] = -0.25;
103  verts[8][2] = -0.20;
104 
105  verts[9].resize(3);
106  verts[9][0] = 0.00;
107  verts[9][1] = 0.45;
108  verts[9][2] = 0.00;
109 
110  verts[10].resize(3);
111  verts[10][0] = 0.20;
112  verts[10][1] = 0.25;
113  verts[10][2] = -0.20;
114 
115  verts[11].resize(3);
116  verts[11][0] = 0.20;
117  verts[11][1] = 0.35;
118  verts[11][2] = 0.00;
119 
120  verts[12].resize(3);
121  verts[12][0] = 0.00;
122  verts[12][1] = 0.35;
123  verts[12][2] = -0.20;
124 
125  verts[13].resize(3);
126  verts[13][0] = 0.20;
127  verts[13][1] = 0.25;
128  verts[13][2] = 0.20;
129 
130  verts[14].resize(3);
131  verts[14][0] = 0.00;
132  verts[14][1] = 0.35;
133  verts[14][2] = 0.20;
134 
135  verts[15].resize(3);
136  verts[15][0] = -0.20;
137  verts[15][1] = 0.25;
138  verts[15][2] = 0.20;
139 
140  verts[16].resize(3);
141  verts[16][0] = -0.20;
142  verts[16][1] = 0.35;
143  verts[16][2] = 0.00;
144 
145  verts[17].resize(3);
146  verts[17][0] = -0.20;
147  verts[17][1] = 0.25;
148  verts[17][2] = -0.20;
149 
150  return verts;
151 }

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