Nektar++
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Enumerations | Functions | Variables
Nektar::Utilities Namespace Reference

Classes

struct  ConfigOption
 Represents a command-line configuration option. More...
 
struct  EdgeInfo
 
struct  ElmtConfigHash
 
struct  Field
 
class  FieldConvertComm
 
class  InputCAD
 
class  InputDat
 Input module for Xml files. More...
 
class  InputFld
 
class  InputGmsh
 
class  InputModule
 Abstract base class for input modules. More...
 
class  InputNek
 
class  InputNekpp
 
class  InputPly
 Converter for Ply files. More...
 
class  InputPts
 
class  InputSem
 
class  InputStar
 Converter for VTK files. More...
 
class  InputSwan
 Converter for Swansea mesh format. More...
 
class  InputTec
 Converter for VTK files. More...
 
class  InputVtk
 Converter for VTK files. More...
 
class  InputXml
 
class  Iso
 
class  IsoVertex
 
class  Module
 
class  OutputFld
 Converter from fld to vtk. More...
 
class  OutputGmsh
 Converter for Gmsh files. More...
 
class  OutputInfo
 
class  OutputModule
 Abstract base class for output modules. More...
 
class  OutputNekpp
 Converter for Gmsh files. More...
 
class  OutputPts
 Converter from fld to pts. More...
 
class  OutputStdOut
 
class  OutputTecplot
 Converter from fld to dat. More...
 
class  OutputVtk
 Converter from fld to vtk. More...
 
class  OutputXml
 Converter from fld to vtk. More...
 
class  ProcessAddFld
 This processing module scales the input fld file. More...
 
class  ProcessBL
 This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...
 
class  ProcessBoundaryExtract
 This processing module sets up for the boundary field to be extracted. More...
 
class  ProcessC0Projection
 This processing module calculates the Q Criterion and adds it as an extra-field to the output file. More...
 
class  ProcessCombineAvg
 This processing module combines two fld files containing average fields. More...
 
class  ProcessConcatenateFld
 This processing module sets up for the boundary field to be extracted. More...
 
class  ProcessCyl
 
class  ProcessDeform
 
class  ProcessDetectSurf
 This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...
 
class  ProcessDisplacement
 
class  ProcessEquiSpacedOutput
 This processing module interpolates one field to another. More...
 
class  ProcessExtractSurf
 This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...
 
class  ProcessExtractTetPrismInterface
 Module to extract interface between prismatic and tetrahedral elements. More...
 
class  ProcessGrad
 This processing module calculates the vorticity and adds it as an extra-field to the output file. More...
 
class  ProcessHomogeneousPlane
 This processing module replaces all expansions by a single plane from 3DH1D fields, defined by the parameter planeid. More...
 
class  ProcessInnerProduct
 This processing module computes the inner product between two fields. More...
 
class  ProcessInterpField
 This processing module interpolates one field to another. More...
 
class  ProcessInterpPointDataToFld
 This processing module interpolates one field to another. More...
 
class  ProcessInterpPoints
 This processing module interpolates one field to another. More...
 
class  ProcessIsoContour
 This processing module extracts an isocontour. More...
 
class  ProcessJac
 This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...
 
class  ProcessJacobianEnergy
 This processing module scales the input fld file. More...
 
class  ProcessLinear
 This processing module removes all the high-order information from the mesh leaving just the linear elements. More...
 
class  ProcessMapping
 This processing module scales the input fld file. More...
 
class  ProcessMeanMode
 This processing module replaces all expansions by the mean mode from 3DH1D fields. More...
 
class  ProcessModule
 Abstract base class for processing modules. More...
 
class  ProcessMultiShear
 This processing module calculates the shear stress metrics and writes it to a surface output file. More...
 
class  ProcessNumModes
 This processing module calculates the vorticity and adds it as an extra-field to the output file. More...
 
class  ProcessOptiExtract
 
class  ProcessPerAlign
 
class  ProcessPointDataToFld
 This processing module interpolates one field to another. More...
 
class  ProcessPrintFldNorms
 This processing module prints the L2 and LInf norms of the variables in the field. More...
 
class  ProcessQCriterion
 This processing module calculates the Q Criterion and adds it as an extra-field to the output file. More...
 
class  ProcessQualityMetric
 This processing module scales the input fld file. More...
 
class  ProcessScalar
 This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...
 
class  ProcessScaleInFld
 This processing module scales the input fld file. More...
 
class  ProcessScalGrad
 This processing module calculates the scalar gradient field and writes it to a surface output file. More...
 
class  ProcessSpherigon
 
