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

Classes

struct  ConfigOption
 Represents a command-line configuration option. More...
 
struct  Field
 
class  FieldConvertComm
 
class  InputDat
 Input module for Xml files. More...
 
class  InputFld
 
class  InputModule
 Abstract base class for input modules. More...
 
class  InputNek5000
 
class  InputPts
 
class  InputXml
 
class  Interpolator
 A class that contains algorithms for interpolation between pts fields, expansions and different meshes. More...
 
class  Iso
 
class  IsoVertex
 
class  Module
 
class  OutputFld
 Converter from fld to vtk. More...
 
class  OutputInfo
 
class  OutputModule
 Abstract base class for output modules. More...
 
class  OutputPts
 Converter from fld to pts. More...
 
class  OutputStdOut
 
class  OutputTecplot
 Tecplot output class. More...
 
class  OutputTecplotBinary
 Tecplot output class, specifically for binary field output. More...
 
class  OutputVtk
 Converter from fld to vtk. More...
 
class  OutputXml
 Converter from fld to vtk. More...
 
class  ProcessAddCompositeID
 This processing module adds a fld with the composite ID. More...
 
class  ProcessAddFld
 This processing module scales the input fld file. 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  ProcessDeform
 
class  ProcessDisplacement
 
class  ProcessEquiSpacedOutput
 This processing module interpolates one field to another. 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  ProcessHomogeneousStretch
 This processing module stretches the homogeneous direction of a 3DH1D expansion by an integer factor. 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  ProcessJacobianEnergy
 This processing module scales the input fld file. 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  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  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  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  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  TriFaceHash
 
struct  TriFaceIDs
 

Typedefs

typedef boost::shared_ptr< FieldFieldSharedPtr
 
typedef boost::shared_ptr
< Interpolator
InterpolatorSharedPtr
 
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
 

Enumerations

enum  InterpMethod {
  eNoMethod, eNearestNeighbour, eQuadratic, eShepard,
  eGauss
}
 
enum  ModuleType { eInputModule, eProcessModule, eOutputModule, SIZE_ModuleType }
 
enum  TecplotZoneType {
  eOrdered = 0, eFELineSeg, eFETriangle, eFEQuadrilateral,
  eFETetrahedron, eFEBrick, eFEPolygon, eFEPolyhedron
}
 

Functions

template<typename T >
void swap_endian (T &u)
 Swap endian ordering of the input variable. More...
 
ModuleFactoryGetModuleFactory ()
 
std::ostream & operator<< (std::ostream &os, const ModuleKey &rhs)
 
template<typename T >
void WriteStream (std::ostream &outfile, T data)
 Helper function to write binary data to stream. More...
 
template<>
void WriteStream (std::ostream &outfile, std::string data)
 Specialisation of WriteStream to support writing std::string. More...
 
template<typename T >
void WriteStream (std::ostream &outfile, Array< OneD, T > data)
 Specialisation of WriteStream to support writing Nektar::Array datatype. More...
 
template<typename T >
void WriteStream (std::ostream &outfile, std::vector< T > data)
 Specialisation of WriteStream to support writing std::vector datatype. More...
 
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)
 
vector< DNekMatMappingIdealToRef (SpatialDomains::GeometrySharedPtr geom, StdRegions::StdExpansionSharedPtr chi)
 

Variables

static InterpolatorSharedPtr NullInterpolator
 
const char *const ModuleTypeMap [] = {"Input", "Process", "Output"}
 
std::string TecplotZoneTypeMap []
 

Typedef Documentation

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

Definition at line 767 of file Field.hpp.

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

Definition at line 242 of file Interpolator.h.

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

Definition at line 187 of file ProcessIsoContour.h.

Definition at line 234 of file FieldUtils/Module.h.

Definition at line 229 of file FieldUtils/Module.h.

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

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

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

Definition at line 100 of file ProcessDisplacement.cpp.

Enumeration Type Documentation

Enumerator
eNoMethod 
eNearestNeighbour 
eQuadratic 
eShepard 
eGauss 

Definition at line 64 of file Interpolator.h.

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

Enumerator
eInputModule 
eProcessModule 
eOutputModule 
SIZE_ModuleType 

