Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Member Functions | Public Attributes | List of all members
Nektar::NekMeshUtils::HOQuadrilateral< T > Struct Template Reference

A lightweight struct for dealing with high-order quadrilateral alignment. More...

#include <HOAlignment.h>

Collaboration diagram for Nektar::NekMeshUtils::HOQuadrilateral< T >:
Collaboration graph
[legend]

Public Member Functions

 HOQuadrilateral (std::vector< int > pVertId, std::vector< T > pSurfVerts)
 
 HOQuadrilateral (std::vector< int > pVertId)
 
void ReverseX ()
 
void ReverseY ()
 
void Transpose ()
 
void Align (std::vector< int > vertId)
 Align this surface to a given vertex ID. More...
 

Public Attributes

std::vector< int > vertId
 The quadrilateral vertex IDs. More...
 
std::vector< T > surfVerts
 The quadrilateral surface vertices – templated so that this can either be nodes or IDs. More...
 

Detailed Description

template<typename T>
struct Nektar::NekMeshUtils::HOQuadrilateral< T >

A lightweight struct for dealing with high-order quadrilateral alignment.

Definition at line 215 of file HOAlignment.h.

Constructor & Destructor Documentation

template<typename T>
Nektar::NekMeshUtils::HOQuadrilateral< T >::HOQuadrilateral ( std::vector< int >  pVertId,
std::vector< T >  pSurfVerts 
)
inline

Definition at line 217 of file HOAlignment.h.

218  : vertId(pVertId), surfVerts(pSurfVerts)
219  {
220  }
std::vector< T > surfVerts
The quadrilateral surface vertices – templated so that this can either be nodes or IDs...
Definition: HOAlignment.h:231
std::vector< int > vertId
The quadrilateral vertex IDs.
Definition: HOAlignment.h:227
template<typename T>
Nektar::NekMeshUtils::HOQuadrilateral< T >::HOQuadrilateral ( std::vector< int >  pVertId)
inline

Definition at line 222 of file HOAlignment.h.

222  : vertId(pVertId)
223  {
224  }
std::vector< int > vertId
The quadrilateral vertex IDs.
Definition: HOAlignment.h:227

Member Function Documentation

template<typename T>
void Nektar::NekMeshUtils::HOQuadrilateral< T >::Align ( std::vector< int >  vertId)
inline

Align this surface to a given vertex ID.

Definition at line 277 of file HOAlignment.h.

References ASSERTL1, Nektar::StdRegions::eDir1BwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1BwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1BwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1BwdDir2_Dir2FwdDir1, Nektar::StdRegions::eDir1FwdDir1_Dir2BwdDir2, Nektar::StdRegions::eDir1FwdDir1_Dir2FwdDir2, Nektar::StdRegions::eDir1FwdDir2_Dir2BwdDir1, Nektar::StdRegions::eDir1FwdDir2_Dir2FwdDir1, Nektar::StdRegions::eNoOrientation, Nektar::NekMeshUtils::HOQuadrilateral< T >::ReverseX(), Nektar::NekMeshUtils::HOQuadrilateral< T >::ReverseY(), and Nektar::NekMeshUtils::HOQuadrilateral< T >::Transpose().

Referenced by Nektar::NekMeshUtils::Prism::GetCurvedNodes(), Nektar::Utilities::InputGmsh::PrismReordering(), and Nektar::Utilities::OutputGmsh::Process().