class  ProcessSurfDistance
 This processing module calculates the height of an element connected to a surface and adds it as an extra-field to the output file. More...
 
class  ProcessTetSplit
 This processing module calculates the Jacobian of elements using SpatialDomains::GeomFactors and the Element::GetGeom method. For now it simply prints a list of elements which have negative Jacobian. More...
 
class  ProcessVorticity
 This processing module calculates the vorticity and adds it as an extra-field to the output file. More...
 
class  ProcessWSS
 This processing module calculates the wall shear stress and adds it as an extra-field to the output file, and writes it to a surface output file. More...
 
struct  SplitEdgeHelper
 
struct  SplitMapHelper
 
struct  TriFaceHash
 
struct  TriFaceIDs
 

Typedefs

typedef boost::shared_ptr< FieldFieldSharedPtr
 
typedef boost::shared_ptr
< InputModule
InputModuleSharedPtr
 
typedef pair< ModuleType, string > ModuleKey
 
typedef boost::shared_ptr< ModuleModuleSharedPtr
 
typedef
LibUtilities::NekFactory
< ModuleKey, Module,
FieldSharedPtr
ModuleFactory
 
typedef boost::unordered_map
< TriFaceIDs, int, TriFaceHash
TriFaceMap
 
typedef boost::shared_ptr< IsoIsoSharedPtr
 
typedef boost::shared_ptr
< InputPly
InputPlySharedPtr
 
typedef std::map< int,
std::pair< FaceSharedPtr,
std::vector< int > > > 
PerMap
 
typedef std::pair< int, int > ipair
 

Enumerations

enum  ModuleType {
  eInputModule, eProcessModule, eOutputModule, SIZE_ModuleType,
  eInputModule, eProcessModule, eOutputModule, SIZE_ModuleType
}
 
enum  TecOutType { eFullBlockZone, eFullBlockZoneEquiSpaced, eSeperateZones }
 
enum  NekCurve { eFile, eRecon }
 
enum  ModuleType {
  eInputModule, eProcessModule, eOutputModule, SIZE_ModuleType,
  eInputModule, eProcessModule, eOutputModule, SIZE_ModuleType
}
 

Functions

ModuleFactoryGetModuleFactory ()
 
std::ostream & operator<< (std::ostream &os, const ModuleKey &rhs)
 
bool operator== (TriFaceIDs const &p1, TriFaceIDs const &p2)
 
void TwoPairs (Array< OneD, NekDouble > &cx, Array< OneD, NekDouble > &cy, Array< OneD, NekDouble > &cz, int &pr)
 
void ThreeSimilar (const int i, const int j, const int k, int &pr, int &ps)
 
bool operator== (const IsoVertex &x, const IsoVertex &y)
 
bool operator!= (const IsoVertex &x, const IsoVertex &y)
 
bool same (NekDouble x1, NekDouble y1, NekDouble z1, NekDouble x2, NekDouble y2, NekDouble z2)
 
vector< DNekMatMappingIdealToRef (SpatialDomains::GeometrySharedPtr geom, StdRegions::StdExpansionSharedPtr chi)
 
std::vector< int > quadTensorNodeOrdering (const std::vector< int > &nodes, int n)
 Reorder a quadrilateral to appear in Nektar++ ordering from Gmsh. More...
 
std::vector< int > triTensorNodeOrdering (const std::vector< int > &nodes, int n)
 
static void PrismLineFaces (int prismid, map< int, int > &facelist, vector< vector< int > > &FacesToPrisms, vector< vector< int > > &PrismsToFaces, vector< bool > &PrismDone)
 
static void PrismLineFaces (int prismid, map< int, int > &facelist, vector< vector< int > > &FacesToPrisms, vector< vector< int > > &PrismsToFaces, vector< bool > &PrismDone)
 
bool operator== (ElmtConfig const &p1, ElmtConfig const &p2)
 
template<typename T >
void TestElmts (SpatialDomains::MeshGraphSharedPtr &graph)
 
int ** helper2d (int lda, int arr[][2])
 
int ** helper2d (int lda, int arr[][4])
 

Variables

const char *const ModuleTypeMap []
 
NekDouble SQ_PNT_TOL =1e-16
 

Typedef Documentation

typedef boost::shared_ptr<Field> Nektar::Utilities::FieldSharedPtr

Definition at line 698 of file Field.hpp.

Definition at line 197 of file FieldConvert/Module.h.

typedef boost::shared_ptr<InputPly> Nektar::Utilities::InputPlySharedPtr

Definition at line 68 of file InputPly.h.

typedef std::pair<int, int> Nektar::Utilities::ipair