Definition at line 68 of file FieldUtils/Module.h.

Function Documentation

FIELD_UTILS_EXPORT ModuleFactory & Nektar::FieldUtils::GetModuleFactory ( )

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

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

Referenced by Nektar::SolverUtils::FilterFieldConvert::CreateModules(), main(), Nektar::Utilities::InputMCF::Process(), Nektar::Utilities::ProcessOptiExtract::Process(), Nektar::Utilities::ProcessLinear::Process(), Nektar::Utilities::ProcessInsertSurface::Process(), and Nektar::NekMeshUtils::Octree::WriteOctree().

50 {
51  typedef Loki::SingletonHolder<ModuleFactory, Loki::CreateUsingNew,
52  Loki::NoDestroy, Loki::SingleThreaded>
53  Type;
54  return Type::Instance();
55 }
LibUtilities::NekFactory< ModuleKey, Module, FieldSharedPtr > ModuleFactory
vector<DNekMat> Nektar::FieldUtils::MappingIdealToRef ( SpatialDomains::GeometrySharedPtr  geom,
StdRegions::StdExpansionSharedPtr  chi 
)
inline

Definition at line 115 of file ProcessQualityMetric.cpp.

References ASSERTL0, Nektar::eFULL, Nektar::LibUtilities::eHexahedron, Nektar::LibUtilities::ePrism, Nektar::LibUtilities::eQuadrilateral, Nektar::LibUtilities::eTetrahedron, Nektar::LibUtilities::eTriangle, and CellMLToNektar.cellml_metadata::p.

Referenced by Nektar::Utilities::ElUtil::ElUtil(), and Nektar::FieldUtils::ProcessQualityMetric::GetQ().