278  {
279 
280  int vmap[4] = {-1, -1, -1, -1};
281 
282  // Determine which vertices map to vertId
283  for (int i = 0; i < 4; ++i)
284  {
285  for (int j = 0; j < 4; ++j)
286  {
287  if (this->vertId[j] == vertId[i])
288  {
289  vmap[i] = j;
290  break;
291  }
292  }
293 
294  ASSERTL1(vmap[i] != -1,
295  "Could not determine mapping between vertex IDs");
296  }
297 
299 
300  if (vmap[1] == (vmap[0]+1) % 4)
301  {
302  switch (vmap[0])
303  {
304  case 0:
306  break;
307  case 1:
309  break;
310  case 2:
312  break;
313  case 3:
315  break;
316  }
317  }
318  else
319  {
320  switch (vmap[0])
321  {
322  case 0:
324  break;
325  case 1:
327  break;
328  case 2:
330  break;
331  case 3:
333  break;
334  }
335  }
336 
337  if (orient == StdRegions::eDir1FwdDir2_Dir2FwdDir1 ||
341  {
342  Transpose();
343  }
344 
345  if (orient == StdRegions::eDir1BwdDir1_Dir2FwdDir2 ||
349  {
350  ReverseX();
351  }
352 
353  if (orient == StdRegions::eDir1FwdDir1_Dir2BwdDir2 ||
357  {
358  ReverseY();
359  }
360  }
#define ASSERTL1(condition, msg)
Assert Level 1 – Debugging which is used whether in FULLDEBUG or DEBUG compilation mode...
Definition: ErrorUtil.hpp:228
template<typename T>
void Nektar::NekMeshUtils::HOQuadrilateral< T >::ReverseX ( )
inline

Definition at line 233 of file HOAlignment.h.

Referenced by Nektar::NekMeshUtils::HOQuadrilateral< T >::Align().

234  {
235  int np = (int)(sqrt((NekDouble)surfVerts.size()) + 0.5);
236  for (int i = 0; i < np; ++i)
237  {
238  for (int j = 0; j < np/2; ++j)
239  {
240  swap(surfVerts[i*np + j], surfVerts[i*np + np-j-1]);
241  }
242  }
243  }
std::vector< T > surfVerts
The quadrilateral surface vertices – templated so that this can either be nodes or IDs...
Definition: HOAlignment.h:231
double NekDouble
template<typename T>
void Nektar::NekMeshUtils::HOQuadrilateral< T >::ReverseY ( )
inline

Definition at line 245 of file HOAlignment.h.

Referenced by Nektar::NekMeshUtils::HOQuadrilateral< T >::Align().

246  {
247  int np = (int)(sqrt((NekDouble)surfVerts.size()) + 0.5);
248  // Reverse y direction
249  for (int j = 0; j < np; ++j)
250  {
251  for (int i = 0; i < np/2; ++i)
252  {
253  swap(surfVerts[i*np + j], surfVerts[(np-i-1)*np + j]);
254  }
255  }
256  }
std::vector< T > surfVerts
The quadrilateral surface vertices – templated so that this can either be nodes or IDs...
Definition: HOAlignment.h:231
double NekDouble
template<typename T>
void Nektar::NekMeshUtils::HOQuadrilateral< T >::Transpose ( )
inline

Definition at line 258 of file HOAlignment.h.

Referenced by Nektar::NekMeshUtils::HOQuadrilateral< T >::Align().

259  {
260  int np = (int)(sqrt((NekDouble)surfVerts.size()) + 0.5);
261  std::vector<T> tmp(surfVerts.size());
262 
263  for (int i = 0; i < np; ++i)
264  {
265  for (int j = 0; j < np; ++j)
266  {
267  tmp[i*np+j] = surfVerts[j*np+i];
268  }
269  }
270 
271  surfVerts = tmp;
272  }
std::vector< T > surfVerts
The quadrilateral surface vertices – templated so that this can either be nodes or IDs...
Definition: HOAlignment.h:231
double NekDouble

Member Data Documentation

template<typename T>
std::vector<T> Nektar::NekMeshUtils::HOQuadrilateral< T >::surfVerts

The quadrilateral surface vertices – templated so that this can either be nodes or IDs.

Definition at line 231 of file HOAlignment.h.

Referenced by Nektar::NekMeshUtils::Prism::GetCurvedNodes(), Nektar::Utilities::InputGmsh::PrismReordering(), and Nektar::Utilities::OutputGmsh::Process().

template<typename T>
std::vector<int> Nektar::NekMeshUtils::HOQuadrilateral< T >::vertId

The quadrilateral vertex IDs.

Definition at line 227 of file HOAlignment.h.