Definition at line 55 of file ProcessTetSplit.cpp.

typedef boost::shared_ptr<Iso> Nektar::Utilities::IsoSharedPtr

Definition at line 187 of file ProcessIsoContour.h.

Definition at line 232 of file FieldConvert/Module.h.

typedef std::pair< ModuleType, std::string > Nektar::Utilities::ModuleKey

Definition at line 227 of file FieldConvert/Module.h.

typedef boost::shared_ptr< Module > Nektar::Utilities::ModuleSharedPtr

Definition at line 230 of file FieldConvert/Module.h.

typedef std::map<int, std::pair<FaceSharedPtr, std::vector<int> > > Nektar::Utilities::PerMap

Definition at line 74 of file NekMesh/Module.h.

typedef boost::unordered_map<TriFaceIDs, int, TriFaceHash> Nektar::Utilities::TriFaceMap

Definition at line 100 of file ProcessDisplacement.cpp.

Enumeration Type Documentation

Denotes different types of mesh converter modules: so far only input, output and process modules are defined.

Enumerator
eInputModule 
eProcessModule 
eOutputModule 
SIZE_ModuleType 
eInputModule 
eProcessModule 
eOutputModule 
SIZE_ModuleType 

Definition at line 60 of file NekMesh/Module.h.

Denotes different types of mesh converter modules: so far only input, output and process modules are defined.

Enumerator
eInputModule 
eProcessModule 
eOutputModule 
SIZE_ModuleType 
eInputModule 
eProcessModule 
eOutputModule 
SIZE_ModuleType 

Definition at line 66 of file FieldConvert/Module.h.

Enumerator
eFile 
eRecon 

Definition at line 51 of file InputNek.h.

Enumerator
eFullBlockZone 
eFullBlockZoneEquiSpaced 
eSeperateZones 

Definition at line 47 of file OutputTecplot.h.

Function Documentation

ModuleFactory & Nektar::Utilities::GetModuleFactory ( )

Returns an instance of the module factory, held as a singleton.

Definition at line 49 of file FieldConvert/Module.cpp.

Referenced by main(), Nektar::Utilities::InputCAD::Process(), and Nektar::Utilities::ProcessOptiExtract::Process().

50  {
51  typedef Loki::SingletonHolder<ModuleFactory,
52  Loki::CreateUsingNew,
53  Loki::NoDestroy,
54  Loki::SingleThreaded> Type;
55  return Type::Instance();
56  }
LibUtilities::NekFactory< ModuleKey, Module, FieldSharedPtr > ModuleFactory
int** Nektar::Utilities::helper2d ( int  lda,
int  arr[][2] 
)

Definition at line 61 of file ProcessBL.cpp.

Referenced by Nektar::Utilities::ProcessBL::Process().

62 {
63  int **ret = new int *[lda];
64  for (int i = 0; i < lda; ++i)
65  {
66  ret[i] = new int[2];
67  ret[i][0] = arr[i][0];
68  ret[i][1] = arr[i][1];
69  }
70  return ret;
71 }
int** Nektar::Utilities::helper2d ( int  lda,
int  arr[][4] 
)

Definition at line 73 of file ProcessBL.cpp.

74 {
75  int **ret = new int *[lda];
76  for (int i = 0; i < lda; ++i)
77  {
78  ret[i] = new int[4];
79  ret[i][0] = arr[i][0];
80  ret[i][1] = arr[i][1];
81  ret[i][2] = arr[i][2];
82  ret[i][3] = arr[i][3];
83  }
84  return ret;
85 }
vector<DNekMat> Nektar::Utilities::MappingIdealToRef ( SpatialDomains::GeometrySharedPtr  geom,
StdRegions::StdExpansionSharedPtr  chi 
)
inline

Definition at line 113 of file ProcessQualityMetric.cpp.

References ASSERTL0, Nektar::eFULL, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTetrahedron, and Nektar::LibUtilities::eTriangle.

Referenced by Nektar::Utilities::ProcessQualityMetric::GetQ().