117 {
118  vector<DNekMat> ret;
119 
120  if (geom->GetShapeType() == LibUtilities::eQuadrilateral)
121  {
122  vector<Array<OneD, NekDouble> > xy;
123  for (int i = 0; i < geom->GetNumVerts(); i++)
124  {
125  Array<OneD, NekDouble> loc(2);
126  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
127  p->GetCoords(loc);
128  xy.push_back(loc);
129  }
130 
131  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
132  Array<OneD, NekDouble> u = b[0]->GetZ();
133  Array<OneD, NekDouble> v = b[1]->GetZ();
134 
135  for (int j = 0; j < b[1]->GetNumPoints(); j++)
136  {
137  for (int i = 0; i < b[0]->GetNumPoints(); i++)
138  {
139  NekDouble a1 = 0.5 * (1.0 - u[i]), a2 = 0.5 * (1.0 + u[i]);
140  NekDouble b1 = 0.5 * (1.0 - v[j]), b2 = 0.5 * (1.0 + v[j]);
141  DNekMat dxdz(2, 2, 1.0, eFULL);
142 
143  dxdz(0, 0) = 0.5 * (-b1 * xy[0][0] + b1 * xy[1][0] +
144  b2 * xy[2][0] - b2 * xy[3][0]);
145  dxdz(1, 0) = 0.5 * (-b1 * xy[0][1] + b1 * xy[1][1] +
146  b2 * xy[2][1] - b2 * xy[3][1]);
147 
148  dxdz(0, 1) = 0.5 * (-a1 * xy[0][0] - a2 * xy[1][0] +
149  a2 * xy[2][0] + a1 * xy[3][0]);
150  dxdz(1, 1) = 0.5 * (-a1 * xy[0][1] - a2 * xy[1][1] +
151  a2 * xy[2][1] + a1 * xy[3][1]);
152 
153  dxdz.Invert();
154  ret.push_back(dxdz);
155  }
156  }
157  }
158  else if (geom->GetShapeType() == LibUtilities::eTriangle)
159  {
160  vector<Array<OneD, NekDouble> > xy;
161  for (int i = 0; i < geom->GetNumVerts(); i++)
162  {
163  Array<OneD, NekDouble> loc(2);
164  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
165  p->GetCoords(loc);
166  xy.push_back(loc);
167  }
168 
169  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
170  Array<OneD, NekDouble> u = b[0]->GetZ();
171  Array<OneD, NekDouble> v = b[1]->GetZ();
172 
173  for (int i = 0; i < b[0]->GetNumPoints(); i++)
174  {
175  for (int j = 0; j < b[1]->GetNumPoints(); j++)
176  {
177  DNekMat dxdz(2, 2, 1.0, eFULL);
178  dxdz(0, 0) = -xy[0][0] / 2.0 + xy[1][0] / 2.0;
179 
180  dxdz(0, 1) = -xy[0][0] / 2.0 + xy[2][0] / 2.0;
181 
182  dxdz(1, 0) = -xy[0][1] / 2.0 + xy[1][1] / 2.0;
183 
184  dxdz(1, 1) = -xy[0][1] / 2.0 + xy[2][1] / 2.0;
185 
186  dxdz.Invert();
187  ret.push_back(dxdz);
188  }
189  }
190  }
191  else if (geom->GetShapeType() == LibUtilities::eTetrahedron)
192  {
193  vector<Array<OneD, NekDouble> > xyz;
194  for (int i = 0; i < geom->GetNumVerts(); i++)
195  {
196  Array<OneD, NekDouble> loc(3);
197  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
198  p->GetCoords(loc);
199  xyz.push_back(loc);
200  }
201 
202  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
203  Array<OneD, NekDouble> u = b[0]->GetZ();
204  Array<OneD, NekDouble> v = b[1]->GetZ();
205  Array<OneD, NekDouble> z = b[2]->GetZ();
206 
207  for (int i = 0; i < b[0]->GetNumPoints(); i++)
208  {
209  for (int j = 0; j < b[1]->GetNumPoints(); j++)
210  {
211  for (int k = 0; k < b[2]->GetNumPoints(); k++)
212  {
213  DNekMat dxdz(3, 3, 1.0, eFULL);
214  dxdz(0, 0) = -xyz[0][0] / 2.0 + xyz[1][0] / 2.0;
215 
216  dxdz(0, 1) = -xyz[0][0] / 2.0 + xyz[2][0] / 2.0;
217 
218  dxdz(0, 2) = -xyz[0][0] / 2.0 + xyz[3][0] / 2.0;
219 
220  dxdz(1, 0) = -xyz[0][1] / 2.0 + xyz[1][1] / 2.0;
221 
222  dxdz(1, 1) = -xyz[0][1] / 2.0 + xyz[2][1] / 2.0;
223 
224  dxdz(1, 2) = -xyz[0][1] / 2.0 + xyz[3][1] / 2.0;
225 
226  dxdz(2, 0) = -xyz[0][2] / 2.0 + xyz[1][2] / 2.0;
227 
228  dxdz(2, 1) = -xyz[0][2] / 2.0 + xyz[2][2] / 2.0;
229 
230  dxdz(2, 2) = -xyz[0][2] / 2.0 + xyz[3][2] / 2.0;
231 
232  dxdz.Invert();
233  ret.push_back(dxdz);
234  }
235  }
236  }
237  }
238  else if (geom->GetShapeType() == LibUtilities::ePrism)
239  {
240  vector<Array<OneD, NekDouble> > xyz;
241  for (int i = 0; i < geom->GetNumVerts(); i++)
242  {
243  Array<OneD, NekDouble> loc(3);
244  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
245  p->GetCoords(loc);
246  xyz.push_back(loc);
247  }
248 
249  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
250  Array<OneD, NekDouble> eta1 = b[0]->GetZ();
251  Array<OneD, NekDouble> eta2 = b[1]->GetZ();
252  Array<OneD, NekDouble> eta3 = b[2]->GetZ();
253 
254  for (int k = 0; k < b[2]->GetNumPoints(); k++)
255  {
256  for (int j = 0; j < b[1]->GetNumPoints(); j++)
257  {
258  for (int i = 0; i < b[0]->GetNumPoints(); i++)
259  {
260  NekDouble xi1 = 0.5 * (1 + eta1[i]) * (1 - eta3[k]) - 1.0;
261  NekDouble a2 = 0.5 * (1 + xi1);
262  NekDouble b1 = 0.5 * (1 - eta2[j]),
263  b2 = 0.5 * (1 + eta2[j]);
264  NekDouble c1 = 0.5 * (1 - eta3[k]),
265  c2 = 0.5 * (1 + eta3[k]);
266 
267  DNekMat dxdz(3, 3, 1.0, eFULL);
268 
269  dxdz(0, 0) = 0.5 * (-b1 * xyz[0][0] + b1 * xyz[1][0] +
270  b2 * xyz[2][0] - b2 * xyz[3][0]);
271  dxdz(1, 0) = 0.5 * (-b1 * xyz[0][1] + b1 * xyz[1][1] +
272  b2 * xyz[2][1] - b2 * xyz[3][1]);
273  dxdz(2, 0) = 0.5 * (-b1 * xyz[0][2] + b1 * xyz[1][2] +
274  b2 * xyz[2][2] - b2 * xyz[3][2]);
275 
276  dxdz(0, 1) = 0.5 * ((a2 - c1) * xyz[0][0] - a2 * xyz[1][0] +
277  a2 * xyz[2][0] + (c1 - a2) * xyz[3][0] -
278  c2 * xyz[4][0] + c2 * xyz[5][0]);
279  dxdz(1, 1) = 0.5 * ((a2 - c1) * xyz[0][1] - a2 * xyz[1][1] +
280  a2 * xyz[2][1] + (c1 - a2) * xyz[3][1] -
281  c2 * xyz[4][1] + c2 * xyz[5][1]);
282  dxdz(2, 1) = 0.5 * ((a2 - c1) * xyz[0][2] - a2 * xyz[1][2] +
283  a2 * xyz[2][2] + (c1 - a2) * xyz[3][2] -
284  c2 * xyz[4][2] + c2 * xyz[5][2]);
285 
286  dxdz(0, 2) = 0.5 * (-b1 * xyz[0][0] - b2 * xyz[3][0] +
287  b1 * xyz[4][0] + b2 * xyz[5][0]);
288  dxdz(1, 2) = 0.5 * (-b1 * xyz[0][1] - b2 * xyz[3][1] +
289  b1 * xyz[4][1] + b2 * xyz[5][1]);
290  dxdz(2, 2) = 0.5 * (-b1 * xyz[0][2] - b2 * xyz[3][2] +
291  b1 * xyz[4][2] + b2 * xyz[5][2]);
292 
293  dxdz.Invert();
294  ret.push_back(dxdz);
295  }
296  }
297  }
298  }
299  else if (geom->GetShapeType() == LibUtilities::eHexahedron)
300  {
301  vector<Array<OneD, NekDouble> > xyz;
302  for (int i = 0; i < geom->GetNumVerts(); i++)
303  {
304  Array<OneD, NekDouble> loc(3);
305  SpatialDomains::PointGeomSharedPtr p = geom->GetVertex(i);
306  p->GetCoords(loc);
307  xyz.push_back(loc);
308  }
309 
310  Array<OneD, const LibUtilities::BasisSharedPtr> b = chi->GetBase();
311  Array<OneD, NekDouble> eta1 = b[0]->GetZ();
312  Array<OneD, NekDouble> eta2 = b[1]->GetZ();
313  Array<OneD, NekDouble> eta3 = b[2]->GetZ();
314 
315  for (int k = 0; k < b[2]->GetNumPoints(); k++)
316  {
317  for (int j = 0; j < b[1]->GetNumPoints(); j++)
318  {
319  for (int i = 0; i < b[0]->GetNumPoints(); i++)
320  {
321  NekDouble a1 = 0.5 * (1 - eta1[i]);
322  NekDouble a2 = 0.5 * (1 + eta1[i]);
323  NekDouble b1 = 0.5 * (1 - eta2[j]),
324  b2 = 0.5 * (1 + eta2[j]);
325  NekDouble c1 = 0.5 * (1 - eta3[k]),
326  c2 = 0.5 * (1 + eta3[k]);
327 
328  DNekMat dxdz(3, 3, 1.0, eFULL);
329 
330  dxdz(0, 0) =
331  -0.5 * b1 * c1 * xyz[0][0] + 0.5 * b1 * c1 * xyz[1][0] +
332  0.5 * b2 * c1 * xyz[2][0] - 0.5 * b2 * c1 * xyz[3][0] -
333  0.5 * b1 * c2 * xyz[5][0] + 0.5 * b1 * c2 * xyz[5][0] +
334  0.5 * b2 * c2 * xyz[6][0] - 0.5 * b2 * c2 * xyz[7][0];
335  dxdz(1, 0) =
336  -0.5 * b1 * c1 * xyz[0][1] + 0.5 * b1 * c1 * xyz[1][1] +
337  0.5 * b2 * c1 * xyz[2][1] - 0.5 * b2 * c1 * xyz[3][1] -
338  0.5 * b1 * c2 * xyz[5][1] + 0.5 * b1 * c2 * xyz[5][1] +
339  0.5 * b2 * c2 * xyz[6][1] - 0.5 * b2 * c2 * xyz[7][1];
340  dxdz(2, 0) =
341  -0.5 * b1 * c1 * xyz[0][2] + 0.5 * b1 * c1 * xyz[1][2] +
342  0.5 * b2 * c1 * xyz[2][2] - 0.5 * b2 * c1 * xyz[3][2] -
343  0.5 * b1 * c2 * xyz[5][2] + 0.5 * b1 * c2 * xyz[5][2] +
344  0.5 * b2 * c2 * xyz[6][2] - 0.5 * b2 * c2 * xyz[7][2];
345 
346  dxdz(0, 1) =
347  -0.5 * a1 * c1 * xyz[0][0] - 0.5 * a2 * c1 * xyz[1][0] +
348  0.5 * a2 * c1 * xyz[2][0] + 0.5 * a1 * c1 * xyz[3][0] -
349  0.5 * a1 * c2 * xyz[5][0] - 0.5 * a2 * c2 * xyz[5][0] +
350  0.5 * a2 * c2 * xyz[6][0] + 0.5 * a1 * c2 * xyz[7][0];
351  dxdz(1, 1) =
352  -0.5 * a1 * c1 * xyz[0][1] - 0.5 * a2 * c1 * xyz[1][1] +
353  0.5 * a2 * c1 * xyz[2][1] + 0.5 * a1 * c1 * xyz[3][1] -
354  0.5 * a1 * c2 * xyz[5][1] - 0.5 * a2 * c2 * xyz[5][1] +
355  0.5 * a2 * c2 * xyz[6][1] + 0.5 * a1 * c2 * xyz[7][1];
356  dxdz(2, 1) =
357  -0.5 * a1 * c1 * xyz[0][2] - 0.5 * a2 * c1 * xyz[1][2] +
358  0.5 * a2 * c1 * xyz[2][2] + 0.5 * a1 * c1 * xyz[3][2] -
359  0.5 * a1 * c2 * xyz[5][2] - 0.5 * a2 * c2 * xyz[5][2] +
360  0.5 * a2 * c2 * xyz[6][2] + 0.5 * a1 * c2 * xyz[7][2];
361 
362  dxdz(0, 0) =
363  -0.5 * b1 * a1 * xyz[0][0] - 0.5 * b1 * a2 * xyz[1][0] -
364  0.5 * b2 * a2 * xyz[2][0] - 0.5 * b2 * a1 * xyz[3][0] +
365  0.5 * b1 * a1 * xyz[5][0] + 0.5 * b1 * a2 * xyz[5][0] +
366  0.5 * b2 * a2 * xyz[6][0] + 0.5 * b2 * a1 * xyz[7][0];
367  dxdz(1, 0) =
368  -0.5 * b1 * a1 * xyz[0][1] - 0.5 * b1 * a2 * xyz[1][1] -
369  0.5 * b2 * a2 * xyz[2][1] - 0.5 * b2 * a1 * xyz[3][1] +
370  0.5 * b1 * a1 * xyz[5][1] + 0.5 * b1 * a2 * xyz[5][1] +
371  0.5 * b2 * a2 * xyz[6][1] + 0.5 * b2 * a1 * xyz[7][1];
372  dxdz(2, 0) =
373  -0.5 * b1 * a1 * xyz[0][2] - 0.5 * b1 * a2 * xyz[1][2] -
374  0.5 * b2 * a2 * xyz[2][2] - 0.5 * b2 * a1 * xyz[3][2] +
375  0.5 * b1 * a1 * xyz[5][2] + 0.5 * b1 * a2 * xyz[5][2] +
376  0.5 * b2 * a2 * xyz[6][2] + 0.5 * b2 * a1 * xyz[7][2];
377 
378  dxdz.Invert();
379  ret.push_back(dxdz);
380  }
381  }
382  }
383  }
384  else
385  {
386  ASSERTL0(false, "not coded");
387  }
388 
389  return ret;
390 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
NekMatrix< NekDouble, StandardMatrixTag > DNekMat
Definition: NekTypeDefs.hpp:52
double NekDouble
boost::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:60
bool Nektar::FieldUtils::operator!= ( const IsoVertex &  x,
const IsoVertex &  y 
)

Definition at line 986 of file ProcessIsoContour.cpp.

References Nektar::NekConstants::kNekZeroTol, Nektar::FieldUtils::IsoVertex::m_x, Nektar::FieldUtils::IsoVertex::m_y, and Nektar::FieldUtils::IsoVertex::m_z.

987 {
988  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) +
989  (x.m_z-y.m_z)*(x.m_z-y.m_z) < NekConstants::kNekZeroTol)? 0:1;
990 }
static const NekDouble kNekZeroTol
FIELD_UTILS_EXPORT ostream & Nektar::FieldUtils::operator<< ( std::ostream &  os,
const ModuleKey &  rhs 
)

