Nektar++
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
Nektar::Utilities::InputNek5000 Class Reference

#include <InputNek5000.h>

Inheritance diagram for Nektar::Utilities::InputNek5000:
[legend]

Public Member Functions

 InputNek5000 (NekMeshUtils::MeshSharedPtr p_m)
 
virtual ~InputNek5000 ()
 
virtual void Process ()
 Processes Nek5000 file format. More...
 
- Public Member Functions inherited from Nektar::NekMeshUtils::InputModule
NEKMESHUTILS_EXPORT InputModule (MeshSharedPtr p_m)
 
NEKMESHUTILS_EXPORT void OpenStream ()
 Open a file for input. More...
 
- Public Member Functions inherited from Nektar::NekMeshUtils::Module
NEKMESHUTILS_EXPORT Module (MeshSharedPtr p_m)
 
NEKMESHUTILS_EXPORT void RegisterConfig (std::string key, std::string value=std::string())
 Register a configuration option with a module. More...
 
NEKMESHUTILS_EXPORT void PrintConfig ()
 Print out all configuration options for a module. More...
 
NEKMESHUTILS_EXPORT void SetDefaults ()
 Sets default configuration options for those which have not been set. More...
 
NEKMESHUTILS_EXPORT MeshSharedPtr GetMesh ()
 
virtual NEKMESHUTILS_EXPORT void ProcessVertices ()
 Extract element vertices. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessEdges (bool ReprocessEdges=true)
 Extract element edges. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessFaces (bool ReprocessFaces=true)
 Extract element faces. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessElements ()
 Generate element IDs. More...
 
virtual NEKMESHUTILS_EXPORT void ProcessComposites ()
 Generate composites. More...
 
virtual NEKMESHUTILS_EXPORT void ClearElementLinks ()
 

Static Public Member Functions

static NekMeshUtils::ModuleSharedPtr create (NekMeshUtils::MeshSharedPtr m)
 Creates an instance of this class. More...
 

Static Public Attributes

static NekMeshUtils::ModuleKey className
 ModuleKey for class. More...
 

Private Member Functions

void LoadHOSurfaces ()
 

Additional Inherited Members

- Protected Member Functions inherited from Nektar::NekMeshUtils::InputModule
NEKMESHUTILS_EXPORT void PrintSummary ()
 Print summary of elements. More...
 
- Protected Member Functions inherited from Nektar::NekMeshUtils::Module
NEKMESHUTILS_EXPORT void ReorderPrisms (PerMap &perFaces)
 Reorder node IDs so that prisms and tetrahedra are aligned correctly. More...
 
NEKMESHUTILS_EXPORT void PrismLines (int prism, PerMap &perFaces, std::set< int > &prismsDone, std::vector< ElementSharedPtr > &line)
 
- Protected Attributes inherited from Nektar::NekMeshUtils::InputModule
io::filtering_istream m_mshFile
 Input stream. More...
 
std::ifstream m_mshFileStream
 Input stream. More...
 
- Protected Attributes inherited from Nektar::NekMeshUtils::Module
MeshSharedPtr m_mesh
 Mesh object. More...
 
std::map< std::string, ConfigOptionm_config
 List of configuration values. More...
 

Detailed Description

Converter class for Nektar session files.

Definition at line 53 of file utilities/NekMesh/InputModules/InputNek5000.h.

Constructor & Destructor Documentation

◆ InputNek5000()

Nektar::Utilities::InputNek5000::InputNek5000 ( NekMeshUtils::MeshSharedPtr  p_m)

Definition at line 59 of file utilities/NekMesh/InputModules/InputNek5000.cpp.

59  : InputModule(m)
60 {
61 }
NEKMESHUTILS_EXPORT InputModule(MeshSharedPtr p_m)

◆ ~InputNek5000()

Nektar::Utilities::InputNek5000::~InputNek5000 ( )
virtual

Definition at line 63 of file utilities/NekMesh/InputModules/InputNek5000.cpp.

64 {
65 }

Member Function Documentation