115 {
116  vector<DNekMat> ret;
117 
118  if(geom->GetShapeType() == LibUtilities::eQuadrilateral)
119  {
120  vector<Array<OneD, NekDouble> > xy;
121  for(int i = 0; i < geom->GetNumVerts(); i++)
122  {
123  Array<OneD, NekDouble> loc(2);
124  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
125  p->GetCoords(loc);
126  xy.push_back(loc);
127  }
128 
129  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
130  Array<OneD, NekDouble> u = b[0]->GetZ();
131  Array<OneD, NekDouble> v = b[1]->GetZ();
132 
133  for(int j = 0; j < b[1]->GetNumPoints(); j++)
134  {
135  for(int i = 0; i < b[0]->GetNumPoints(); i++)
136  {
137  NekDouble a1 = 0.5*(1.0-u[i]), a2 = 0.5*(1.0+u[i]);
138  NekDouble b1 = 0.5*(1.0-v[j]), b2 = 0.5*(1.0+v[j]);
139  DNekMat dxdz(2,2,1.0,eFULL);
140 
141  dxdz(0,0) = 0.5*(-b1*xy[0][0] + b1*xy[1][0] + b2*xy[2][0] - b2*xy[3][0]);
142  dxdz(1,0) = 0.5*(-b1*xy[0][1] + b1*xy[1][1] + b2*xy[2][1] - b2*xy[3][1]);
143 
144  dxdz(0,1) = 0.5*(-a1*xy[0][0] - a2*xy[1][0] + a2*xy[2][0] + a1*xy[3][0]);
145  dxdz(1,1) = 0.5*(-a1*xy[0][1] - a2*xy[1][1] + a2*xy[2][1] + a1*xy[3][1]);
146 
147  dxdz.Invert();
148  ret.push_back(dxdz);
149  }
150  }
151  }
152  else if(geom->GetShapeType() == LibUtilities::eTriangle)
153  {
154  vector<Array<OneD, NekDouble> > xy;
155  for(int i = 0; i < geom->GetNumVerts(); i++)
156  {
157  Array<OneD, NekDouble> loc(2);
158  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
159  p->GetCoords(loc);
160  xy.push_back(loc);
161  }
162 
163  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
164  Array<OneD, NekDouble> u = b[0]->GetZ();
165  Array<OneD, NekDouble> v = b[1]->GetZ();
166 
167  for(int i = 0; i < b[0]->GetNumPoints(); i++)
168  {
169  for(int j = 0; j < b[1]->GetNumPoints(); j++)
170  {
171  DNekMat dxdz(2,2,1.0,eFULL);
172  dxdz(0,0) = -xy[0][0]/2.0 + xy[1][0]/2.0;
173 
174  dxdz(0,1) = -xy[0][0]/2.0 + xy[2][0]/2.0;
175 
176  dxdz(1,0) = -xy[0][1]/2.0 + xy[1][1]/2.0;
177 
178  dxdz(1,1) = -xy[0][1]/2.0 + xy[2][1]/2.0;
179 
180  dxdz.Invert();
181  ret.push_back(dxdz);
182  }
183  }
184  }
185  else if(geom->GetShapeType() == LibUtilities::eTetrahedron)
186  {
187  vector<Array<OneD, NekDouble> > xyz;
188  for(int i = 0; i < geom->GetNumVerts(); i++)
189  {
190  Array<OneD, NekDouble> loc(3);
191  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
192  p->GetCoords(loc);
193  xyz.push_back(loc);
194  }
195 
196  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
197  Array<OneD, NekDouble> u = b[0]->GetZ();
198  Array<OneD, NekDouble> v = b[1]->GetZ();
199  Array<OneD, NekDouble> z = b[2]->GetZ();
200 
201  for(int i = 0; i < b[0]->GetNumPoints(); i++)
202  {
203  for(int j = 0; j < b[1]->GetNumPoints(); j++)
204  {
205  for(int k = 0; k < b[2]->GetNumPoints(); k++)
206  {
207  DNekMat dxdz(3,3,1.0,eFULL);
208  dxdz(0,0) = -xyz[0][0]/2.0 + xyz[1][0]/2.0;
209 
210  dxdz(0,1) = -xyz[0][0]/2.0 + xyz[2][0]/2.0;
211 
212  dxdz(0,2) = -xyz[0][0]/2.0 + xyz[3][0]/2.0;
213 
214 
215  dxdz(1,0) = -xyz[0][1]/2.0 + xyz[1][1]/2.0;
216 
217  dxdz(1,1) = -xyz[0][1]/2.0 + xyz[2][1]/2.0;
218 
219  dxdz(1,2) = -xyz[0][1]/2.0 + xyz[3][1]/2.0;
220 
221 
222  dxdz(2,0) = -xyz[0][2]/2.0 + xyz[1][2]/2.0;
223 
224  dxdz(2,1) = -xyz[0][2]/2.0 + xyz[2][2]/2.0;
225 
226  dxdz(2,2) = -xyz[0][2]/2.0 + xyz[3][2]/2.0;
227 
228  dxdz.Invert();
229  ret.push_back(dxdz);
230  }
231  }
232  }
233  }
234  else if(geom->GetShapeType() == LibUtilities::ePrism)
235  {
236  vector<Array<OneD, NekDouble> > xyz;
237  for(int i = 0; i < geom->GetNumVerts(); i++)
238  {
239  Array<OneD, NekDouble> loc(3);
240  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
241  p->GetCoords(loc);
242  xyz.push_back(loc);
243  }
244 
245  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
246  Array<OneD, NekDouble> eta1 = b[0]->GetZ();
247  Array<OneD, NekDouble> eta2 = b[1]->GetZ();
248  Array<OneD, NekDouble> eta3 = b[2]->GetZ();
249 
250  for(int k = 0; k < b[2]->GetNumPoints(); k++)
251  {
252  for(int j = 0; j < b[1]->GetNumPoints(); j++)
253  {
254  for(int i = 0; i < b[0]->GetNumPoints(); i++)
255  {
256  NekDouble xi1 = 0.5*(1+eta1[i])*(1-eta3[k])-1.0;
257  NekDouble a2 = 0.5*(1+xi1);
258  NekDouble b1 = 0.5*(1-eta2[j]), b2 = 0.5*(1+eta2[j]);
259  NekDouble c1 = 0.5*(1-eta3[k]), c2 = 0.5*(1+eta3[k]);
260 
261  DNekMat dxdz(3,3,1.0,eFULL);
262 
263  dxdz(0,0) = 0.5*(-b1*xyz[0][0] + b1*xyz[1][0] + b2*xyz[2][0] - b2*xyz[3][0]);
264  dxdz(1,0) = 0.5*(-b1*xyz[0][1] + b1*xyz[1][1] + b2*xyz[2][1] - b2*xyz[3][1]);
265  dxdz(2,0) = 0.5*(-b1*xyz[0][2] + b1*xyz[1][2] + b2*xyz[2][2] - b2*xyz[3][2]);
266 
267  dxdz(0,1) = 0.5*((a2-c1)*xyz[0][0] - a2*xyz[1][0] + a2*xyz[2][0] + (c1-a2)*xyz[3][0] - c2*xyz[4][0] + c2*xyz[5][0]);
268  dxdz(1,1) = 0.5*((a2-c1)*xyz[0][1] - a2*xyz[1][1] + a2*xyz[2][1] + (c1-a2)*xyz[3][1] - c2*xyz[4][1] + c2*xyz[5][1]);
269  dxdz(2,1) = 0.5*((a2-c1)*xyz[0][2] - a2*xyz[1][2] + a2*xyz[2][2] + (c1-a2)*xyz[3][2] - c2*xyz[4][2] + c2*xyz[5][2]);
270 
271  dxdz(0,2) = 0.5*(-b1*xyz[0][0] - b2*xyz[3][0] + b1*xyz[4][0] + b2*xyz[5][0]);
272  dxdz(1,2) = 0.5*(-b1*xyz[0][1] - b2*xyz[3][1] + b1*xyz[4][1] + b2*xyz[5][1]);
273  dxdz(2,2) = 0.5*(-b1*xyz[0][2] - b2*xyz[3][2] + b1*xyz[4][2] + b2*xyz[5][2]);
274 
275  dxdz.Invert();
276  ret.push_back(dxdz);
277  }
278  }
279  }
280  }
281  else
282  {
283  ASSERTL0(false,"not coded");
284  }
285 
286 
287 
288  return ret;
289 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
NekMatrix< NekDouble, StandardMatrixTag > DNekMat
Definition: NekTypeDefs.hpp:52
double NekDouble
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
bool Nektar::Utilities::operator!= ( const IsoVertex &  x,
const IsoVertex &  y 
)

Definition at line 739 of file ProcessIsoContour.cpp.

References Nektar::Utilities::IsoVertex::m_x, Nektar::Utilities::IsoVertex::m_y, and Nektar::Utilities::IsoVertex::m_z.

740 {
741  return ((x.m_x-y.m_x)*(x.m_x-y.m_x) + (x.m_y-y.m_y)*(x.m_y-y.m_y) +
742  (x.m_z-y.m_z)*(x.m_z-y.m_z) < SQ_PNT_TOL)? 0:1;
743 }
std::ostream & Nektar::Utilities::operator<< ( std::ostream &  os,
const ModuleKey &  rhs 
)

Prints a given module key to a stream.

Definition at line 61 of file FieldConvert/Module.cpp.

References ModuleTypeMap.

62  {
63  return os << ModuleTypeMap[rhs.first] << ": " << rhs.second;
64  }
const char *const ModuleTypeMap[]
bool Nektar::Utilities::operator== ( ElmtConfig const &  p1,
ElmtConfig const &  p2 
)

Definition at line 61 of file OutputGmsh.h.

References Nektar::NekMeshUtils::ElmtConfig::m_e, Nektar::NekMeshUtils::ElmtConfig::m_faceNodes, Nektar::NekMeshUtils::ElmtConfig::m_order, and Nektar::NekMeshUtils::ElmtConfig::m_volumeNodes.

62 {
63  return p1.m_e == p2.m_e &&
64  p1.m_faceNodes == p2.m_faceNodes &&
65  p1.m_volumeNodes == p2.m_volumeNodes &&
66  p1.m_order == p2.m_order;
67 }
bool Nektar::Utilities::operator== ( TriFaceIDs const &  p1,
TriFaceIDs const &  p2 
)

Definition at line 81 of file ProcessDisplacement.cpp.

References Nektar::Utilities::TriFaceIDs::a, Nektar::Utilities::TriFaceIDs::b, and Nektar::Utilities::TriFaceIDs::c.

82  {
83  std::vector<int> ids1(3), ids2(3);
84 
85  ids1[0] = p1.a;
86  ids1[1] = p1.b;
87  ids1[2] = p1.c;
88  ids2[0] = p2.a;
89  ids2[1] = p2.b;
90  ids2[2] = p2.c;
91 
92  std::sort(ids1.begin(), ids1.end());
93  std::sort(ids2.begin(), ids2.end());
94 
95  return ids1[0] == ids2[0] &&
96  ids1[1] == ids2[1] &&
97  ids1[2] == ids2[2];
98  }
bool Nektar::Utilities::operator== ( const IsoVertex &  x,
const IsoVertex &  y 
)

Definition at line 732 of file ProcessIsoContour.cpp.

References Nektar::Utilities::IsoVertex::m_x, Nektar::Utilities::IsoVertex::m_y, and Nektar::Utilities::IsoVertex::m_z.

733 {
734  return ((x.m_x-y.m_x)*(x.m_x-y.m_x) + (x.m_y-y.m_y)*(x.m_y-y.m_y) +
735  (x.m_z-y.m_z)*(x.m_z-y.m_z) < SQ_PNT_TOL)? true:false;
736 }
static void Nektar::Utilities::PrismLineFaces ( int  prismid,
map< int, int > &  facelist,
vector< vector< int > > &  FacesToPrisms,
vector< vector< int > > &  PrismsToFaces,
vector< bool > &  PrismDone 
)
static

Definition at line 422 of file InputStar.cpp.

Referenced by PrismLineFaces(), Nektar::Utilities::InputStar::ResetNodes(), and Nektar::Utilities::InputTec::ResetNodes().

427 {
428  if (PrismDone[prismid] == false)
429  {
430  PrismDone[prismid] = true;
431 
432  // Add faces0
433  int face = PrismToFaces[prismid][0];
434  facelist[face] = face;
435  for (int i = 0; i < FaceToPrisms[face].size(); ++i)
436  {
437  PrismLineFaces(FaceToPrisms[face][i],
438  facelist,
439  FaceToPrisms,
440  PrismToFaces,
441  PrismDone);
442  }
443 
444  // Add faces1
445  face = PrismToFaces[prismid][1];
446  facelist[face] = face;
447  for (int i = 0; i < FaceToPrisms[face].size(); ++i)
448  {
449  PrismLineFaces(FaceToPrisms[face][i],
450  facelist,
451  FaceToPrisms,
452  PrismToFaces,
453  PrismDone);
454  }
455  }
456 }
static void PrismLineFaces(int prismid, map< int, int > &facelist, vector< vector< int > > &FacesToPrisms, vector< vector< int > > &PrismsToFaces, vector< bool > &PrismDone)
Definition: InputStar.cpp:422
static void Nektar::Utilities::PrismLineFaces ( int  prismid,
map< int, int > &  facelist,
vector< vector< int > > &  FacesToPrisms,
vector< vector< int > > &  PrismsToFaces,
vector< bool > &  PrismDone 
)
static

Definition at line 637 of file InputStarTec.cpp.

References PrismLineFaces().

642 {
643  if (PrismDone[prismid] == false)
644  {
645  PrismDone[prismid] = true;
646 
647  // Add faces0
648  int face = PrismToFaces[prismid][0];
649  facelist[face] = face;
650  for (int i = 0; i < FaceToPrisms[face].size(); ++i)
651  {
652  PrismLineFaces(FaceToPrisms[face][i],
653  facelist,
654  FaceToPrisms,
655  PrismToFaces,
656  PrismDone);
657  }
658 
659  // Add faces1
660  face = PrismToFaces[prismid][1];
661  facelist[face] = face;
662  for (int i = 0; i < FaceToPrisms[face].size(); ++i)
663  {
664  PrismLineFaces(FaceToPrisms[face][i],
665  facelist,
666  FaceToPrisms,
667  PrismToFaces,
668  PrismDone);
669  }
670  }
671 }
static void PrismLineFaces(int prismid, map< int, int > &facelist, vector< vector< int > > &FacesToPrisms, vector< vector< int > > &PrismsToFaces, vector< bool > &PrismDone)
std::vector<int> Nektar::Utilities::quadTensorNodeOrdering ( const std::vector< int > &  nodes,
int  n 
)

Reorder a quadrilateral to appear in Nektar++ ordering from Gmsh.

Definition at line 68 of file InputGmsh.cpp.

Referenced by Nektar::Utilities::InputGmsh::HexReordering(), and Nektar::Utilities::InputGmsh::QuadReordering().

69 {
70  std::vector<int> nodeList;
71 
72  // Triangle
73  nodeList.resize(nodes.size());
74 
75  // Vertices and edges
76  nodeList[0] = nodes[0];
77  if (n > 1)
78  {
79  nodeList[n - 1] = nodes[1];
80  nodeList[n * n - 1] = nodes[2];
81  nodeList[n * (n - 1)] = nodes[3];
82  }
83  for (int i = 1; i < n - 1; ++i)
84  {
85  nodeList[i] = nodes[4 + i - 1];
86  }
87  for (int i = 1; i < n - 1; ++i)
88  {
89  nodeList[n * n - 1 - i] = nodes[4 + 2 * (n - 2) + i - 1];
90  }
91 
92  // Interior (recursion)
93  if (n > 2)
94  {
95  // Reorder interior nodes
96  std::vector<int> interior((n - 2) * (n - 2));
97  std::copy(
98  nodes.begin() + 4 + 4 * (n - 2), nodes.end(), interior.begin());
99  interior = quadTensorNodeOrdering(interior, n - 2);
100 
101  // Copy into full node list
102  for (int j = 1; j < n - 1; ++j)
103  {
104  nodeList[j * n] = nodes[4 + 3 * (n - 2) + n - 2 - j];
105  for (int i = 1; i < n - 1; ++i)
106  {
107  nodeList[j * n + i] = interior[(j - 1) * (n - 2) + (i - 1)];
108  }
109  nodeList[(j + 1) * n - 1] = nodes[4 + (n - 2) + j - 1];
110  }
111  }
112 
113  return nodeList;
114 }
std::vector< int > quadTensorNodeOrdering(const std::vector< int > &nodes, int n)
Reorder a quadrilateral to appear in Nektar++ ordering from Gmsh.
Definition: InputGmsh.cpp:68
bool Nektar::Utilities::same ( NekDouble  x1,
NekDouble  y1,
NekDouble  z1,
NekDouble  x2,
NekDouble  y2,
NekDouble  z2 
)

Definition at line 746 of file ProcessIsoContour.cpp.

Referenced by Nektar::SpatialDomains::GeomFactors::ComputeDeriv(), and Nektar::Utilities::Iso::globalcondense().

748 {
749  if((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) + (z1-z2)*(z1-z2) < SQ_PNT_TOL)
750  {
751  return true;
752  }
753 
754  return false;
755 }
template<typename T >
void Nektar::Utilities::TestElmts ( SpatialDomains::MeshGraphSharedPtr &  graph)

Definition at line 77 of file OutputNekpp.cpp.

78 {
79  const std::map<int, boost::shared_ptr<T> > &tmp =
80  graph->GetAllElementsOfType<T>();
81  typename std::map<int, boost::shared_ptr<T> >::const_iterator it1, it2;
82 
83  SpatialDomains::CurveMap &curvedEdges = graph->GetCurvedEdges();
84  SpatialDomains::CurveMap &curvedFaces = graph->GetCurvedFaces();
85 
86  for (it1 = tmp.begin(), it2 = tmp.end(); it1 != it2; ++it1)
87  {
88  SpatialDomains::GeometrySharedPtr geom = it1->second;
89  geom->FillGeom();
90  geom->Reset(curvedEdges, curvedFaces);
91  }
92 }
boost::unordered_map< int, CurveSharedPtr > CurveMap
Definition: Curve.hpp:63
boost::shared_ptr< Geometry > GeometrySharedPtr
Definition: Geometry.h:53
void Nektar::Utilities::ThreeSimilar ( const int  i,
const int  j,
const int  k,
int &  pr,
int &  ps 
)

Definition at line 270 of file ProcessIsoContour.cpp.

References ASSERTL0.

Referenced by Nektar::Utilities::ProcessIsoContour::ExtractContour().

274 {
275  switch (i + j + k)
276  {
277  case (3):
278  pr = 3;
279  ps = 4;
280  break;
281  case (4):
282  pr = 2;
283  ps = 4;
284  break;
285  case (5):
286  if (j == 1)
287  {
288  pr = 2;
289  ps = 3;
290  }
291  else
292  {
293  pr = 1;
294  ps = 4;
295  }
296  break;
297  case (6):
298  if (i == 0)
299  {
300  pr = 1;
301  ps = 3;
302  }
303  else
304  {
305  pr = 0;
306  ps = 4;
307  }
308  break;
309  case (7):
310  if (i == 0)
311  {
312  pr = 1;
313  ps = 2;
314  }
315  else
316  {
317  pr = 0;
318  ps = 3;
319  }
320  break;
321  case (8):
322  pr = 0;
323  ps = 2;
324  break;
325  case (9):
326  pr = 0;
327  ps = 1;
328  break;
329  default:
330  ASSERTL0(false,"Error in 5-point triangulation in ThreeSimilar");
331  break;
332  }
333 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:188
std::vector<int> Nektar::Utilities::triTensorNodeOrdering ( const std::vector< int > &  nodes,
int  n 
)

Definition at line 116 of file InputGmsh.cpp.

Referenced by Nektar::Utilities::InputGmsh::TetReordering(), and Nektar::Utilities::InputGmsh::TriReordering().

117 {
118  std::vector<int> nodeList;
119  int cnt2;
120 
121  nodeList.resize(nodes.size());
122 
123  // Vertices
124  nodeList[0] = nodes[0];
125  if (n > 1)
126  {
127  nodeList[n - 1] = nodes[1];
128  nodeList[n * (n + 1) / 2 - 1] = nodes[2];
129  }
130 
131  // Edges
132  int cnt = n;
133  for (int i = 1; i < n - 1; ++i)
134  {
135  nodeList[i] = nodes[3 + i - 1];
136  nodeList[cnt] = nodes[3 + 3 * (n - 2) - i];
137  nodeList[cnt + n - i - 1] = nodes[3 + (n - 2) + i - 1];
138  cnt += n - i;
139  }
140 
141  // Interior (recursion)
142  if (n > 3)
143  {
144  // Reorder interior nodes
145  std::vector<int> interior((n - 3) * (n - 2) / 2);
146  std::copy(
147  nodes.begin() + 3 + 3 * (n - 2), nodes.end(), interior.begin());
148  interior = triTensorNodeOrdering(interior, n - 3);
149 
150  // Copy into full node list
151  cnt = n;
152  cnt2 = 0;
153  for (int j = 1; j < n - 2; ++j)
154  {
155  for (int i = 0; i < n - j - 2; ++i)
156  {
157  nodeList[cnt + i + 1] = interior[cnt2 + i];
158  }
159  cnt += n - j;
160  cnt2 += n - 2 - j;
161  }
162  }
163 
164  return nodeList;
165 }
std::vector< int > triTensorNodeOrdering(const std::vector< int > &nodes, int n)
Definition: InputGmsh.cpp:116
void Nektar::Utilities::TwoPairs ( Array< OneD, NekDouble > &  cx,
Array< OneD, NekDouble > &  cy,
Array< OneD, NekDouble > &  cz,
int &  pr 
)

Definition at line 238 of file ProcessIsoContour.cpp.

Referenced by Nektar::Utilities::ProcessIsoContour::ExtractContour().

244 {
245  if (((cx[0]-cx[1])==0.0)&&
246  ((cy[0]-cy[1])==0.0)&&
247  ((cz[0]-cz[1])==0.0))
248  {
249  if (((cx[2]-cx[3])==0.0)&&
250  ((cy[2]-cy[3])==0.0)&&
251  ((cz[2]-cz[3])==0.0))
252  {
253  pr=4;
254  }
255  else
256  {
257  pr=3;
258  }
259  }
260  else
261  {
262  pr=1;
263  }
264 }

Variable Documentation

const char *const Nektar::Utilities::ModuleTypeMap
Initial value:
=
{
"Input",
"Process",
"Output"
}

Definition at line 74 of file FieldConvert/Module.h.

Referenced by operator<<().

NekDouble Nektar::Utilities::SQ_PNT_TOL =1e-16

Definition at line 729 of file ProcessIsoContour.cpp.