Prints a given module key to a stream.

Definition at line 60 of file FieldUtils/Module.cpp.

References ModuleTypeMap.

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

Definition at line 83 of file ProcessDisplacement.cpp.

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

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

Definition at line 979 of file ProcessIsoContour.cpp.

References Nektar::NekConstants::kNekZeroTol, Nektar::FieldUtils::IsoVertex::m_x, Nektar::FieldUtils::IsoVertex::m_y, and Nektar::FieldUtils::IsoVertex::m_z.

980 {
981  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) +
982  (x.m_z-y.m_z)*(x.m_z-y.m_z) < NekConstants::kNekZeroTol)? true:false;
983 }
static const NekDouble kNekZeroTol
template<typename T >
void Nektar::FieldUtils::swap_endian ( T &  u)

Swap endian ordering of the input variable.

Definition at line 61 of file library/FieldUtils/InputModules/InputNek5000.cpp.

References dest.

Referenced by Nektar::FieldUtils::InputNek5000::Process().

62 {
63  union
64  {
65  T u;
66  unsigned char u8[sizeof(T)];
67  } source, dest;
68 
69  source.u = u;
70 
71  for (size_t k = 0; k < sizeof(T); k++)
72  {
73  dest.u8[k] = source.u8[sizeof(T) - k - 1];
74  }
75 
76  u = dest.u;
77 }
#define dest(otri, vertexptr)
void Nektar::FieldUtils::ThreeSimilar ( const int  i,
const int  j,
const int  k,
int &  pr,
int &  ps 
)