◆ create()

static NekMeshUtils::ModuleSharedPtr Nektar::Utilities::InputNek5000::create ( NekMeshUtils::MeshSharedPtr  m)
inlinestatic

Creates an instance of this class.

Definition at line 61 of file utilities/NekMesh/InputModules/InputNek5000.h.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr().

62  {
64  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.

◆ LoadHOSurfaces()

void Nektar::Utilities::InputNek5000::LoadHOSurfaces ( )
private

◆ Process()

void Nektar::Utilities::InputNek5000::Process ( )
virtual

Processes Nek5000 file format.

Nek5000 sessions are defined by rea files, and contain sections defining a DNS simulation in a specific order. The converter only reads mesh information, curve information if it exists and boundary information. The format is similar to the rea format supported by #InputNek, but the layout is sufficiently different that this module is separate.

Implements Nektar::NekMeshUtils::Module.

Definition at line 76 of file utilities/NekMesh/InputModules/InputNek5000.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), Nektar::LibUtilities::NekFactory< tKey, tBase, tParam >::CreateInstance(), Nektar::NekMeshUtils::Node::dot(), Nektar::SpatialDomains::eDirichlet, Nektar::LibUtilities::eGaussLobattoLegendre, Nektar::LibUtilities::eHexahedron, Nektar::NekMeshUtils::eHOPCondition, Nektar::SpatialDomains::ePeriodic, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eSegment, Nektar::NekMeshUtils::GetElementFactory(), Nektar::NekMeshUtils::Module::m_mesh, Nektar::NekMeshUtils::InputModule::m_mshFile, Nektar::NekMeshUtils::Node::m_x, Nektar::NekMeshUtils::Node::m_y, Nektar::NekMeshUtils::Node::m_z, class_topology::Node, Nektar::NekMeshUtils::InputModule::OpenStream(), Nektar::LibUtilities::PointsManager(), Nektar::NekMeshUtils::Module::ProcessComposites(), Nektar::NekMeshUtils::Module::ProcessEdges(), Nektar::NekMeshUtils::Module::ProcessElements(), Nektar::NekMeshUtils::Module::ProcessFaces(), and sign.

