Nektar++
MoveMeshToCriticalLayer.cpp
Go to the documentation of this file.
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 // File MoveMeshToCriticalLayer.cpp
4 //
5 // For more information, please see: http://www.nektar.info
6 //
7 // The MIT License
8 //
9 // Copyright (c) 2006 Division of Applied Mathematics, Brown University (USA),
10 // Department of Aeronautics, Imperial College London (UK), and Scientific
11 // Computing and Imaging Institute, University of Utah (USA).
12 //
13 // Permission is hereby granted, free of charge, to any person obtaining a
14 // copy of this software and associated documentation files (the "Software"),
15 // to deal in the Software without restriction, including without limitation
16 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 // and/or sell copies of the Software, and to permit persons to whom the
18 // Software is furnished to do so, subject to the following conditions:
19 //
20 // The above copyright notice and this permission notice shall be included
21 // in all copies or substantial portions of the Software.
22 //
23 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 // DEALINGS IN THE SOFTWARE.
30 //
31 // Description: MoveMesh to critical layer
32 //
33 ///////////////////////////////////////////////////////////////////////////////
34 
35 #include <cstdio>
36 #include <cstdlib>
37 #include <iomanip>
38 
39 #include <tinyxml.h>
41 #include <MultiRegions/ExpList.h>
43 
44 using namespace std;
45 using namespace Nektar;
46 
48 
50 {
54  eNoSolve
55 };
56 
57 
58 struct MoveVerts
59 {
60  vector<NekDouble> kspring;
61  vector<int> springVid;
63 };
64 
65 void GetInterfaceVerts(const int compositeID,
67  vector<int> &InterfaceVerts);
68 
70  SpatialDomains::MeshGraphSharedPtr &mesh, string &fieldfile,
72 
73 void GetNewVertexLocation(TiXmlElement *doc,
75  vector<int> &InterfaceVerts,
76  Array<OneD, NekDouble> &xstreak,
77  Array<OneD, NekDouble> &ystreak,
78  Array<OneD,NekDouble> &vertx,
79  Array<OneD,NekDouble> &verty,
80  int maxiter);
81 
82 void TurnOffEdges(TiXmlElement *doc,
83  SpatialDomains::SegGeomMap &meshedges,
84  Array<OneD,MoveVerts> &verts);
85 
86 void RedefineVertices(TiXmlElement *doc,
88 
90  Array<OneD, NekDouble> &dvertx,
91  Array<OneD, NekDouble> &dverty);
92 
93 int main(int argc, char *argv[])
94 {
95  if(argc !=4)
96  {
97  fprintf(stderr,"Usage: ./MoveMeshToCriticalLayer meshfile streakfile outfile\n");
98  exit(1);
99  }
100 
101  //------------------------------------------------------------
102  // Create Session file by reading only first meshfile
103  //-----------------------------------------------------------
105  = LibUtilities::SessionReader::CreateInstance(2, argv);
107  SpatialDomains::MeshGraph::Read(vSession);
108 
109  //-------------------------------------------------------------
110  // Read in mesh from input file
111  //------------------------------------------------------------
112  TiXmlDocument& meshdoc = vSession->GetDocument();
113  TiXmlHandle docHandle(&meshdoc);
114  TiXmlElement* doc = docHandle.FirstChildElement("NEKTAR").FirstChildElement("GEOMETRY").Element();
115 
116  //------------------------------------------------------------
117  // Get list of vertices along interface
118  //------------------------------------------------------------
119  vector<int> InterfaceVerts;
120  GetInterfaceVerts(300,mesh,InterfaceVerts);
121 
122  //------------------------------------------------------------
123  // Determine location of new interface vertices
124  //------------------------------------------------------------
125  Array<OneD,NekDouble> xstreak(50),ystreak(50);
126  string fieldfile(argv[argc-2]);
127  GetStreakLocation(vSession,mesh,fieldfile,xstreak,ystreak);
128 
129  //------------------------------------------------------------
130  // Move internal mesh using critical layer info and under string analogy
131  //------------------------------------------------------------
132  Array<OneD,NekDouble> dvertx(mesh->GetNvertices(),0.0), dverty(mesh->GetNvertices(),0.0);
133  int maxiter;
134  vSession->LoadParameter("MoveMeshMaxIterations",maxiter,100);
135 
136  GetNewVertexLocation(doc, mesh,InterfaceVerts,xstreak,ystreak,dvertx,dverty,maxiter);
137 
138  //------------------------------------------------------------
139  // Enforce rotational symmetry on mesh
140  //------------------------------------------------------------
141  if(vSession->DefinesSolverInfo("EnforceRotationalSymmetry"))
142  {
143  EnforceRotationalSymmetry(mesh,dvertx,dverty);
144  }
145 
146  //------------------------------------------------------------
147  // Redfine vertices in doc
148  //------------------------------------------------------------
149  RedefineVertices(doc,dvertx,dverty);
150 
151  //------------------------------------------------------------
152  // Write out moved mesh file
153  //------------------------------------------------------------
154  std::string outfile(argv[argc-1]);
155  meshdoc.SaveFile(outfile);
156 }
157 
158 
159 void GetInterfaceVerts(const int compositeID, SpatialDomains::MeshGraphSharedPtr &mesh, vector<int> &InterfaceVerts)
160 {
162  composite = mesh->GetComposite(compositeID);
163  int compsize = composite->m_geomVec.size();
164  map<int,int> vertmap;
165 
166  for(int i = 0; i < compsize; ++i)
167  {
168  if(vertmap.count(composite->m_geomVec[i]->GetVid(0)) == 0)
169  {
170  InterfaceVerts.push_back(composite->m_geomVec[i]->GetVid(0));
171  vertmap[composite->m_geomVec[i]->GetVid(0)] = 1;
172  }
173 
174  if(vertmap.count(composite->m_geomVec[i]->GetVid(1)) == 0)
175  {
176  InterfaceVerts.push_back(composite->m_geomVec[i]->GetVid(1));
177  vertmap[composite->m_geomVec[i]->GetVid(1)] = 1;
178  }
179  }
180 }
181 
183  SpatialDomains::MeshGraphSharedPtr &mesh, string &fieldfile,
185 {
186  //-------------------------------------------------------------
187  // Define Streak Expansion
189 
191  ::AllocateSharedPtr(vSession,mesh);
192  //---------------------------------------------------------------
193 
194  //----------------------------------------------
195  // Import field file.
196  vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
197  vector<vector<NekDouble> > fielddata;
198  LibUtilities::Import(fieldfile,fielddef,fielddata);
199  //----------------------------------------------
200 
201  //----------------------------------------------
202  // Copy data from field file
203  string streak_field("w");
204  for(unsigned int i = 0; i < fielddata.size(); ++i)
205  {
206  streak->ExtractDataToCoeffs(fielddef [i],
207  fielddata[i],
208  streak_field,
209  streak->UpdateCoeffs());
210  }
211  //----------------------------------------------
212 
213  NekDouble cr = 0.0;
214 
215  cerr << "Extracting Critical Layer ";
216  Computestreakpositions(streak,xc, yc,cr);
217 }
218 
219 
220 void GetNewVertexLocation(TiXmlElement *doc,
222  vector<int> &InterfaceVerts,
223  Array<OneD, NekDouble> &xstreak,
224  Array<OneD, NekDouble> &ystreak,
225  Array<OneD,NekDouble> &dvertx,
226  Array<OneD,NekDouble> &dverty,
227  int maxiter)
228 {
229  int i,j,k;
230  int nverts = mesh->GetNvertices();
231 
232  SpatialDomains::SegGeomMap meshedges = mesh->GetAllSegGeoms();
233 
234  Array<OneD,MoveVerts> Verts(nverts);
235 
236  // loop mesh edges and fill in verts info
239 
240  int vid0,vid1;
241  NekDouble kspring;
242  NekDouble x,y,x1,y1,z1,x2,y2,z2;
243 
244  // Setup intiial spring and verts
245  for(auto &segIter : meshedges)
246  {
247  vid0 = (segIter.second)->GetVid(0);
248  vid1 = (segIter.second)->GetVid(1);
249 
250  v0 = (segIter.second)->GetVertex(0);
251  v1 = (segIter.second)->GetVertex(1);
252 
253  kspring = 1.0/v0->dist(*v1);
254 
255  Verts[vid0].kspring.push_back(kspring);
256  Verts[vid0].springVid.push_back(vid1);
257  Verts[vid1].kspring.push_back(kspring);
258  Verts[vid1].springVid.push_back(vid0);
259 
260  }
261 
262  // Scale spring by total around vertex and turn on all vertices.
263  for(i = 0; i < nverts; ++i)
264  {
265  NekDouble invktot = 0.0;
266  for(j = 0; j < Verts[i].kspring.size(); ++j)
267  {
268  invktot += Verts[i].kspring[j];
269  }
270  invktot = 1.0/invktot;
271  for(j = 0; j < Verts[i].kspring.size(); ++j)
272  {
273  Verts[i].kspring[j] *= invktot;
274  }
275 
276  Verts[i].solve = eSolveXY;
277  }
278 
279 
280  // Turn off all edges defined by composite lists of correct dimension
281  TurnOffEdges(doc,meshedges,Verts);
282 
283  NekDouble z,h0,h1,h2;
284  // Set interface vertices to lie on critical layer
285  for(i = 0; i < InterfaceVerts.size(); ++i)
286  {
287  Verts[InterfaceVerts[i]].solve = eNoSolve;
288  mesh->GetVertex(InterfaceVerts[i])->GetCoords(x,y,z);
289 
290  for(j = 0; j < xstreak.size()-1; ++j)
291  {
292  if((x >= xstreak[j])&&(x <= xstreak[j+1]))
293  {
294  break;
295  }
296  }
297 
298  ASSERTL0(j != xstreak.size(),"Did not find x location along critical layer");
299 
300  k = (j==0)?1: j; // offset index at beginning
301 
302  // quadraticalling interpolate points
303  h0 = (x-xstreak[k])*(x-xstreak[k+1])/
304  ((xstreak[k-1]-xstreak[k])*(xstreak[k-1]-xstreak[k+1]));
305  h1 = (x-xstreak[k-1])*(x-xstreak[k+1])/
306  ((xstreak[k]-xstreak[k-1])*(xstreak[k]-xstreak[k+1]));
307  h2 = (x-xstreak[k-1])*(x-xstreak[k])/
308  ((xstreak[k+1]-xstreak[k-1])*(xstreak[k+1]-xstreak[k]));
309 
310  dvertx[InterfaceVerts[i]] = (xstreak[k-1]*h0 + xstreak[k]*h1 + xstreak[k+1]*h2) - x;
311  dverty[InterfaceVerts[i]] = (ystreak[k-1]*h0 + ystreak[k]*h1 + ystreak[k+1]*h2) - y;
312  }
313 
314  // shift quads in critical layer to move more or less rigidly
315  SpatialDomains::QuadGeomMap quadgeom = mesh->GetAllQuadGeoms();
316  for(auto &quadIter : quadgeom)
317  {
318  for(i = 0; i < 4; ++i)
319  {
320  vid0 = (quadIter.second)->GetVid(i);
321 
322  switch(Verts[vid0].solve)
323  {
324  case eSolveXY:
325  {
326  mesh->GetVertex(vid0)->GetCoords(x,y,z);
327 
328  // find nearest interface vert
329  mesh->GetVertex(InterfaceVerts[0])->GetCoords(x1,y1,z1);
330  for(j = 0; j < InterfaceVerts.size()-1; ++j)
331  {
332  mesh->GetVertex(InterfaceVerts[j+1])->GetCoords(x2,y2,z2);
333  if((x >= x1)&&(x < x2))
334  {
335  break;
336  }
337  x1 = x2;
338  y1 = y2;
339  }
340 
341  // currently just shift vert as average of two sides
342  dvertx[vid0] = (x2-x)/(x2-x1)*dvertx[InterfaceVerts[j]]+
343  (x-x1)/(x2-x1)*dvertx[InterfaceVerts[j+1]];
344  dverty[vid0] = (x2-x)/(x2-x1)*dverty[InterfaceVerts[j]]+
345  (x-x1)/(x2-x1)*dverty[InterfaceVerts[j+1]];
346  }
347  break;
348  case eSolveY:
349  {
350  mesh->GetVertex(vid0)->GetCoords(x,y,z);
351  mesh->GetVertex(InterfaceVerts[0])->GetCoords(x1,y1,z1);
352 
353  if(fabs(x-x1) < 1e-6)
354  {
355  dverty[vid0] = dverty[InterfaceVerts[0]];
356  }
357  else
358  {
359  dverty[vid0] = dverty[InterfaceVerts[InterfaceVerts.size()-1]];
360  }
361  }
362  break;
363  default:
364  break;
365  }
366  Verts[vid0].solve = eNoSolve;
367  }
368  }
369 
370 
371 
372 
373 
374  // Iterate internal vertices
375  bool ContinueToIterate = true;
376  int cnt = 0;
377  int nsum = 0;
378  NekDouble dsum,dx,dy,sum,prev_sum = 0.0;
379  NekDouble tol = 1e-3,fac;
380  int blend = 50;
381 
382  while (ContinueToIterate)
383  {
384 
385  sum = 0.0;
386  nsum = 0;
387 
388  // use a ramping function to help move interior slowly
389  fac = (cnt < blend)? 1.0/(blend+1.0)*(cnt+1): 1.0;
390 
391  for(i = 0; i < nverts; ++i)
392  {
393  if(Verts[i].solve != eNoSolve)
394  {
395  dx = dy = 0.0;
396 
397  if((Verts[i].solve == eSolveX)||(Verts[i].solve == eSolveXY))
398  {
399  for(j = 0; j < Verts[i].kspring.size(); ++j)
400  {
401  dx += fac*Verts[i].kspring[j]*dvertx[Verts[i].springVid[j]];
402  }
403  }
404 
405  if((Verts[i].solve == eSolveY)||(Verts[i].solve == eSolveXY))
406  {
407  for(j = 0; j < Verts[i].kspring.size(); ++j)
408  {
409  dy += fac*Verts[i].kspring[j]*dverty[Verts[i].springVid[j]];
410  }
411  }
412 
413  dsum = (dx*dx + dy*dy);
414 
415  dvertx[i] = dx;
416  dverty[i] = dy;
417 
418  if(dsum > 1e-16)
419  {
420  //sum += dsum/(dvertx[i]*dvertx[i] + dverty[i]*dverty[i]);
421  sum += dsum;
422  nsum += 1;
423  }
424  }
425  }
426 
427  if(nsum)
428  {
429  sum = sqrt(sum/(NekDouble)nsum);
430 
431  NekDouble chg = sum-prev_sum;
432  prev_sum = sum;
433 
434  cerr << "Iteration " << cnt << " : " << chg << endl;
435 
436  if((chg < tol)&&(cnt > blend))
437  {
438  ContinueToIterate = false;
439  }
440 
441  }
442  else if(cnt > blend)
443  {
444  ContinueToIterate = false;
445 
446  }
447 
448  if(cnt++ > maxiter)
449  {
450  ContinueToIterate = false;
451  }
452  }
453 }
454 
455 
456 // Read Composites from xml document and turn off verts that are along edge composites.
457 void TurnOffEdges(TiXmlElement *doc,
458  SpatialDomains::SegGeomMap &meshedges,
459  Array<OneD,MoveVerts> &Verts)
460 {
461  TiXmlElement* field = doc->FirstChildElement("COMPOSITE");
462  ASSERTL0(field, "Unable to find COMPOSITE tag in file.");
463 
464  int nextCompositeNumber = -1;
465 
466  /// All elements are of the form: "<C ID = "N"> ... </C>".
467  /// Read the ID field first.
468  TiXmlElement *composite = field->FirstChildElement("C");
469 
470  while (composite)
471  {
472  nextCompositeNumber++;
473 
474  int indx;
475  int err = composite->QueryIntAttribute("ID", &indx);
476  ASSERTL0(err == TIXML_SUCCESS, "Unable to read attribute ID.");
477 
478  TiXmlNode* compositeChild = composite->FirstChild();
479  // This is primarily to skip comments that may be present.
480  // Comments appear as nodes just like elements.
481  // We are specifically looking for text in the body
482  // of the definition.
483  while(compositeChild && compositeChild->Type() != TiXmlNode::TINYXML_TEXT)
484  {
485  compositeChild = compositeChild->NextSibling();
486  }
487 
488  ASSERTL0(compositeChild, "Unable to read composite definition body.");
489  std::string compositeStr = compositeChild->ToText()->ValueStr();
490 
491  /// Parse out the element components corresponding to type of element.
492  std::istringstream compositeDataStrm(compositeStr.c_str());
493 
494  try
495  {
496  std::string compositeElementStr;
497  compositeDataStrm >> compositeElementStr;
498 
499  std::istringstream tokenStream(compositeElementStr);
500  char type;
501 
502  tokenStream >> type;
503 
504  // in what follows we are assuming there is only one block of data
505  std::string::size_type indxBeg = compositeElementStr.find_first_of('[') + 1;
506  std::string::size_type indxEnd = compositeElementStr.find_last_of(']') - 1;
507 
508  ASSERTL0(indxBeg <= indxEnd, (std::string("Error reading index definition:") + compositeElementStr).c_str());
509 
510  std::string indxStr = compositeElementStr.substr(indxBeg, indxEnd - indxBeg + 1);
511  std::vector<unsigned int> seqVector;
512 
513  bool err = ParseUtils::GenerateSeqVector(indxStr, seqVector);
514 
515  ASSERTL0(err, (std::string("Error reading composite elements: ") + indxStr).c_str());
516 
517  switch(type)
518  {
519  case 'E': // Turn off vertices along composite edges
520  {
521  int seqlen = seqVector.size();
522  NekDouble x0,y0,z0,x1,y1,z1;
523  int vid0,vid1;
524 
525  for(int i = 0; i < seqlen; ++i)
526  {
527  meshedges[seqVector[i]]->GetVertex(0)->GetCoords(x0,y0,z0);
528  meshedges[seqVector[i]]->GetVertex(1)->GetCoords(x1,y1,z1);
529  vid0 = meshedges[seqVector[i]]->GetVid(0);
530  vid1 = meshedges[seqVector[i]]->GetVid(1);
531 
532  if(fabs(x0-x1) < 1e-8)
533  {
534  //identify corners by double visit
535  if(Verts[vid0].solve == eSolveX)
536  {
537  Verts[vid0].solve = eNoSolve;
538  }
539  else
540  {
541  Verts[vid0].solve = eSolveY;
542  }
543 
544  if(Verts[vid1].solve == eSolveX)
545  {
546  Verts[vid1].solve = eNoSolve;
547  }
548  else
549  {
550  Verts[vid1].solve = eSolveY;
551  }
552  }
553 
554  if(fabs(y0-y1) < 1e-8)
555  {
556  //identify corners by double visit
557  if(Verts[vid0].solve == eSolveY)
558  {
559  Verts[vid0].solve = eNoSolve;
560  }
561  else
562  {
563  Verts[vid0].solve = eSolveX;
564  }
565 
566  if(Verts[vid1].solve == eSolveY)
567  {
568  Verts[vid1].solve = eNoSolve;
569  }
570  else
571  {
572  Verts[vid1].solve = eSolveX;
573  }
574  }
575  }
576 
577  }
578  break;
579 
580  case 'T': case 'Q': // do nothing
581  {
582  break;
583  }
584  default:
585  NEKERROR(ErrorUtil::efatal, (std::string("Unrecognized composite token: ") + compositeElementStr).c_str());
586  }
587 
588  }
589  catch(...)
590  {
591  NEKERROR(ErrorUtil::efatal,
592  (std::string("Unable to read COMPOSITE data for composite: ") + compositeStr).c_str());
593  }
594 
595  /// Keep looking
596  composite = composite->NextSiblingElement("C");
597  }
598 }
599 
600 void RedefineVertices(TiXmlElement *doc,
601  Array<OneD,NekDouble> &dvertx,
602  Array<OneD,NekDouble> &dverty)
603 {
604 
605 
606  TiXmlElement* element = doc->FirstChildElement("VERTEX");
607  ASSERTL0(element, "Unable to find mesh VERTEX tag in file.");
608 
609  TiXmlElement *vertex = element->FirstChildElement("V");
610 
611  int indx;
612  int nextVertexNumber = -1;
613  int err; /// Error value returned by TinyXML.
614 
615  vector<NekDouble> xpts,ypts,zpts;
616  NekDouble xval, yval, zval;
617 
618  while (vertex)
619  {
620  nextVertexNumber++;
621 
622  TiXmlAttribute *vertexAttr = vertex->FirstAttribute();
623  std::string attrName(vertexAttr->Name());
624 
625  ASSERTL0(attrName == "ID", (std::string("Unknown attribute name: ") + attrName).c_str());
626 
627  err = vertexAttr->QueryIntValue(&indx);
628  ASSERTL0(err == TIXML_SUCCESS, "Unable to read attribute ID.");
629 
630  // Now read body of vertex
631  std::string vertexBodyStr;
632 
633  TiXmlNode *vertexBody = vertex->FirstChild();
634 
635  while (vertexBody)
636  {
637  // Accumulate all non-comment body data.
638  if (vertexBody->Type() == TiXmlNode::TINYXML_TEXT)
639  {
640  vertexBodyStr += vertexBody->ToText()->Value();
641  vertexBodyStr += " ";
642  }
643 
644  vertexBody = vertexBody->NextSibling();
645  }
646 
647  ASSERTL0(!vertexBodyStr.empty(), "Vertex definitions must contain vertex data.");
648 
649  // Get vertex data from the data string.
650  std::istringstream vertexDataStrm(vertexBodyStr.c_str());
651 
652  try
653  {
654  while(!vertexDataStrm.fail())
655  {
656  vertexDataStrm >> xval >> yval >> zval;
657  }
658 
659  xval += dvertx[indx];
660  yval += dverty[indx];
661 
662  stringstream s;
663  s << scientific << setprecision(8)
664  << xval << " " << yval << " " << zval;
665 
666  vertex->ReplaceChild(vertex->FirstChild(), TiXmlText(s.str()));
667  }
668  catch(...)
669  {
670  ASSERTL0(false, "Unable to read VERTEX data.");
671  }
672  vertex = vertex->NextSiblingElement("V");
673  }
674 
675 }
676 
678  Array<OneD, NekDouble> &dvertx,
679  Array<OneD, NekDouble> &dverty)
680 {
681  int i,j;
682  int nverts = mesh->GetNvertices();
683  Array<OneD, NekDouble> x(nverts),y(nverts);
684  NekDouble xval,yval,zval;
685 
686  for(i = 0; i < nverts; ++i)
687  {
688  mesh->GetVertex(i)->GetCoords(xval,yval,zval);
689  x[i] = xval + dvertx[i];
690  y[i] = yval + dverty[i];
691  }
692 
693  NekDouble xmax = Vmath::Vmax(nverts,x,1);
694  NekDouble tol = 1e-5, dist2,xrot,yrot;
695  Array<OneD,int> index(nverts);
696  // find nearest
697  for(i = 0; i < nverts; ++i)
698  {
699  xrot = -x[i] + xmax;
700  yrot = -y[i];
701  tol = 1.0;
702 
703  for(j = 0; j < nverts; ++j)
704  {
705  dist2 = (x[j]-xrot)*(x[j]-xrot) + (y[j]-yrot)*(y[j]-yrot);
706  if(dist2 < tol)
707  {
708  index[i] = j;
709  tol = dist2;
710  }
711  }
712  }
713 
714  //average points and recalcualte dvertx, dverty
715  for(i = 0; i < nverts; ++i)
716  {
717  mesh->GetVertex(i)->GetCoords(xval,yval,zval);
718 
719  xrot = 0.5*(-x[index[i]] + xmax + x[i]);
720  yrot = 0.5*(-y[index[i]] + y[i]);
721 
722  dvertx[i] = xrot - xval;
723  dverty[i] = yrot - yval;
724  }
725 }
#define ASSERTL0(condition, msg)
Definition: ErrorUtil.hpp:216
#define NEKERROR(type, msg)
Assert Level 0 – Fundamental assert which is used whether in FULLDEBUG, DEBUG or OPT compilation mode...
Definition: ErrorUtil.hpp:209
void Computestreakpositions(MultiRegions::ExpListSharedPtr &streak, Array< OneD, NekDouble > &xc, Array< OneD, NekDouble > &yc, NekDouble cr, NekDouble trans)
int main(int argc, char *argv[])
void GetNewVertexLocation(TiXmlElement *doc, SpatialDomains::MeshGraphSharedPtr &mesh, vector< int > &InterfaceVerts, Array< OneD, NekDouble > &xstreak, Array< OneD, NekDouble > &ystreak, Array< OneD, NekDouble > &vertx, Array< OneD, NekDouble > &verty, int maxiter)
void TurnOffEdges(TiXmlElement *doc, SpatialDomains::SegGeomMap &meshedges, Array< OneD, MoveVerts > &verts)
void EnforceRotationalSymmetry(SpatialDomains::MeshGraphSharedPtr &mesh, Array< OneD, NekDouble > &dvertx, Array< OneD, NekDouble > &dverty)
void RedefineVertices(TiXmlElement *doc, Array< OneD, NekDouble > &dvertx, Array< OneD, NekDouble > &dverty)
void GetInterfaceVerts(const int compositeID, SpatialDomains::MeshGraphSharedPtr &mesh, vector< int > &InterfaceVerts)
void GetStreakLocation(LibUtilities::SessionReaderSharedPtr &vSession, SpatialDomains::MeshGraphSharedPtr &mesh, string &fieldfile, Array< OneD, NekDouble > &xc, Array< OneD, NekDouble > &yc)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
NekDouble dist(PointGeom &a)
return distance between this and input a
Definition: PointGeom.cpp:181
void Import(const std::string &infilename, std::vector< FieldDefinitionsSharedPtr > &fielddefs, std::vector< std::vector< NekDouble > > &fielddata, FieldMetaDataMap &fieldinfomap, const Array< OneD, int > &ElementIDs)
This function allows for data to be imported from an FLD file when a session and/or communicator is n...
Definition: FieldIO.cpp:293
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::map< int, QuadGeomSharedPtr > QuadGeomMap
Definition: QuadGeom.h:54
std::map< int, SegGeomSharedPtr > SegGeomMap
Definition: SegGeom.h:52
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
Definition: MeshGraph.h:174
std::shared_ptr< PointGeom > PointGeomSharedPtr
Definition: Geometry.h:59
std::shared_ptr< Composite > CompositeSharedPtr
Definition: MeshGraph.h:137
The above copyright notice and this permission notice shall be included.
Definition: CoupledSolver.h:1
double NekDouble
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
Definition: Vmath.cpp:892
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:267
vector< int > springVid
vector< NekDouble > kspring