Nektar++
Functions
FldAddMultiShear.cpp File Reference
#include <cstdio>
#include <cstdlib>
#include <sstream>
#include <iostream>
#include <MultiRegions/ExpList.h>
#include <MultiRegions/ExpList1D.h>
#include <MultiRegions/ExpList2D.h>
#include <MultiRegions/ExpList3D.h>
#include <MultiRegions/ContField3D.h>
#include <MultiRegions/ContField2D.h>
Include dependency graph for FldAddMultiShear.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 15 of file FldAddMultiShear.cpp.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), ASSERTL0, Nektar::LibUtilities::SessionReader::CreateInstance(), Nektar::StdRegions::StdExpansion::GetTotPoints(), Nektar::LibUtilities::Import(), Nektar::SpatialDomains::MeshGraph::Read(), Vmath::Sadd(), sign, Vmath::Smul(), Vmath::Vadd(), Vmath::Vdiv(), Vmath::Vmul(), Vmath::Vsqrt(), Vmath::Vvtvm(), Vmath::Vvtvp(), Vmath::Vvtvvtp(), Nektar::LibUtilities::Write(), and Vmath::Zero().

16 {
17  int i,j;
18  int nfiles, nStart, surfID;
19  if(argc != 5)
20  {
21  fprintf(stderr,"Usage: FldAddMultiShear meshfile nfiles FirstInFile BoundaryID\n");
22  exit(1);
23  }
24 
25  nfiles = boost::lexical_cast<int>(argv[2]);
26  surfID = boost::lexical_cast<int>(argv[4]);
27 
28  vector<string> infiles(nfiles);
29  string outfile;
30 
31  // Output file name: multishear.fld
32  stringstream filename2;
33  filename2 << "multishear.fld";
34  filename2 >> outfile;
35 
36  // starting checkpoint file name: name_tn_wss.fld. n can be any number.
37  string basename = argv[3];
38  basename = basename.substr(basename.find_last_of("t")+1, basename.find_last_of(".")-basename.find_last_of("t"));
39  stringstream filename3;
40  filename3 << basename;
41  filename3 >> nStart;
42 
43  for (i = 0; i< nfiles; ++i)
44  {
45  basename = argv[3];
46  string extension = ".fld";
47  basename = basename.substr(0, basename.find_first_of("_"));
48  stringstream filename;
49  filename << basename << "_t" << i+nStart << "_wss.fld";
50  filename >> infiles[i];
51  cout << infiles[i]<<endl;
52  }
53 
54  argv[2] = argv[3];
55  argv[4] = argv[3];
56 
58  = LibUtilities::SessionReader::CreateInstance(argc, argv);
59 
60 
61  //----------------------------------------------
62  // Read in mesh from input file
63  string meshfile(argv[1]);
64  SpatialDomains::MeshGraphSharedPtr graphShPt = SpatialDomains::MeshGraph::Read(vSession);
65  //----------------------------------------------
66 
67 
68  //----------------------------------------------
69  // Import first field file.
70  vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
71  vector<vector<NekDouble> > fielddata;
72  LibUtilities::Import(infiles[0],fielddef,fielddata);
73  //----------------------------------------------
74 
75 
76  //----------------------------------------------
77  // Define Expansion
78  //----------------------------------------------
79  int expdim = graphShPt->GetMeshDimension();
80  int nfields = fielddef[0]->m_fields.size();
81  int addfields = 7;
82  int sfields = nfields - expdim;
83  Array<OneD, MultiRegions::ExpListSharedPtr> Exp(nfields+addfields), shear(sfields), extraVar(addfields);
84  MultiRegions::AssemblyMapCGSharedPtr m_locToGlobalMap;
85 
86  switch(expdim)
87  {
88  case 1:
89  {
90  ASSERTL0(false,"Expansion dimension not recognised");
91  }
92  break;
93  case 2:
94  {
95  ASSERTL0(false,"Expansion dimension not recognised");
96  }
97  break;
98  case 3:
99  {
100  i = 0;
103  ::AllocateSharedPtr(vSession, graphShPt,
104  vSession->GetVariable(i));
105 
106  m_locToGlobalMap = firstfield->GetLocalToGlobalMap();
107 
108  Exp[0] = firstfield;
109  for(i = 1; i < expdim; ++i)
110  {
112  ::AllocateSharedPtr(*firstfield, graphShPt,
113  vSession->GetVariable(i));
114  }
115 
116  for(i = 0; i < sfields; ++i)
117  {
119  ::AllocateSharedPtr(*firstfield, graphShPt,
120  vSession->GetVariable(i));
121  }
122 
123  for(i = 0; i < addfields; ++i)
124  {
126  ::AllocateSharedPtr(*firstfield, graphShPt,
127  vSession->GetVariable(0));
128  }
129 
130  }
131  break;
132  default:
133  ASSERTL0(false,"Expansion dimension not recognised");
134  break;
135  }
136 
137 
138  //-------------------------------------
139  // FIRST FILE - INITIALISING EVERYTHING
140  //-------------------------------------
141 
142  // Set up mapping from Boundary condition to element details.
145  Array<OneD, int> BoundarytoElmtID;
146  Array<OneD, int> BoundarytoTraceID;
148 
149  // Copy data from field file
150  for(i = 0; i < fielddata.size(); ++i)
151  {
152  Exp[0]->ExtractDataToCoeffs(fielddef[i],
153  fielddata[i],
154  fielddef[i]->m_fields[0],
155  Exp[0]->UpdateCoeffs());
156  }
157  Exp[0]->BwdTrans(Exp[0]->GetCoeffs(),Exp[0]->UpdatePhys());
158 
159  Exp[0]->GetBoundaryToElmtMap(BoundarytoElmtID,BoundarytoTraceID);
160  BndExp[0] = Exp[0]->GetBndCondExpansions();
161 
162  // Get face 2D expansion from element expansion
163  bc = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D> (BndExp[0][surfID]->GetExp(0));
164 
165  int nfq= bc->GetTotPoints();
166  int nelem = BndExp[0][surfID]->GetExpSize();
167  int nbq = nelem*nfq;
168 
169  int nt = Exp[0]->GetNpoints();
170  Array<OneD, const NekDouble> testing(nt);
171 
172 
173  // Define local arrays for wss components, and outputs (TAwss, osi, trs)
174  int n, cnt, elmtid, offset, boundary, bndOffset;
175  Array<OneD, NekDouble> Sx(nbq), Sy(nbq), Sz(nbq), S(nbq), Sxr(nbq), Syr(nbq), Szr(nbq);
176  Array<OneD, NekDouble> Save(nbq), temp2(nbq), trs(nbq), TAwss(nbq), osi(nbq);
177  Array<OneD, Array<OneD, NekDouble> > temp(sfields), values(nfields);
178 
179  for (i = 0; i < sfields; i++)
180  {
181  temp[i]= Array<OneD, NekDouble>(nfq);
182  }
183 
184  Vmath::Zero (nbq, Sx, 1);
185  Vmath::Zero (nbq, Sy, 1);
186  Vmath::Zero (nbq, Sz, 1);
187 
188  // -----------------------------------------------------
189  // Compute temporal average wall shear stress vector,
190  // and the spatial average of the temporal average.
191  // -----------------------------------------------------
192 
193  for (int fileNo = 0; fileNo < nfiles ; ++fileNo)
194  {
195  // Import field file.
196  fielddef.clear();
197  fielddata.clear();
198  LibUtilities::Import(infiles[fileNo],fielddef,fielddata);
199 
200  // Copy data from field file
201  for(j = 0; j < nfields; ++j)
202  {
203  for(int i = 0; i < fielddata.size(); ++i)
204  {
205  Exp[j]->ExtractDataToCoeffs(fielddef[i],
206  fielddata[i],
207  fielddef[i]->m_fields[j],
208  Exp[j]->UpdateCoeffs());
209  }
210  Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
211  }
212 
213  Exp[0]->GetBoundaryToElmtMap(BoundarytoElmtID,BoundarytoTraceID);
214  BndExp[0] = Exp[0]->GetBndCondExpansions();
215 
216  for(cnt = n = 0; n < BndExp[0].num_elements(); ++n)
217  {
218  if(n == surfID)
219  {
220  for(i = 0; i < nelem; ++i, cnt++)
221  {
222  // find element and face of this expansion.
223  elmtid = BoundarytoElmtID[cnt];
224  elmt = Exp[0]->GetExp(elmtid);
225  offset = Exp[0]->GetPhys_Offset(elmtid);
226  bndOffset = nfq*i;
227 
228  if(expdim == 2)
229  {
230  // Not implemented in 2D.
231  }
232  else
233  {
234  // Get face 2D expansion from element expansion
235  bc = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D> (BndExp[0][n]->GetExp(i));
236 
237  //identify boundary of element looking at.
238  boundary = BoundarytoTraceID[cnt];
239 
240  // Get face stress values.
241  for (int t = 0; t< expdim; t++)
242  {
243  elmt->GetFacePhysVals(boundary,bc, Exp[t+expdim]->GetPhys() + offset, temp[t]);
244  }
245 
246  for (int m = 0; m < nfq; m++)
247  {
248  Sxr[bndOffset + m] = temp[0][m];
249  Syr[bndOffset + m] = temp[1][m];
250  Szr[bndOffset + m] = temp[2][m];
251  }
252  }
253  }
254 
255  // Sx = Sx + Sxr;
256  Vmath::Vadd (nbq, Sxr, 1, Sx, 1, Sx, 1);
257  Vmath::Vadd (nbq, Syr, 1, Sy, 1, Sy, 1);
258  Vmath::Vadd (nbq, Szr, 1, Sz, 1, Sz, 1);
259 
260  Vmath::Zero (nbq, Sxr, 1);
261  Vmath::Zero (nbq, Syr, 1);
262  Vmath::Zero (nbq, Szr, 1);
263  }
264  else
265  {
266  cnt += BndExp[0][n]->GetExpSize();
267  }
268  }
269  }
270 
271  // Temporal averages of each wss component: Sx = Sx / nfiles. I.e. mean temporal wss
272  Vmath::Smul(nbq, 1.0/nfiles , Sx, 1, Sx, 1);
273  Vmath::Smul(nbq, 1.0/nfiles , Sy, 1, Sy, 1);
274  Vmath::Smul(nbq, 1.0/nfiles , Sz, 1, Sz, 1);
275 
276  // Spatial average of the temporal averaged wss vector: Save = sqrt(sx^2 + Sy^2 + Sz^2);
277  // i.e magnitude of mean temporal wss.
278  Vmath::Vvtvvtp(nbq, Sx, 1, Sx, 1, Sy, 1, Sy, 1, Save, 1);
279  Vmath::Vvtvp(nbq, Sz, 1, Sz, 1, Save, 1, Save, 1);
280  Vmath::Vsqrt(nbq, Save, 1, Save, 1);
281 
282  //temporal averaged vector / spatial average (sort of normalisation): Sxr = Sx/Save;
283  //unit vector of mean temporal wss (t).
284  Vmath::Vdiv(nbq, Sx, 1, Save, 1, Sxr, 1);
285  Vmath::Vdiv(nbq, Sy, 1, Save, 1, Syr, 1);
286  Vmath::Vdiv(nbq, Sz, 1, Save, 1, Szr, 1);
287 
288  Vmath::Zero (nbq, Sx, 1);
289  Vmath::Zero (nbq, Sy, 1);
290  Vmath::Zero (nbq, Sz, 1);
291  Vmath::Zero (nbq, trs, 1);
292  Vmath::Zero (nbq, TAwss, 1);
293 
294  // -----------------------------------------------------
295  // Loop through files again, and compute transverse wss
296  // -----------------------------------------------------
297 
298  for (int fileNo = 0; fileNo < nfiles ; ++fileNo)
299  {
300  Vmath::Zero (nbq, Sx, 1);
301  Vmath::Zero (nbq, Sy, 1);
302  Vmath::Zero (nbq, Sz, 1);
303 
304  // Import field file.
305  fielddef.clear();
306  fielddata.clear();
307  LibUtilities::Import(infiles[fileNo],fielddef,fielddata);
308 
309  // Copy data from field file
310  for(j = 0; j < nfields; ++j)
311  {
312  for(int i = 0; i < fielddata.size(); ++i)
313  {
314  Exp[j]->ExtractDataToCoeffs(fielddef[i],
315  fielddata[i],
316  fielddef[i]->m_fields[j],
317  Exp[j]->UpdateCoeffs());
318  }
319  Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
320  }
321 
322  Exp[0]->GetBoundaryToElmtMap(BoundarytoElmtID,BoundarytoTraceID);
323  BndExp[0] = Exp[0]->GetBndCondExpansions();
324 
325  for(cnt = n = 0; n < BndExp[0].num_elements(); ++n)
326  {
327  if(n == surfID)
328  {
329  for(i = 0; i < nelem; ++i, cnt++)
330  {
331  // find element and face of this expansion.
332  elmtid = BoundarytoElmtID[cnt];
333  elmt = Exp[0]->GetExp(elmtid);
334  offset = Exp[0]->GetPhys_Offset(elmtid);
335  bndOffset = nfq*i;
336 
337  if(expdim == 2)
338  {
339  }
340  else
341  {
342  // Get face 2D expansion from element expansion
343  bc = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D> (BndExp[0][n]->GetExp(i));
344 
345  //identify boundary of element looking at.
346  boundary = BoundarytoTraceID[cnt];
347 
348  // Get face stress values.
349  for (int t = 0; t< sfields; t++)
350  {
351  elmt->GetFacePhysVals(boundary,bc,Exp[t+expdim]->GetPhys() + offset, temp[t]);
352  }
353 
354  for (int m = 0; m < nfq; m++)
355  {
356  Sx[bndOffset + m] = temp[0][m];
357  Sy[bndOffset + m] = temp[1][m];
358  Sz[bndOffset + m] = temp[2][m];
359  //S [bndOffset + m] = temp[3][m];
360  }
361  }
362  }
363 
364  Vmath::Vvtvvtp(nbq, Sx, 1, Sx, 1, Sy, 1, Sy, 1, S, 1);
365  Vmath::Vvtvp(nbq, Sz, 1, Sz, 1, S, 1, S, 1);
366  Vmath::Vsqrt(nbq, S, 1, S, 1);
367 
368  // transverse wall shear stress
369  // trs = trs + sqrt(s^2 - (Sx*Sxr + Sy*Syr + Sz*Szr)^2)
370  Vmath::Vvtvvtp(nbq, Sx, 1, Sxr, 1, Sy, 1, Syr, 1, temp2, 1);
371  Vmath::Vvtvp(nbq, Sz, 1, Szr, 1, temp2, 1, temp2, 1);
372  Vmath::Vmul(nbq, temp2, 1, temp2, 1, temp2, 1);
373  Vmath::Vvtvm(nbq, S, 1, S, 1, temp2, 1, temp2, 1);
374  for (int m = 0; m < nbq; m++)
375  {
376  if (temp2[m]> 0.0)
377  {
378  trs[m] = trs[m] + sqrt(temp2[m]);
379  } /*
380  else
381  {
382  trs[m] = 0.0;
383  }*/
384  }
385 
386  Vmath::Zero (nbq, temp2, 1);
387 
388  //Time averaged wss TAwss = TAwss + S;
389  Vmath::Vadd (nbq, S, 1, TAwss, 1, TAwss, 1);
390  }
391  else
392  {
393  cnt += BndExp[0][n]->GetExpSize();
394  }
395  }
396  }
397 
398 
399  // Final step in computing trs and TAwss: trs = trs/nfiles;
400  Vmath::Smul (nbq, (1.0/nfiles), trs, 1, trs, 1);
401  Vmath::Smul (nbq, (1.0/nfiles), TAwss, 1, TAwss, 1);
402 
403  //Compute osi = 0.5*(1- Save/TAwss)
404  Vmath::Vdiv(nbq, Save, 1, TAwss, 1, osi, 1);
405  Vmath::Smul(nbq, -0.5, osi, 1, osi, 1);
406  Vmath::Sadd(nbq, 0.5, osi, 1, osi, 1);
407 
408  fielddef.clear();
409  fielddata.clear();
410  LibUtilities::Import(infiles[nfiles-1],fielddef,fielddata);
411 
412  // Copy u,v,w, data from last field file for the fields
413  for(j = 0; j < nfields; ++j)
414  {
415  for(int i = 0; i < fielddata.size(); ++i)
416  {
417  Exp[j]->ExtractDataToCoeffs(fielddef[i],
418  fielddata[i],
419  fielddef[i]->m_fields[j],
420  Exp[j]->UpdateCoeffs());
421  }
422  Exp[j]->BwdTrans(Exp[j]->GetCoeffs(),Exp[j]->UpdatePhys());
423  }
424 
425  for(j = 0; j < addfields; ++j)
426  {
427  for(int i = 0; i < fielddata.size(); ++i)
428  {
429  Exp[j+nfields]->ExtractDataToCoeffs(fielddef[i],
430  fielddata[i],
431  fielddef[i]->m_fields[j],
432  Exp[j+nfields]->UpdateCoeffs());
433  }
434  Exp[j+nfields]->BwdTrans(Exp[j+nfields]->GetCoeffs(),Exp[j+nfields]->UpdatePhys());
435  }
436 
437  Exp[0]->GetBoundaryToElmtMap(BoundarytoElmtID,BoundarytoTraceID);
438 
439  //get boundary expansions for each field
440  for(j = 0; j < nfields+addfields; ++j)
441  {
442  BndExp[j] = Exp[j]->GetBndCondExpansions();
443  }
444 
445  for(cnt = n = 0; n < BndExp[0].num_elements(); ++n)
446  {
447  if(n == surfID)
448  {
449  for(i = 0; i < nelem; ++i, cnt++)
450  {
451  // find element and face of this expansion.
452  elmtid = BoundarytoElmtID[cnt];
453  offset = Exp[0]->GetPhys_Offset(elmtid);
454  bndOffset = nfq*i;
455 
456  if(expdim == 2)
457  {
458  }
459  else
460  {
461  // Get face 2D expansion from element expansion
462  bc = boost::dynamic_pointer_cast<StdRegions::StdExpansion2D> (BndExp[0][n]->GetExp(i));
463 
464  //identify boundary of element looking at.
465  boundary = BoundarytoTraceID[cnt];
466 
467  //Update outfield coefficients in the elemental boundary expansion
468  for (j = 0; j < nfq; j++)
469  {
470  temp[0][j] = trs[bndOffset + j];
471  temp[1][j] = TAwss[bndOffset + j];
472  temp[2][j] = osi[bndOffset + j];
473  }
474 
475  for (j = 0; j < 3; j++)
476  {
477  values[j] = BndExp[j+nfields][n]->UpdateCoeffs() + BndExp[j+nfields][n]->GetCoeff_Offset(i);
478  bc->FwdTrans(temp[j], values[j]);
479 
480  Vmath::Zero(nbq, temp[j],1);
481  }
482 
483  for (j = 0; j < nfq; j++)
484  {
485  temp[0][j] = Sxr[bndOffset + j];
486  temp[1][j] = Syr[bndOffset + j];
487  temp[2][j] = Szr[bndOffset + j];
488  }
489 
490  for (j = 0; j < 3; j++)
491  {
492  values[j] = BndExp[j+nfields+3][n]->UpdateCoeffs() + BndExp[j+nfields+3][n]->GetCoeff_Offset(i);
493  bc->FwdTrans(temp[j], values[j]);
494 
495  Vmath::Zero(nbq, temp[j],1);
496  }
497 
498 
499  for (j = 0; j < nfq; j++)
500  {
501  temp[0][j] = Save[bndOffset + j];
502  }
503 
504  values[0] = BndExp[nfields+addfields-1][n]->UpdateCoeffs() + BndExp[nfields+addfields-1][n]->GetCoeff_Offset(i);
505  bc->FwdTrans(temp[0], values[0]);
506 
507  }
508  }
509  }
510  else
511  {
512  cnt += BndExp[0][n]->GetExpSize();
513  }
514  }
515 
516  for(j = 0; j < nfields + addfields; ++j)
517  {
518  int ncoeffs = Exp[j]->GetNcoeffs();
519  Array<OneD, NekDouble> output(ncoeffs);
520 
521  output=Exp[j]->UpdateCoeffs();
522 
523  int nGlobal=m_locToGlobalMap->GetNumGlobalCoeffs();
524  Array<OneD, NekDouble> outarray(nGlobal,0.0);
525 
526  int bndcnt=0;
527 
528  const Array<OneD,const int>& map = m_locToGlobalMap->GetBndCondCoeffsToGlobalCoeffsMap();
529  NekDouble sign;
530 
531  for(i = 0; i < BndExp[j].num_elements(); ++i)
532  {
533  if(i==surfID)
534  {
535  const Array<OneD,const NekDouble>& coeffs = BndExp[j][i]->GetCoeffs();
536  for(int k = 0; k < (BndExp[j][i])->GetNcoeffs(); ++k)
537  {
538  sign = m_locToGlobalMap->GetBndCondCoeffsToGlobalCoeffsSign(bndcnt);
539  outarray[map[bndcnt++]] = sign * coeffs[k];
540  }
541  }
542  else
543  {
544  bndcnt += BndExp[j][i]->GetNcoeffs();
545  }
546  }
547  m_locToGlobalMap->GlobalToLocal(outarray,output);
548 
549  }
550 
551  //-----------------------------------------------
552  // Write solution to file
553  // ----------------------------------------------
554  std::vector<LibUtilities::FieldDefinitionsSharedPtr> FieldDef
555  = Exp[0]->GetFieldDefinitions();
556  std::vector<std::vector<NekDouble> > FieldData(FieldDef.size());
557 
558  vector<string > outname;
559 
560  outname.push_back("TransWSS");
561  outname.push_back("TAWSS");
562  outname.push_back("OSI");
563  outname.push_back("norm_mean_x");
564  outname.push_back("norm_mean_y");
565  outname.push_back("norm_mean_z");
566  outname.push_back("mean_mag");
567 
568  for(j = 0; j < nfields+addfields; ++j)
569  {
570  for(i = 0; i < FieldDef.size(); ++i)
571  {
572  if (j >= nfields)
573  {
574  FieldDef[i]->m_fields.push_back(outname[j-nfields]);
575  }
576  else
577  {
578  FieldDef[i]->m_fields.push_back(fielddef[i]->m_fields[j]);
579  }
580  Exp[j]->AppendFieldData(FieldDef[i], FieldData[i]);
581  }
582  }
583 
584  LibUtilities::Write(outfile, FieldDef, FieldData);
585 
586  return 0;
587 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:161
#define sign(a, b)
return the sign(b)*a
Definition: Polylib.cpp:22
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
Definition: Vmath.cpp:394
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
void Vvtvp(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvp (vector times vector plus vector): z = w*x + y
Definition: Vmath.cpp:428
void Vdiv(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x/y.
Definition: Vmath.cpp:227
boost::shared_ptr< SessionReader > SessionReaderSharedPtr
Definition: MeshPartition.h:50
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > ElementiDs)
Imports an FLD file.
Definition: FieldIO.cpp:106
int GetTotPoints() const
This function returns the total number of quadrature points used in the element.
Definition: StdExpansion.h:141
boost::shared_ptr< StdExpansion2D > StdExpansion2DSharedPtr
void Smul(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha*y.
Definition: Vmath.cpp:199
double NekDouble
void Sadd(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Add vector y = alpha + x.
Definition: Vmath.cpp:301
void Vvtvvtp(int n, const T *v, int incv, const T *w, int incw, const T *x, int incx, const T *y, int incy, T *z, int incz)
vvtvvtp (vector times vector plus vector times vector):
Definition: Vmath.cpp:523
void Vvtvm(int n, const T *w, const int incw, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
vvtvm (vector times vector plus vector): z = w*x - y
Definition: Vmath.cpp:451
void Write(const std::string &outFile, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, const FieldMetaDataMap &fieldinfomap)
Write a field file in serial only.
Definition: FieldIO.cpp:72
boost::shared_ptr< ContField3D > ContField3DSharedPtr
Definition: ContField3D.h:190
void Zero(int n, T *x, const int incx)
Zero vector.
Definition: Vmath.cpp:359
boost::shared_ptr< AssemblyMapCG > AssemblyMapCGSharedPtr
Definition: AssemblyMapCG.h:52
boost::shared_ptr< StdExpansion > StdExpansionSharedPtr
boost::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:432
void Vadd(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Add vector z = x+y.
Definition: Vmath.cpp:285
void Vmul(int n, const T *x, const int incx, const T *y, const int incy, T *z, const int incz)
Multiply vector z = x*y.
Definition: Vmath.cpp:169