Definition at line 334 of file ProcessIsoContour.cpp.

References ASSERTL0.

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

338 {
339  switch (i + j + k)
340  {
341  case (3):
342  pr = 3;
343  ps = 4;
344  break;
345  case (4):
346  pr = 2;
347  ps = 4;
348  break;
349  case (5):
350  if (j == 1)
351  {
352  pr = 2;
353  ps = 3;
354  }
355  else
356  {
357  pr = 1;
358  ps = 4;
359  }
360  break;
361  case (6):
362  if (i == 0)
363  {
364  pr = 1;
365  ps = 3;
366  }
367  else
368  {
369  pr = 0;
370  ps = 4;
371  }
372  break;
373  case (7):
374  if (i == 0)
375  {
376  pr = 1;
377  ps = 2;
378  }
379  else
380  {
381  pr = 0;
382  ps = 3;
383  }
384  break;
385  case (8):
386  pr = 0;
387  ps = 2;
388  break;
389  case (9):
390  pr = 0;
391  ps = 1;
392  break;
393  default:
394  ASSERTL0(false,"Error in 5-point triangulation in ThreeSimilar");
395  break;
396  }
397 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:198
void Nektar::FieldUtils::TwoPairs ( Array< OneD, NekDouble > &  cx,
Array< OneD, NekDouble > &  cy,
Array< OneD, NekDouble > &  cz,
int &  pr 
)

Definition at line 302 of file ProcessIsoContour.cpp.

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

308 {
309  if (((cx[0]-cx[1])==0.0)&&
310  ((cy[0]-cy[1])==0.0)&&
311  ((cz[0]-cz[1])==0.0))
312  {
313  if (((cx[2]-cx[3])==0.0)&&
314  ((cy[2]-cy[3])==0.0)&&
315  ((cz[2]-cz[3])==0.0))
316  {
317  pr=4;
318  }
319  else
320  {
321  pr=3;
322  }
323  }
324  else
325  {
326  pr=1;
327  }
328 }
template<typename T >
void Nektar::FieldUtils::WriteStream ( std::ostream &  outfile,
data 
)

Helper function to write binary data to stream.

Definition at line 92 of file OutputTecplot.cpp.

Referenced by Nektar::FieldUtils::OutputTecplotBinary::WriteDoubleOrFloat(), WriteStream(), Nektar::FieldUtils::OutputTecplotBinary::WriteTecplotConnectivity(), Nektar::FieldUtils::OutputTecplotBinary::WriteTecplotHeader(), and Nektar::FieldUtils::OutputTecplotBinary::WriteTecplotZone().

93 {
94  T tmp = data;
95  outfile.write(reinterpret_cast<char *>(&tmp), sizeof(T));
96 }
template<>
void Nektar::FieldUtils::WriteStream ( std::ostream &  outfile,
std::string  data 
)

Specialisation of WriteStream to support writing std::string.

Tecplot binary formats represent all strings by writing out their characters as 32-bit integers, followed by a 32-bit integer null (0) character to denote the end of the string.

Definition at line 105 of file OutputTecplot.cpp.

References WriteStream().

106 {
107  // Convert string to array of int32_t
108  for (std::string::size_type i = 0; i < data.size(); ++i)
109  {
110  char strChar = data[i];
111  NekInt32 strCharInt = strChar;
112  WriteStream(outfile, strCharInt);
113  }
114 
115  // Now dump out zero character to terminate
116  WriteStream(outfile, 0);
117 }
boost::int32_t NekInt32
void WriteStream(std::ostream &outfile, std::vector< T > data)
Specialisation of WriteStream to support writing std::vector datatype.
template<typename T >
void Nektar::FieldUtils::WriteStream ( std::ostream &  outfile,
Array< OneD, T >  data 
)

Specialisation of WriteStream to support writing Nektar::Array datatype.

Definition at line 123 of file OutputTecplot.cpp.

125 {
126  outfile.write(reinterpret_cast<char *>(&data[0]),
127  data.num_elements() * sizeof(T));
128 }
template<typename T >
void Nektar::FieldUtils::WriteStream ( std::ostream &  outfile,
std::vector< T >  data 
)

Specialisation of WriteStream to support writing std::vector datatype.

Definition at line 133 of file OutputTecplot.cpp.

135 {
136  outfile.write(reinterpret_cast<char *>(&data[0]),
137  data.size() * sizeof(T));
138 }

Variable Documentation

const char* const Nektar::FieldUtils::ModuleTypeMap[] = {"Input", "Process", "Output"}

Definition at line 76 of file FieldUtils/Module.h.

Referenced by operator<<(), and Nektar::NekMeshUtils::operator<<().

InterpolatorSharedPtr Nektar::FieldUtils::NullInterpolator
static

Definition at line 243 of file Interpolator.h.

std::string Nektar::FieldUtils::TecplotZoneTypeMap[]
Initial value:
= {
"ORDERED",
"LINESEG",
"TRIANGLE",
"QUADRILATERAL",
"TETRAHEDRON",
"BRICK",
"POLYGON",
"POLYHEDRON"
}

Definition at line 51 of file OutputTecplot.cpp.