77 {
78  // Open the file stream.
79  OpenStream();
80 
81  string line, word;
82  int nParam, nElements, nCurves;
83  int i, j, k, nodeCounter = 0;
84  int nComposite = 1;
86  double vertex[8][3];
87 
88  m_mesh->m_expDim = 0;
89  m_mesh->m_spaceDim = 0;
90 
91  if (m_mesh->m_verbose)
92  {
93  cout << "InputNek5000: Start reading file..." << endl;
94  }
95 
96  // -- Read in parameters.
97 
98  // Ignore first 3 lines. 4th line contains number of parameters.
99  for (i = 0; i < 4; ++i)
100  {
101  getline(m_mshFile, line);
102  }
103 
104  stringstream s(line);
105  s >> nParam;
106 
107  for (i = 0; i < nParam; ++i)
108  {
109  string tmp1, tmp2;
110  getline(m_mshFile, line);
111  s.str(line);
112  s >> tmp1 >> tmp2;
113  }
114 
115  // -- Read in passive scalars (ignore)
116  getline(m_mshFile, line);
117  s.clear();
118  s.str(line);
119  s >> j;
120  for (i = 0; i < j; ++i)
121  {
122  getline(m_mshFile, line);
123  }
124 
125  // -- Read in logical switches (ignore)
126  getline(m_mshFile, line);
127  s.clear();
128  s.str(line);
129  s >> j;
130  for (i = 0; i < j; ++i)
131  {
132  getline(m_mshFile, line);
133  }
134 
135  // -- Read in mesh data.
136 
137  // First hunt for MESH tag
138  bool foundMesh = false;
139  while (!m_mshFile.eof())
140  {
141  getline(m_mshFile, line);
142  if (line.find("MESH") != string::npos)
143  {
144  foundMesh = true;
145  break;
146  }
147  }
148 
149  if (!foundMesh)
150  {
151  cerr << "Couldn't find MESH tag inside file." << endl;
152  abort();
153  }
154 
155  // Now read in number of elements and space dimension.
156  getline(m_mshFile, line);
157  s.clear();
158  s.str(line);
159  s >> nElements >> m_mesh->m_expDim;
160  m_mesh->m_spaceDim = m_mesh->m_expDim;
161 
162  // Set up field names.
163  m_mesh->m_fields.push_back("u");
164  m_mesh->m_fields.push_back("v");
165  if (m_mesh->m_spaceDim > 2)
166  {
167  m_mesh->m_fields.push_back("w");
168  }
169  m_mesh->m_fields.push_back("p");
170 
171  // Loop over and create elements.
172  for (i = 0; i < nElements; ++i)
173  {
174  int nNodes;
175  getline(m_mshFile, line);
176 
177  if (m_mesh->m_expDim == 2)
178  {
179  // - quad: 2 lines with x-coords, y-coords
181  nNodes = 4;
182  for (j = 0; j < 2; ++j)
183  {
184  getline(m_mshFile, line);
185  s.clear();
186  s.str(line);
187  for (k = 0; k < 4; ++k)
188  {
189  s >> vertex[k][j];
190  }
191  }
192  }
193  else
194  {
195  // - hex: 3 lines with x/y/z-coords for base 4 nodes, then 3 more
196  // for upper 4 nodes
197  elType = LibUtilities::eHexahedron;
198  nNodes = 8;
199  for (j = 0; j < 6; ++j)
200  {
201  getline(m_mshFile, line);
202  s.clear();
203  s.str(line);
204  int offset = j > 2 ? 4 : 0;
205  for (k = 0; k < 4; ++k)
206  {
207  s >> vertex[offset + k][j % 3];
208  }
209  }
210  }
211 
212  // Nek5000 meshes do not contain a unique list of nodes, so this block
213  // constructs a unique set so that elements can be created with unique
214  // nodes.
215  vector<NodeSharedPtr> nodeList(nNodes);
216  for (k = 0; k < nNodes; ++k)
217  {
218  nodeList[k] = std::shared_ptr<Node>(
219  new Node(
220  0, vertex[k][0], vertex[k][1], vertex[k][2]));
221  auto testIns = m_mesh->m_vertexSet.insert(nodeList[k]);
222 
223  if (!testIns.second)
224  {
225  nodeList[k] = *(testIns.first);
226  }
227  else
228  {
229  nodeList[k]->m_id = nodeCounter++;
230  }
231  }
232 
233  vector<int> tags(1, 0);
234  ElmtConfig conf(elType, 1, false, false);
236  elType, conf, nodeList, tags);
237  m_mesh->m_element[E->GetDim()].push_back(E);
238  }
239 
240  // -- Read in curved data.
241  getline(m_mshFile, line);
242  if (line.find("CURVE") == string::npos)
243  {
244  cerr << "Cannot find curved side data." << endl;
245  abort();
246  }
247 
248  // Read number of curves.
249  getline(m_mshFile, line);
250  s.clear();
251  s.str(line);
252  s >> nCurves;
253 
254  Array<OneD, NekDouble> rp;
255  int nq = 6;
256  LibUtilities::PointsKey curveType(nq, LibUtilities::eGaussLobattoLegendre);
257  LibUtilities::PointsManager()[curveType]->GetPoints(rp);
258 
259  // Map to reorder Nek5000 -> Nektar++ edge ordering. Nek5000 has the same
260  // counter-clockwise ordering of edges/vertices; however the vertical
261  // (i.e. t- or xi_3-direction) edges come last.
262  int nek2nekedge[12] = {
263  0, 1, 2, 3, 8, 9, 10, 11, 4, 5, 6, 7
264  };
265 
266  // Map to reorder Nek5000 -> Nektar++ face ordering. Again we have the same
267  // counter-clockwise ordering; however the 4 vertical faces of the hex are
268  // first, followed by bottom face and then top face.
269  int nek2nekface[6] = {
270  1, 2, 3, 4, 0, 5
271  };
272 
273  if (nCurves > 0)
274  {
275  for (i = 0; i < nCurves; ++i)
276  {
277  getline(m_mshFile, line);
278 
279  int elmt, side;
280  NekDouble curveData[5];
281  char curveType;
282 
283  if (nElements < 1000)
284  {
285  // side in first 3 characters, elmt in next 3
286  s.str(line.substr(0, 3));
287  s >> side;
288  s.clear();
289  s.str(line.substr(3, 3));
290  s >> elmt;
291  line = line.substr(6);
292  }
293  else if (nElements < 1000000)
294  {
295  // side in first 2 characters, elmt in next 6
296  s.str(line.substr(0, 2));
297  s >> side;
298  s.clear();
299  s.str(line.substr(2, 6));
300  s >> elmt;
301  line = line.substr(8);
302  }
303  else
304  {
305  // side in first 2 characters, elmt in next 12
306  s.str(line.substr(0, 2));
307  s >> side;
308  s.clear();
309  s.str(line.substr(2, 12));
310  s >> elmt;
311  line = line.substr(14);
312  }
313 
314  s.clear();
315  s.str(line);
316 
317  for (j = 0; j < 5; ++j)
318  {
319  s >> curveData[j];
320  }
321  s >> curveType;
322 
323  elmt--;
324  side--;
325  side = nek2nekedge[side];
326 
327  switch (curveType)
328  {
329  case 'C':
330  {
331  // Apply circular curvature to edges. Nek5000 assumes that
332  // the curvature should be imposed in x-y planes and has no
333  // z-dependence. The following code is adapted from Semtex
334  // (src/mesh.C)
335  NekDouble radius = curveData[0];
336  int convexity = radius < 0 ? -1 : 1;
337  radius = fabs(radius);
338 
339  ElementSharedPtr el =
340  m_mesh->m_element[m_mesh->m_expDim][elmt];
341  EdgeSharedPtr edge = el->GetEdge(side);
342  edge->m_curveType = LibUtilities::eGaussLobattoLegendre;
343 
344  // Assume 2D projection
345  Node P1(*(edge->m_n1)), P2(*(edge->m_n2));
346 
347  if (fabs(P1.m_z - P2.m_z) > 1e-8)
348  {
349  cout << "warning: detected non x-y edge." << endl;
350  }
351  P1.m_z = P2.m_z = 0.0;
352 
353  Node unitNormal, link, centroid, centre;
354  Node midpoint = (P1 + P2)*0.5, dx = P2 - P1;
355  NekDouble l = sqrt(dx.abs2()), sign = 0.0, semiangle = 0.0;
356 
357  unitNormal.m_x = -dx.m_y / l;
358  unitNormal.m_y = dx.m_x / l;
359 
360  if (2.0 * radius < l)
361  {
362  cerr << "failure" << endl;
363  }
364  else
365  {
366  semiangle = asin (0.5 * l / radius);
367  }
368 
369  // Calculate element centroid
370  vector<NodeSharedPtr> elNodes = el->GetVertexList();
371  int nNodes = elNodes.size();
372 
373  for (int i = 0; i < nNodes; ++i)
374  {
375  // Assume 2D projection
376  Node tmp(*elNodes[i]);
377  tmp.m_z = 0.0;
378  centroid += tmp;
379  }
380 
381  centroid /= (NekDouble)nNodes;
382  link = centroid - midpoint;
383  sign = link.dot(unitNormal);
384  sign = convexity * sign / fabs(sign);
385  centre = midpoint + unitNormal * (sign * cos(semiangle) *
386  radius);
387 
388  NekDouble theta1, theta2, dtheta, phi;
389  theta1 = atan2 (P1.m_y - centre.m_y, P1.m_x - centre.m_x);
390  theta2 = atan2 (P2.m_y - centre.m_y, P2.m_x - centre.m_x);
391  dtheta = theta2 - theta1;
392 
393  if (fabs(dtheta) > 2.0*semiangle + 1e-15)
394  {
395  dtheta += (dtheta < 0.0) ? 2.0*M_PI : -2.0*M_PI;
396  }
397 
398  edge->m_edgeNodes.clear();
399 
400  for (j = 1; j < nq-1; ++j) {
401  phi = theta1 + dtheta * 0.5 * (rp[j] + 1.0);
402  NodeSharedPtr asd(new Node(
403  0,
404  centre.m_x + radius * cos(phi),
405  centre.m_y + radius * sin(phi),
406  edge->m_n1->m_z));
407  edge->m_edgeNodes.push_back(asd);
408  }
409  break;
410  }
411  case 's':
412  case 'S':
413  case 'm':
414  case 'M':
415  cerr << "Curve type '" << curveType << "' on side " << side
416  << " of element " << elmt << " is unsupported;"
417  << "will ignore." << endl;
418  break;
419  default:
420  cerr << "Unknown curve type '" << curveType << "' on side "
421  << side << " of element " << elmt << "; will ignore."
422  << endl;
423  break;
424  }
425  }
426  }
427 
428  // Read boundary conditions.
429  getline(m_mshFile, line);
430  getline(m_mshFile, line);
431  if (line.find("BOUNDARY") == string::npos)
432  {
433  cerr << "Cannot find boundary conditions." << endl;
434  abort();
435  }
436 
437  int nSurfaces = 0;
438  std::unordered_set<pair<int, int>, PairHash> periodicIn;
439  int periodicInId = -1, periodicOutId = -1;
440 
441  // Boundary conditions: should be precisely nElements * nFaces lines to
442  // read.
443  int lineCnt = 0;
444  int perIn = 0, perOut = 0;
445 
446  while (m_mshFile.good())
447  {
448  getline(m_mshFile, line);
449 
450  // Found a new section. We don't support anything in the rea file beyond
451  // this point so we'll just quit.
452  if (line.find("*") != string::npos)
453  {
454  break;
455  }
456 
458  char bcType;
459  int elmt, side;
460  NekDouble data[5];
461 
462  // type in chars 0-3
463  s.clear();
464  s.str(line.substr(0, 4));
465  s >> bcType;
466 
467  // Some lines have no boundary condition entries
468  if (s.fail())
469  {
470  lineCnt++;
471  continue;
472  }
473 
474  if (nElements < 1000)
475  {
476  // elmt in chars 4-6, side in next 3
477  s.clear();
478  s.str(line.substr(4, 3));
479  s >> elmt;
480  s.clear();
481  s.str(line.substr(7, 3));
482  s >> side;
483  line = line.substr(10);
484  }
485  else if (nElements < 100000)
486  {
487  // elmt in chars 4-8, side in next 1
488  s.clear();
489  s.str(line.substr(4, 5));
490  s >> elmt;
491  s.clear();
492  s.str(line.substr(9, 1));
493  s >> side;
494  line = line.substr(10);
495  }
496  else if (nElements < 1000000)
497  {
498  // elmt in chars 4-9, no side
499  s.clear();
500  s.str(line.substr(4, 6));
501  s >> elmt;
502  side = lineCnt % (2 * m_mesh->m_expDim);
503  line = line.substr(9);
504  }
505  else
506  {
507  // elmt in chars 4-15, no side
508  s.clear();
509  s.str(line.substr(4, 12));
510  s >> elmt;
511  side = lineCnt % (2 * m_mesh->m_expDim);
512  line = line.substr(15);
513  }
514 
515  s.clear();
516  s.str(line);
517 
518  for (i = 0; i < 5; ++i)
519  {
520  s >> data[i];
521  }
522 
523  // Our ordering starts from 0, not 1.
524  --elmt;
525  --side;
526 
527  // Increment lines read
528  lineCnt++;
529 
530  ElementSharedPtr el = m_mesh->m_element[m_mesh->m_spaceDim][elmt];
531 
532  std::string fields[] = { "u", "v", "w", "p" };
533 
534  switch (bcType)
535  {
536  case 'E':
537  // Edge/face connectivity; ignore since we already have this, at
538  // least for conformal meshes.
539  continue;
540 
541  case 'W':
542  {
543  for (i = 0; i < m_mesh->m_fields.size() - 1; ++i)
544  {
545  c->field.push_back(fields[i]);
546  c->value.push_back("0");
547  c->type.push_back(eDirichlet);
548  }
549 
550  // Set high-order boundary condition for wall.
551  c->field.push_back(fields[3]);
552  c->value.push_back("0");
553  c->type.push_back(eHOPCondition);
554  break;
555  }
556 
557  case 'P':
558  {
559  // Determine periodic element and face.
560  int perElmt = (int)(data[0] + 0.5) - 1;
561  int perFace = (int)(data[1] + 0.5) - 1;
562 
563  bool setup = false;
564  if (periodicInId == -1)
565  {
566  periodicInId = m_mesh->m_condition.size();
567  periodicOutId = m_mesh->m_condition.size()+1;
568  setup = true;
569  }
570 
571  bool hasIn = periodicIn.find(make_pair(perElmt, perFace)) !=
572  periodicIn.end();
573 
574  if (hasIn)
575  {
576  swap(periodicInId, periodicOutId);
577  perOut++;
578  }
579  else
580  {
581  periodicIn.insert(make_pair(elmt, side));
582  perIn++;
583  }
584 
585  std::string periodicInStr = "[" +
586  boost::lexical_cast<string>(periodicInId) + "]";
587  std::string periodicOutStr = "[" +
588  boost::lexical_cast<string>(periodicOutId) + "]";
589 
590  for (i = 0; i < m_mesh->m_fields.size() - 1; ++i)
591  {
592  c->field.push_back(fields[i]);
593  c->value.push_back(periodicOutStr);
594  c->type.push_back(ePeriodic);
595  }
596 
597  c->field.push_back(fields[3]);
598  c->value.push_back(periodicOutStr);
599  c->type.push_back(ePeriodic);
600 
601  if (setup)
602  {
605 
606  c->m_composite.push_back(nComposite++);
607  c2->m_composite.push_back(nComposite++);
608 
609  c2->field = c->field;
610  c2->type = c->type;
611  for (i = 0; i < c->type.size(); ++i)
612  {
613  c2->value.push_back(periodicInStr);
614  }
615 
616  m_mesh->m_condition[periodicInId] = c;
617  m_mesh->m_condition[periodicOutId] = c2;
618  }
619 
620  if (hasIn)
621  {
622  swap(periodicInId, periodicOutId);
623  }
624 
625  break;
626  }
627 
628  default:
629  continue;
630  }
631 
632  int compTag, conditionId;
633  ElementSharedPtr surfEl;
634 
635  // Create element for face (3D) or segment (2D).
636  if (el->GetDim() == 3)
637  {
638  FaceSharedPtr f = el->GetFace(nek2nekface[side]);
639  vector<NodeSharedPtr> nodeList;
640  nodeList.insert(nodeList.begin(),
641  f->m_vertexList.begin(),
642  f->m_vertexList.end());
643 
644  vector<int> tags;
645  ElmtConfig conf(
646  LibUtilities::eQuadrilateral, 1, true, true, false,
648  surfEl =
650  conf, nodeList, tags);
651 
652  // Copy high-order surface information from edges.
653  for (int i = 0; i < f->m_vertexList.size(); ++i)
654  {
655  surfEl->GetEdge(i)->m_edgeNodes = f->m_edgeList[i]->m_edgeNodes;
656  surfEl->GetEdge(i)->m_curveType = f->m_edgeList[i]->m_curveType;
657  }
658  }
659  else
660  {
661  EdgeSharedPtr f = el->GetEdge(side);
662 
663  vector<NodeSharedPtr> nodeList;
664  nodeList.push_back(f->m_n1);
665  nodeList.push_back(f->m_n2);
666 
667  vector<int> tags;
668 
669  ElmtConfig conf(
670  LibUtilities::eSegment, 1, true, true, false,
673  LibUtilities::eSegment, conf, nodeList, tags);
674  }
675 
676  // Now attempt to find this boundary condition inside
677  // m_mesh->condition. This is currently a linear search and should
678  // probably be made faster!
679  bool found = false;
680  for (auto &it : m_mesh->m_condition)
681  {
682  if (c == it.second)
683  {
684  found = true;
685  c = it.second;
686  break;
687  }
688  }
689 
690  if (!found)
691  {
692  conditionId = m_mesh->m_condition.size();
693  compTag = nComposite;
694  c->m_composite.push_back(compTag);
695  m_mesh->m_condition[conditionId] = c;
696  }
697  else
698  {
699  compTag = c->m_composite[0];
700  }
701 
702  // Insert composite tag into element and insert element into
703  // mesh.
704  vector<int> existingTags = surfEl->GetTagList();
705 
706  existingTags.insert(existingTags.begin(), compTag);
707  surfEl->SetTagList(existingTags);
708  surfEl->SetId(nSurfaces);
709 
710  m_mesh->m_element[surfEl->GetDim()].push_back(surfEl);
711  nSurfaces++;
712  }
713 
714  if (lineCnt != nElements * (m_mesh->m_expDim * 2))
715  {
716  cerr << "Warning: boundary conditions may not have been correctly read "
717  << "from Nek5000 input file." << endl;
718  }
719 
720  if (perIn != perOut)
721  {
722  cerr << "Warning: number of periodic faces does not match." << endl;
723  }
724 
725  m_mshFile.reset();
726 
727  // -- Process rest of mesh.
728  ProcessEdges();
729  ProcessFaces();
730  ProcessElements();
732 
733  // -- Set periodic composites to not be reordered.
734  if (periodicInId != -1)
735  {
736  m_mesh->m_composite[m_mesh->m_condition[periodicInId]
737  ->m_composite[0]]->m_reorder = false;
738  m_mesh->m_composite[m_mesh->m_condition[periodicOutId]
739  ->m_composite[0]]->m_reorder = false;
740  }
741 }
Basic information about an element.
Definition: ElementConfig.h:49
io::filtering_istream m_mshFile
Input stream.
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:16
NekDouble m_y
Y-coordinate.
Definition: Node.h:410
NEKMESHUTILS_EXPORT NekDouble dot(const Node &pSrc) const
Definition: Node.h:161
std::shared_ptr< Edge > EdgeSharedPtr
Shared pointer to an edge.
Definition: Edge.h:136
ElementFactory & GetElementFactory()
Definition: Element.cpp:44
Represents a point in the domain.
Definition: Node.h:62
std::shared_ptr< Node > NodeSharedPtr
Definition: CADVert.h:49
std::shared_ptr< Face > FaceSharedPtr
Definition: Face.h:155
NEKMESHUTILS_EXPORT void OpenStream()
Open a file for input.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
Definition: NekFactory.hpp:144
virtual NEKMESHUTILS_EXPORT void ProcessFaces(bool ReprocessFaces=true)
Extract element faces.
std::shared_ptr< Element > ElementSharedPtr
Definition: Edge.h:49
virtual NEKMESHUTILS_EXPORT void ProcessElements()
Generate element IDs.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
PointsManagerT & PointsManager(void)
double NekDouble
NekDouble m_x
X-coordinate.
Definition: Node.h:408
virtual NEKMESHUTILS_EXPORT void ProcessEdges(bool ReprocessEdges=true)
Extract element edges.
std::shared_ptr< Condition > ConditionSharedPtr
Definition: Mesh.h:85
virtual NEKMESHUTILS_EXPORT void ProcessComposites()
Generate composites.
1D Gauss-Lobatto-Legendre quadrature points
Definition: PointsType.h:51

Member Data Documentation

◆ className

ModuleKey Nektar::Utilities::InputNek5000::className
static
Initial value:

ModuleKey for class.

Definition at line 66 of file utilities/NekMesh/InputModules/InputNek5000.h.