176{
178
179 cr = 0;
180
181 if (argc > 6 || argc < 5)
182 {
183 fprintf(stderr, "Usage: ./MoveMesh meshfile fieldfile changefile "
184 "alpha cr(optional)\n");
185 exit(1);
186 }
187
188
189
191 LibUtilities::SessionReader::CreateInstance(2, argv);
193 SpatialDomains::MeshGraph::Read(vSession);
194
195
196 if (argc == 6 && vSession->DefinesSolverInfo("INTERFACE") &&
197 vSession->GetSolverInfo("INTERFACE") == "phase")
198 {
199 cr = boost::lexical_cast<NekDouble>(argv[argc - 1]);
200 argc = 5;
201 }
202
203
205 boundaryConditions =
207 vSession, graphShPt);
209
210
211
212
213
214
215
216
217 string changefile(argv[argc - 2]);
218
219
220
221 string charalp(argv[argc - 1]);
222
223 cout << "read alpha=" << charalp << endl;
224
225
226
227 string fieldfile(argv[argc - 3]);
228 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
229 vector<vector<NekDouble>> fielddata;
230
231
234 vSession, graphShPt, "w", true);
235
237
238 for (int i = 0; i < fielddata.size(); i++)
239 {
240 streak->ExtractDataToCoeffs(fielddef[i], fielddata[i],
241 fielddef[i]->m_fields[0],
242 streak->UpdateCoeffs());
243 }
244 streak->BwdTrans(streak->GetCoeffs(), streak->UpdatePhys());
245
246
247
248
249
250 int nIregions, lastIregion = 0;
252 streak->GetBndConditions();
254
255 nIregions = 0;
256 int nbnd = bndConditions.size();
257 for (int r = 0; r < nbnd; r++)
258 {
259 if (bndConditions[r]->GetUserDefined() == "CalcBC")
260 {
261 lastIregion = r;
262 Iregions[r] = r;
263 nIregions++;
264 }
265 }
266
268 "there is any boundary region with the tag USERDEFINEDTYPE="
269 "CalcBC"
270 " specified");
271 cout << "nIregions=" << nIregions << endl;
272
274 streak->GetBndCondExpansions();
275
276
277 int nedges = bndfieldx[lastIregion]->GetExpSize();
278 int nvertl = nedges + 1;
283
284
287 int lastedge = -1;
288 int v1, v2;
289
290 x_connect = 0;
292 ((bndfieldx[lastIregion]->GetExp(0)->as<LocalRegions::SegExp>())
293 ->GetGeom1D())
294 ->GetVid(0));
295 vertex0->GetCoords(x0, y0, z0);
296 if (x0 != 0.0)
297 {
298 cout << "WARNING x0=" << x0 << endl;
299 x_connect = x0;
300 }
301 v1 = 0;
302 v2 = 1;
303 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 1], Vids_low, v1,
304 v2, x_connect, lastedge, xold_low, yold_low);
305 ASSERTL0(Vids_low[v2] != -10,
"Vids_low[v2] is wrong");
307 graphShPt->GetVertex(Vids_low[v2]);
308
309
310 cout << "x_conn=" << x_connect << " yt=" << yt << " zt=" << zt
311 << " vid=" << Vids_low[v2] << endl;
312 vertex->GetCoords(x_connect, yt, zt);
313
314 int i = 2;
315 while (i < nvertl)
316 {
317 v1 = i;
318 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 1], Vids_low,
319 v1, v2, x_connect, lastedge, xold_low, yold_low);
321 graphShPt->GetVertex(Vids_low[v1]);
322
323 vertex->GetCoords(x_connect, yt, zt);
324 i++;
325 }
326
327
328
329
333
334 x_connect = 0;
335 vertex0 = graphShPt->GetVertex(
336 ((bndfieldx[lastIregion]->GetExp(0)->as<LocalRegions::SegExp>())
337 ->GetGeom1D())
338 ->GetVid(0));
339 vertex0->GetCoords(x0, y0, z0);
340 if (x0 != 0.0)
341 {
342 cout << "WARNING x0=" << x0 << endl;
343 x_connect = x0;
344 }
345 lastedge = -1;
346
347 v1 = 0;
348 v2 = 1;
349 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 2], Vids_up, v1,
350 v2, x_connect, lastedge, xold_up, yold_up);
352 graphShPt->GetVertex(Vids_up[v2]);
353 vertexU->GetCoords(x_connect, yt, zt);
354
355 i = 2;
356 while (i < nvertl)
357 {
358 v1 = i;
359 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 2], Vids_up,
360 v1, v2, x_connect, lastedge, xold_up, yold_up);
362 graphShPt->GetVertex(Vids_up[v1]);
363
364
365 vertex->GetCoords(x_connect, yt, zt);
366 i++;
367 }
368
369
370
371
375
376 x_connect = 0;
377 vertex0 = graphShPt->GetVertex(
378 ((bndfieldx[lastIregion]->GetExp(0)->as<LocalRegions::SegExp>())
379 ->GetGeom1D())
380 ->GetVid(0));
381 vertex0->GetCoords(x0, y0, z0);
382 if (x0 != 0.0)
383 {
384 cout << "WARNING x0=" << x0 << endl;
385 x_connect = x0;
386 }
387 lastedge = -1;
388
389 v1 = 0;
390 v2 = 1;
391
392 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion], Vids_c, v1, v2,
393 x_connect, lastedge, xold_c, yold_c);
395 graphShPt->GetVertex(Vids_c[v2]);
396
397
398 vertexc->GetCoords(x_connect, yt, zt);
399
400 i = 2;
401 while (i < nvertl)
402 {
403 v1 = i;
404 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion], Vids_c, v1, v2,
405 x_connect, lastedge, xold_c, yold_c);
407 graphShPt->GetVertex(Vids_c[v1]);
408
409
410 vertex->GetCoords(x_connect, yt, zt);
411 i++;
412 }
413
414
415
418
419 for (int r = 0; r < nvertl; r++)
420 {
421
422
423
424 Deltaup[r] = yold_up[r] - yold_c[r];
425 Deltalow[r] = yold_c[r] - yold_low[r];
427 "distance between upper and layer curve is not positive");
429 "distance between lower and layer curve is not positive");
430 }
431
432
433
435 bcs.GetBoundaryRegions();
438
440 vSession, *(bregions.find(lastIregion)->second), graphShPt, true);
442 *yexp);
443
444
445
446
447
448
449
450 int npedge;
451 if (vSession->DefinesParameter("npedge"))
452 {
453 npedge = (int)vSession->GetParameter("npedge");
454 }
455 else
456 {
457 npedge = 5;
458 }
459
460
461
462 int nq = streak->GetTotPoints();
465 streak->GetCoords(x, y);
471
473 xold_c, yold_c, x_c, y_c, cr, true);
474
476 for (
int q = 0;
q < nvertl;
q++)
477 {
478 if (y_c[
q] < yold_c[
q])
479 {
481 }
482
483 Delta_c[
q] =
abs(yold_c[
q] - y_c[
q]);
484
486 cout << x_c[
q] <<
" " << y_c[
q] << endl;
487 }
488
489 if (shift < 0.001)
490 {
491 cout << "Warning: the critical layer is stationary" << endl;
492 }
493
494
495
501
504
506
507 int Eid, id1, id2;
512 for (int r = 0; r < nedges; r++)
513 {
514
515 bndSegExp =
517 Eid = (bndSegExp->GetGeom1D())->GetGlobalID();
518 id1 = (bndSegExp->GetGeom1D())->GetVid(0);
519 id2 = (bndSegExp->GetGeom1D())->GetVid(1);
520 vertex1 = graphShPt->GetVertex(id1);
521 vertex2 = graphShPt->GetVertex(id2);
523 vertex2->GetCoords(x2, y2, z2);
524
525
526 cout << "edge=" << r << " x1=" << x1 << " y1=" << y1 << " x2=" << x2
527 << " y2=" << y2 << endl;
528 if (x2 > x1)
529 {
530 Cpointsx[r] = x1 + (x2 - x1) / 2;
531
532
533
534 if (Cpointsx[r] > x2 || Cpointsx[r] < x1)
535 {
536 Cpointsx[r] = -Cpointsx[r];
537 }
538 for (
int w = 0;
w < npedge - 2;
w++)
539 {
540
541 Addpointsx[r * (npedge - 2) +
w] =
542 x1 + ((x2 - x1) / (npedge - 1)) * (
w + 1);
543 if (Addpointsx[r * (npedge - 2) +
w] > x2 ||
544 Addpointsx[r * (npedge - 2) +
w] < x1)
545 {
546 Addpointsx[r * (npedge - 2) +
w] =
547 -Addpointsx[r * (npedge - 2) +
w];
548 }
549
550 Addpointsy[r * (npedge - 2) +
w] =
551 y_c[r] + ((y_c[r + 1] - y_c[r]) / (x_c[r + 1] - x_c[r])) *
552 (Addpointsx[r * (npedge - 2) +
w] - x1);
553
554
556 Addpointsy[r * (npedge - 2) +
w],
557 Addpointsx[r * (npedge - 2) +
w],
558 Addpointsy[r * (npedge - 2) +
w],
559 streak, dU, cr);
560
561
562
563
564 }
565
566
567
568
569 }
570 else if (x1 > x2)
571 {
572 Cpointsx[r] = x2 + (x1 - x2) / 2;
573
574 if (Cpointsx[r] > x1 || Cpointsx[r] < x2)
575 {
576 Cpointsx[r] = -Cpointsx[r];
577 }
578 for (
int w = 0;
w < npedge - 2;
w++)
579 {
580 Addpointsx[r * (npedge - 2) +
w] =
581 x2 + ((x1 - x2) / (npedge - 1)) * (
w + 1);
582 if (Addpointsx[r * (npedge - 2) +
w] > x1 ||
583 Addpointsx[r * (npedge - 2) +
w] < x2)
584 {
585 Addpointsx[r * (npedge - 2) +
w] =
586 -Addpointsx[r * (npedge - 2) +
w];
587 }
588
589
590 Addpointsy[r * (npedge - 2) +
w] =
591 y_c[r + 1] +
592 ((y_c[r] - y_c[r + 1]) / (x_c[r] - x_c[r + 1])) *
593 (Addpointsx[r * (npedge - 2) +
w] - x2);
594
595
596
598 Addpointsy[r * (npedge - 2) +
w],
599 Addpointsx[r * (npedge - 2) +
w],
600 Addpointsy[r * (npedge - 2) +
w],
601 streak, dU, cr);
602
603
604
605 }
606
607
608
609
610 }
611 else
612 {
613 ASSERTL0(
false,
"point not generated");
614 }
615
616
617
618
619
620
621
622
623 Eids[r] = Eid;
624 }
625
626
627
630
631 for (int a = 0; a < nedges; a++)
632 {
633
634 xcPhys[a * npedge + 0] = x_c[a];
635 ycPhys[a * npedge + 0] = y_c[a];
636
637 xcPhys[a * npedge + npedge - 1] = x_c[a + 1];
638 ycPhys[a * npedge + npedge - 1] = y_c[a + 1];
639
640 for (int b = 0; b < npedge - 2; b++)
641 {
642 xcPhys[a * npedge + b + 1] = Addpointsx[a * (npedge - 2) + b];
643 ycPhys[a * npedge + b + 1] = Addpointsy[a * (npedge - 2) + b];
644 }
645 }
646
647 cout << "xc,yc before tanevaluate" << endl;
648 for (int v = 0; v < xcPhys.size(); v++)
649 {
650 cout << xcPhys[v] << " " << ycPhys[v] << endl;
651 }
652
653
654
655
658
662 int nlays = 0;
663 MappingEVids(xold_up, yold_up, xold_low, yold_low, xold_c, yold_c, Vids_c,
664 graphShPt, streak, V1, V2, nlays, lay_Eids, lay_Vids);
665
666 cout << "nlays=" << nlays << endl;
669
670 for (int g = 0; g < nlays; g++)
671 {
673 }
674
675
676
677
678
679
681 if (vSession->DefinesParameter("Delta"))
682 {
683 Delta0 = vSession->GetParameter("Delta");
684 }
685 else
686 {
687 Delta0 = 0.1;
688 }
689
690
691
692
693
694
695 int nVertTot = graphShPt->GetNvertices();
696
699
704 int cntup = 0;
705 int cntlow = 0;
706
711 for (int i = 0; i < nVertTot; i++)
712 {
713 bool mvpoint = false;
716 vertex->GetCoords(x, y,
z);
717
718 xold[i] = x;
719 yold[i] = y;
720
721
722 xnew[i] = x;
723
724
725 if (x == 0 && y < yold_low[0] && y > bleft)
726 {
727 bleft = y;
728 }
729
730 if (x == xold_c[nvertl - 1] && y > yold_up[nvertl - 1] && y < tright)
731 {
732 tright = y;
733 }
734
735 if (x == xold_c[nvertl - 1] && y < yold_low[nvertl - 1] && y > bright)
736 {
737 bright = y;
738 }
739
740 if (x == 0 && y > yold_up[0] && y < tleft)
741 {
742 tleft = y;
743 }
744
745 for (int j = 0; j < nvertl; j++)
746 {
747 if ((xold_up[j] == x) && (yold_up[j] == y))
748 {
749
750
751 ynew[i] = y_c[j] + Delta0;
752 mvpoint = true;
753 Up[j] = i;
754 }
755 if ((xold_low[j] == x) && (yold_low[j] == y))
756 {
757
758
759 ynew[i] = y_c[j] - Delta0;
760 mvpoint = true;
761 Down[j] = i;
762 }
763 if ((xold_c[j] == x) && (yold_c[j] == y))
764 {
765 ynew[i] = y_c[j];
766 mvpoint = true;
767 }
768 }
769 if (mvpoint == false)
770 {
771
773 int qp_closer = 0;
774 for (int k = 0; k < nvertl; k++)
775 {
776 if (
abs(x - xold_up[k]) < diff)
777 {
778 diff =
abs(x - xold_up[k]);
779 qp_closer = k;
780 }
781 }
782 if (y > yold_up[qp_closer] && y < 1)
783 {
784
785
786
787
788
789
790
791
792 ynew[i] = y_c[qp_closer] + (y - yold_c[qp_closer]) *
793 (1 - y_c[qp_closer]) /
794 (1 - yold_c[qp_closer]);
795
796 }
797 else if (y < yold_low[qp_closer] && y > -1)
798 {
799
800
801
802
803
804
805
806
807 ynew[i] = y_c[qp_closer] + (y - yold_c[qp_closer]) *
808 (-1 - y_c[qp_closer]) /
809 (-1 - yold_c[qp_closer]);
810 }
811
812 else if (y > yold_c[qp_closer] && y < yold_up[qp_closer])
813 {
814 if (x == 0)
815 {
816 cntup++;
817 }
818
819
820
821 }
822 else if (y < yold_c[qp_closer] && y > yold_low[qp_closer])
823 {
824 if (x == 0)
825 {
826 cntlow++;
827 }
828
829
830
831 }
832 else if (y == 1 || y == -1)
833 {
834 ynew[i] = y;
835
836
837 }
838
839
840 if ((ynew[i] > 1 || ynew[i] < -1) &&
841 (y > yold_up[qp_closer] || y < yold_low[qp_closer]))
842 {
843 cout << "point x=" << xnew[i] << " y=" << y
844 << " closer x=" << xold_up[qp_closer]
845 << " ynew=" << ynew[i] << endl;
846 ASSERTL0(
false,
"shifting out of range");
847 }
848 }
849 }
850
851 int nqedge = streak->GetExp(0)->GetNumPoints(0);
852 int nquad_lay = (nvertl - 1) * nqedge;
854
855 bool curv_lay = true;
856 bool move_norm = true;
857 int np_lay = (nvertl - 1) * npedge;
858
866
867 if (move_norm == true)
868 {
869
870
873
876
878
879 cout << "nquad per edge=" << nqedge << endl;
880 for (int l = 0; l < 2; l++)
881 {
882 Edge_newcoords[l] = bndfieldx[lastIregion]
883 ->GetExp(0)
885 }
893
900
903
905
906 bndfieldx[lastIregion]->GetCoords(xcQ, ycQ, zcQ);
907
908
915 for (int l = 0; l < xcQ.size(); l++)
916 {
920
921
923
925 }
926
927
928
929 Vmath::Vcopy(nquad_lay, ycQ, 1, Cont_y->UpdatePhys(), 1);
931
932 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffsy);
933 Cont_y->BwdTrans(coeffsy, Cont_y->UpdatePhys());
935
936 cout << "xcQ, ycQ" << endl;
937 for (int s = 0; s < xcQ.size(); s++)
938 {
939 cout << xcQ[s] << " " << ycQ[s] << endl;
940 }
941
942 bool evaluatetan = false;
945 int wrong = 0;
946 for (int k = 0; k < nedges; k++)
947 {
948 Vmath::Vcopy(nqedge, &xcQ[k * nqedge], 1, &xcedgeQ[0], 1);
949 Vmath::Vcopy(nqedge, &ycQ[k * nqedge], 1, &ycedgeQ[0], 1);
950
951 Edge_newcoords[0]->StdPhysDeriv(xcedgeQ, txedgeQ);
952 Edge_newcoords[1]->StdPhysDeriv(ycedgeQ, tyedgeQ);
953
954 Vmath::Vmul(nqedge, txedgeQ, 1, txedgeQ, 1, normsQ, 1);
955
956 Vmath::Vvtvp(nqedge, tyedgeQ, 1, tyedgeQ, 1, normsQ, 1, normsQ, 1);
957
960
961 Vmath::Vmul(nqedge, txedgeQ, 1, normsQ, 1, txedgeQ, 1);
962 Vmath::Vmul(nqedge, tyedgeQ, 1, normsQ, 1, tyedgeQ, 1);
963
964
965
966 evaluatetan = false;
967 for (int u = 0; u < nqedge - 1; u++)
968 {
969 incratio = (ycedgeQ[u + 1] - ycedgeQ[u]) /
970 (xcedgeQ[u + 1] - xcedgeQ[u]);
971 cout << "incratio=" << incratio << endl;
972 if (
abs(incratio) > 4.0 && evaluatetan ==
false)
973 {
974 cout << "wrong=" << wrong << endl;
975 evaluatetan = true;
976 ASSERTL0(wrong < 2,
"number edges to change is too high!!");
977 edgeinterp[wrong] = k;
978 wrong++;
979 }
980 }
981
982 if (evaluatetan)
983 {
984 cout << "tan bef" << endl;
985 for (int e = 0; e < nqedge; e++)
986 {
987 cout << xcedgeQ[e] << " " << ycedgeQ[e] << " "
988 << txedgeQ[e] << endl;
989 }
990
991
992 int polyorder = 3;
996 Vmath::Vcopy(npedge, &xcPhysMOD[k * npedge + 0], 1, &xPedges[0],
997 1);
998 Vmath::Vcopy(npedge, &ycPhysMOD[k * npedge + 0], 1, &yPedges[0],
999 1);
1000
1001 PolyFit(polyorder, nqedge, xcedgeQ, ycedgeQ, coeffsinterp,
1002 xPedges, yPedges, npedge);
1003
1004 Vmath::Vcopy(npedge, &xPedges[0], 1, &xcPhysMOD[k * npedge + 0],
1005 1);
1006 Vmath::Vcopy(npedge, &yPedges[0], 1, &ycPhysMOD[k * npedge + 0],
1007 1);
1008
1010 tyedgeQ);
1011 }
1012
1013 Vmath::Vcopy(nqedge, &(txedgeQ[0]), 1, &(txQ[nqedge * k]), 1);
1014 Vmath::Vcopy(nqedge, &(tyedgeQ[0]), 1, &(tyQ[nqedge * k]), 1);
1015 }
1016
1019 for (
int w = 0;
w < fz.size();
w++)
1020 {
1021 txQ[
w] = cos(atan(fz[
w]));
1022 tyQ[
w] = sin(atan(fz[
w]));
1023 cout << xcQ[
w] <<
" " << ycQ[
w] <<
" " << fz[
w] << endl;
1024 }
1025
1026
1027
1028 Vmath::Vcopy(nquad_lay, txQ, 1, Cont_y->UpdatePhys(), 1);
1029 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffsy);
1030 Cont_y->BwdTrans(coeffsy, Cont_y->UpdatePhys());
1032
1033 Vmath::Vcopy(nquad_lay, tyQ, 1, Cont_y->UpdatePhys(), 1);
1034 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffsy);
1035 Cont_y->BwdTrans(coeffsy, Cont_y->UpdatePhys());
1037
1038
1040
1041
1042
1043
1044 int edgebef;
1045
1046 for (
int q = 0;
q < 2;
q++)
1047 {
1048 edgebef = edgeinterp[
q] - 1;
1049 incbefore =
1050 (txQ[edgebef * nqedge + nqedge - 1] - txQ[edgebef * nqedge]) /
1051 (xcQ[edgebef * nqedge + nqedge - 1] - xcQ[edgebef * nqedge]);
1052 inc = (txQ[edgeinterp[
q] * nqedge + nqedge - 1] -
1053 txQ[edgeinterp[
q] * nqedge]) /
1054 (xcQ[edgeinterp[
q] * nqedge + nqedge - 1] -
1055 xcQ[edgeinterp[
q] * nqedge]);
1056 int npoints = 2 * nqedge;
1057
1062 cout << "inc=" << inc << " incbef=" << incbefore << endl;
1063 if ((inc / incbefore) > 0.)
1064 {
1065 cout << "before!!" << edgebef << endl;
1066 int polyorder = 2;
1069 &xQedges[0], 1);
1071 &yQedges[0], 1);
1073 &txQedges[0], 1);
1075 &tyQedges[0], 1);
1076
1077 PolyFit(polyorder, npoints, xQedges, txQedges, coeffsinterp,
1078 xQedges, txQedges, npoints);
1079
1080
1082 &txQ[edgebef * nqedge + 0], 1);
1083
1084 PolyFit(polyorder, npoints, xQedges, tyQedges, coeffsinterp,
1085 xQedges, tyQedges, npoints);
1086
1087
1089 &tyQ[edgebef * nqedge + 0], 1);
1090 }
1091 else
1092 {
1093 cout << "after!!" << endl;
1094 int polyorder = 2;
1097 &xQedges[0], 1);
1099 &yQedges[0], 1);
1101 &txQedges[0], 1);
1103 &tyQedges[0], 1);
1104
1105 PolyFit(polyorder, npoints, xQedges, txQedges, coeffsinterp,
1106 xQedges, txQedges, npoints);
1107
1108
1110 &txQ[edgeinterp[
q] * nqedge + 0], 1);
1111
1112 PolyFit(polyorder, npoints, xQedges, tyQedges, coeffsinterp,
1113 xQedges, tyQedges, npoints);
1114
1115
1117 &tyQ[edgeinterp[
q] * nqedge + 0], 1);
1118 }
1119 }
1120
1121
1122 Vmath::Vcopy(nquad_lay, tyQ, 1, Cont_y->UpdatePhys(), 1);
1123 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1124 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1126
1127 Vmath::Vcopy(nquad_lay, txQ, 1, Cont_y->UpdatePhys(), 1);
1128 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1129 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1131
1132 for (int k = 0; k < nedges; k++)
1133 {
1134
1135
1136
1137
1138
1139 Vmath::Vcopy(nqedge, &(txQ[nqedge * k]), 1, &(txedgeQ[0]), 1);
1140 Vmath::Vcopy(nqedge, &(tyQ[nqedge * k]), 1, &(tyedgeQ[0]), 1);
1141
1142 Vmath::Vdiv(nqedge, txedgeQ, 1, tyedgeQ, 1, tx_tyedgeQ, 1);
1143 Vmath::Vmul(nqedge, tx_tyedgeQ, 1, tx_tyedgeQ, 1, tx_tyedgeQ, 1);
1144 Vmath::Sadd(nqedge, 1.0, tx_tyedgeQ, 1, nxedgeQ, 1);
1147
1148 Vmath::Smul(nqedge, -1.0, nxedgeQ, 1, nxedgeQ, 1);
1149 Vmath::Vcopy(nqedge, &(nxedgeQ[0]), 1, &(nxQ[nqedge * k]), 1);
1150
1151 Vmath::Vmul(nqedge, nxedgeQ, 1, nxedgeQ, 1, nyedgeQ, 1);
1152 Vmath::Smul(nqedge, -1.0, nyedgeQ, 1, nyedgeQ, 1);
1155
1156 Vmath::Smul(nqedge, -1.0, nyedgeQ, 1, nyedgeQ, 1);
1157 Vmath::Vcopy(nqedge, &(nyedgeQ[0]), 1, &(nyQ[nqedge * k]), 1);
1158
1159 cout << "edge:" << k << endl;
1160 cout << "tan/normal" << endl;
1161 for (int r = 0; r < nqedge; r++)
1162 {
1163 cout << xcQ[k * nqedge + r] << " " << txedgeQ[r] << " "
1164 << tyedgeQ[r] << " " << nxedgeQ[r] << " "
1165 << nyedgeQ[r] << endl;
1166 }
1167 }
1168
1169
1170
1171 Vmath::Vcopy(nquad_lay, nyQ, 1, Cont_y->UpdatePhys(), 1);
1172
1173 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1174 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1176
1178 Vmath::Zero(Cont_y->GetNcoeffs(), Cont_y->UpdateCoeffs(), 1);
1179 Vmath::Vcopy(nquad_lay, nxQ, 1, Cont_y->UpdatePhys(), 1);
1180 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1181 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1183
1184
1185 for (int k = 0; k < nedges; k++)
1186 {
1187 if (k > 0)
1188 {
1189
1190
1191 nyQ[(k - 1) * nqedge + nqedge - 1] = nyQ[k * nqedge + 0];
1192
1193
1194
1195 nxQ[(k - 1) * nqedge + nqedge - 1] = nxQ[k * nqedge + 0];
1196 }
1197 }
1198
1200
1202
1203 cout << "nx,yQbefore" << endl;
1204 for (int u = 0; u < xcQ.size(); u++)
1205 {
1206 cout << xcQ[u] << " " << nyQ[u] << " " << txQ[u] << endl;
1207 }
1208
1210
1212 cout << "nx,yQ" << endl;
1213 for (int u = 0; u < x_tmpQ.size(); u++)
1214 {
1215 cout << x_tmpQ[u] << " " << tmpnyQ[u] << endl;
1216 }
1217
1218
1219 for (int k = 0; k < nedges; k++)
1220 {
1221
1222 for (int a = 0; a < npedge; a++)
1223 {
1224 if (a == 0)
1225 {
1226 nxPhys[k * npedge + a] = nxQ[k * nqedge + 0];
1227 nyPhys[k * npedge + a] = nyQ[k * nqedge + 0];
1228 }
1229 else if (a == npedge - 1)
1230 {
1231 nxPhys[k * npedge + a] = nxQ[k * nqedge + nqedge - 1];
1232 nyPhys[k * npedge + a] = nyQ[k * nqedge + nqedge - 1];
1233
1234 }
1235 else
1236 {
1237
1238
1239
1240
1241
1242
1243 int index;
1244
1245
1247 Addpointsx[k * (npedge - 2) + a - 1], x_tmpQ);
1248
1251
1252
1254 Pyinterp);
1255
1257 Addpointsx[k * (npedge - 2) + a - 1], 4, Pxinterp,
1258 Pyinterp);
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268 nxPhys[k * npedge + a] = -
sqrt(
abs(
1269 1 - nyPhys[k * npedge + a] * nyPhys[k * npedge + a]));
1270
1271
1272
1273
1274
1275
1276
1277 }
1278
1279
1280 if (k > 0)
1281 {
1282
1283
1284 nyPhys[(k - 1) * npedge + npedge - 1] =
1285 nyPhys[k * npedge + 0];
1286
1287
1288
1289 nxPhys[(k - 1) * npedge + npedge - 1] =
1290 nxPhys[k * npedge + 0];
1291 }
1292 }
1293 }
1294 cout << "xcPhys,," << endl;
1295 for (int s = 0; s < np_lay; s++)
1296 {
1297
1298 cout << xcPhysMOD[s] << " " << ycPhysMOD[s] << " "
1299 << nxPhys[s] << " " << nyPhys[s] << endl;
1300 }
1301
1302
1303
1304
1305
1306
1307
1311 for (int m = 0; m < nlays; m++)
1312 {
1313
1314
1315
1316 if (m < cntlow + 1)
1317 {
1318 delta[m] = -(cntlow + 1 - m) * Delta0 / (cntlow + 1);
1319 }
1320 else
1321 {
1322 delta[m] = (m - (cntlow)) * Delta0 / (cntlow + 1);
1323 }
1324
1326
1327
1328 for (int h = 0; h < nvertl; h++)
1329 {
1330
1331
1332
1333
1334
1335
1336 if (move_norm == false)
1337 {
1338 ynew[lay_Vids[m][h]] = y_c[h] + delta[m];
1339 xnew[lay_Vids[m][h]] = x_c[h];
1340 }
1341 else
1342 {
1343 if (h == 0 || h == nvertl - 1)
1344 {
1345 ynew[lay_Vids[m][h]] = y_c[h] + delta[m];
1346 xnew[lay_Vids[m][h]] = x_c[h];
1347 }
1348 else
1349 {
1350 ynew[lay_Vids[m][h]] =
1351 y_c[h] + delta[m] *
abs(nyPhys[h * npedge + 0]);
1352 xnew[lay_Vids[m][h]] =
1353 x_c[h] + delta[m] *
abs(nxPhys[h * npedge + 0]);
1354 }
1355 }
1356 cout << "Vid x=" << xnew[lay_Vids[m][h]]
1357 << " y=" << ynew[lay_Vids[m][h]] << endl;
1358 if (h < nedges
1359
1360 )
1361 {
1362 cout << "edge==" << h << endl;
1363 if (h > 0)
1364 {
1366 nyPhys[(h - 1) * npedge + npedge - 1],
1367 " normaly wrong");
1369 nxPhys[(h - 1) * npedge + npedge - 1],
1370 " normalx wrong");
1371 }
1372 if (move_norm == false)
1373 {
1374
1375 layers_y[m][h * npedge + 0] = y_c[h] + delta[m];
1376 layers_x[m][h * npedge + 0] = xnew[lay_Vids[m][h]];
1377
1378 layers_y[m][h * npedge + npedge - 1] =
1379 y_c[h + 1] + delta[m];
1380 layers_x[m][h * npedge + npedge - 1] =
1381 xnew[lay_Vids[m][h + 1]];
1382
1383 for (
int d = 0;
d < npedge - 2;
d++)
1384 {
1385 layers_y[m][h * npedge +
d + 1] =
1386 ycPhysMOD[h * npedge +
d + 1] + delta[m];
1387
1388 layers_x[m][h * npedge +
d + 1] =
1389 xcPhysMOD[h * npedge +
d + 1];
1390
1391 }
1392 }
1393 else
1394 {
1395 if (h == 0)
1396 {
1397
1398 tmpy_lay[h * npedge + 0] = y_c[h] + delta[m];
1399 tmpx_lay[h * npedge + 0] = xnew[lay_Vids[m][h]];
1400
1401 tmpy_lay[h * npedge + npedge - 1] =
1402 y_c[h + 1] +
1403 delta[m] *
abs(nyPhys[h * npedge + npedge - 1]);
1404 tmpx_lay[h * npedge + npedge - 1] =
1405 x_c[h + 1] +
1406 delta[m] *
abs(nxPhys[h * npedge + npedge - 1]);
1407 }
1408 else if (h == nedges - 1)
1409 {
1410
1411 tmpy_lay[h * npedge + 0] =
1412 y_c[h] + delta[m] *
abs(nyPhys[h * npedge + 0]);
1413 tmpx_lay[h * npedge + 0] =
1414 x_c[h] + delta[m] *
abs(nxPhys[h * npedge + 0]);
1415
1416 tmpy_lay[h * npedge + npedge - 1] =
1417 y_c[h + 1] + delta[m];
1418 tmpx_lay[h * npedge + npedge - 1] =
1419 xnew[lay_Vids[m][h + 1]];
1420 }
1421 else
1422 {
1423
1424 tmpy_lay[h * npedge + 0] =
1425 y_c[h] + delta[m] *
abs(nyPhys[h * npedge + 0]);
1426 tmpx_lay[h * npedge + 0] =
1427 x_c[h] + delta[m] *
abs(nxPhys[h * npedge + 0]);
1428
1429 tmpy_lay[h * npedge + npedge - 1] =
1430 y_c[h + 1] +
1431 delta[m] *
abs(nyPhys[h * npedge + npedge - 1]);
1432 tmpx_lay[h * npedge + npedge - 1] =
1433 x_c[h + 1] +
1434 delta[m] *
abs(nxPhys[h * npedge + npedge - 1]);
1435 }
1436
1437
1438 for (
int d = 0;
d < npedge - 2;
d++)
1439 {
1440
1441 tmpy_lay[h * npedge +
d + 1] =
1442 ycPhysMOD[h * npedge +
d + 1] +
1443 delta[m] *
abs(nyPhys[h * npedge +
d + 1]);
1444
1445
1446 tmpx_lay[h * npedge +
d + 1] =
1447 xcPhysMOD[h * npedge +
d + 1] +
1448 delta[m] *
abs(nxPhys[h * npedge +
d + 1]);
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461 }
1462 }
1463 }
1464 }
1465
1466 for (int s = 0; s < np_lay; s++)
1467 {
1468 cout << tmpx_lay[s] << " " << tmpy_lay[s] << endl;
1469 }
1471 cout << "fisrt interp" << endl;
1472 for (int s = 0; s < np_lay; s++)
1473 {
1474 cout << tmpx_lay[s] << " " << tmpy_lay[s] << endl;
1475 }
1476
1477
1478
1479
1480
1481
1482
1483
1484
1486 NekDouble boundright = xcPhysMOD[np_lay - 1];
1487 bool outboundleft = false;
1488 bool outboundright = false;
1489 if (tmpx_lay[1] < boundleft)
1490 {
1491 outboundleft = true;
1492 }
1493 if (tmpx_lay[np_lay - 2] > boundright)
1494 {
1495 outboundright = true;
1496 }
1497
1498 int outvert = 0;
1499 int outmiddle = 0;
1500 int outcount = 0;
1501
1503 for (int r = 0; r < nedges; r++)
1504 {
1505
1506 if (tmpx_lay[r * npedge + npedge - 1] < boundleft &&
1507 outboundleft == true)
1508 {
1509 vertout[outvert] = r;
1510 outvert++;
1511
1512 if (r < nedges - 1)
1513 {
1514
1515 if (tmpx_lay[(r + 1) * npedge + npedge - 1] > boundleft)
1516 {
1517 for (int s = 0; s < npedge - 2; s++)
1518 {
1519 if (tmpx_lay[(r + 1) * npedge + s + 1] <
1520 boundleft)
1521 {
1522 outmiddle++;
1523 }
1524 }
1525 }
1526 }
1527 }
1528
1529 if (tmpx_lay[r * npedge + 0] > boundright &&
1530 outboundright == true)
1531 {
1532 vertout[outvert] = r;
1533 outvert++;
1534
1535 if (r > 0)
1536 {
1537
1538 if (tmpx_lay[(r - 1) * npedge + 0] < boundright)
1539 {
1540 for (int s = 0; s < npedge - 2; s++)
1541 {
1542 if (tmpx_lay[(r - 1) * npedge + s + 1] >
1543 boundright)
1544 {
1545 outmiddle++;
1546 }
1547 }
1548 }
1549 }
1550 }
1551 }
1552
1553
1554 outcount = outvert * npedge + 1 + outmiddle;
1555
1556 int replacepointsfromindex = 0;
1557 for (int c = 0; c < nedges; c++)
1558 {
1559
1560 if (xcPhysMOD[c * npedge + npedge - 1] <=
1561 tmpx_lay[c * (npedge - (npedge - 2)) + 2] &&
1562 outboundright == true)
1563 {
1564 replacepointsfromindex = c * (npedge - (npedge - 2)) + 2;
1565 break;
1566 }
1567
1568
1569 if (xcPhysMOD[(nedges - 1 - c) * npedge + 0] >=
1570 tmpx_lay[np_lay - 1 -
1571 (c * (npedge - (npedge - 2)) + 2)] &&
1572 outboundleft == true)
1573 {
1574 replacepointsfromindex =
1575 np_lay - 1 - (c * (npedge - (npedge - 2)) + 2);
1576 break;
1577 }
1578 }
1579
1580
1581
1582
1583
1584 if (outcount > 1)
1585 {
1586
1587
1588 int pstart, shift;
1590
1591 if (outboundright == true)
1592 {
1593 pstart = replacepointsfromindex;
1594 shift = np_lay - outcount;
1595 increment =
1596 (xcPhysMOD[np_lay - outcount] - xcPhysMOD[pstart]) /
1597 (outcount + 1);
1598 outcount = outcount - 1;
1599 ASSERTL0(tmpx_lay[np_lay - outcount] >
1600 xcPhysMOD[(nedges - 1) * npedge + 0],
1601 "no middle points in the last edge");
1602 }
1603 else
1604 {
1605 shift = 1;
1606 pstart = outcount - 1;
1607 increment = (xcPhysMOD[replacepointsfromindex] -
1608 xcPhysMOD[pstart]) /
1609 (outcount + 1);
1611 xcPhysMOD[0 * npedge + npedge - 1],
1612 "no middle points in the first edge");
1613 }
1614
1615
1618
1625
1629 NekDouble xctmp, ycinterp, nxinterp, nyinterp;
1630
1631 for (int v = 0; v < outcount; v++)
1632 {
1633 xctmp = xcPhysMOD[pstart] + (v + 1) * increment;
1634
1635
1637
1638
1639
1641 closeny);
1642
1643
1645
1646
1647 nxinterp =
sqrt(
abs(1 - nyinterp * nyinterp));
1648
1649
1651 closey);
1652
1654
1655 replace_x[v] = xctmp + delta[m] *
abs(nxinterp);
1656 replace_y[v] = ycinterp + delta[m] *
abs(nyinterp);
1657 tmpx_lay[v + shift] = replace_x[v];
1658 tmpy_lay[v + shift] = replace_y[v];
1659
1660
1661
1662 }
1663 }
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678 int closepoints = 4;
1679
1682
1683
1684 int pointscount = 0;
1685 for (
int q = 0;
q < np_lay;
q++)
1686 {
1687 for (int e = 0; e < nedges; e++)
1688 {
1689 if (tmpx_lay[
q] <= x_c[e + 1] && tmpx_lay[
q] >= x_c[e])
1690 {
1691 pointscount++;
1692 }
1693 if (
q == e * npedge + npedge - 1 && pointscount != npedge)
1694 {
1695
1696 pointscount = 0;
1697 }
1698 else if (
q == e * npedge + npedge - 1)
1699 {
1700 pointscount = 0;
1701 }
1702 }
1703 }
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1719 lay_Vids[m], layers_x[m], layers_y[m], xnew,
1720 ynew);
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799 if (curv_lay == true)
1800 {
1801
1802
1803
1804
1805 }
1806
1807
1808 int npoints = npedge;
1811 for (int f = 0; f < nedges; f++)
1812 {
1813 int polyorder = 2;
1814
1816
1818 &xPedges[0], 1);
1820 &yPedges[0], 1);
1821
1822 PolyFit(polyorder, npoints, xPedges, yPedges, coeffsinterp,
1823 xPedges, yPedges, npoints);
1824
1825
1827 &layers_y[m][(f)*npedge + 0], 1);
1828
1829
1830 layers_y[m][f * npedge + 0] = ynew[lay_Vids[m][f]];
1831 layers_y[m][f * npedge + npedge - 1] = ynew[lay_Vids[m][f + 1]];
1832 }
1833
1834 cout << " xlay ylay lay:" << m << endl;
1835 for (int l = 0; l < np_lay; l++)
1836 {
1837
1838 cout << std::setprecision(8) << layers_x[m][l] << " "
1839 << layers_y[m][l] << endl;
1840 }
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875 cout << "lay=" << m << endl;
1878 " different layer ymin val");
1881 " different layer ymax val");
1884 " different layer xmin val");
1887 " different layer xmax val");
1888 }
1889
1890
1891
1892
1893
1894
1895
1897 npedge, graphShPt, xold_c, yold_c, xold_low, yold_low, xold_up,
1898 yold_up, layers_x[0], layers_y[0], layers_x[nlays - 1],
1899 layers_y[nlays - 1], nxPhys, nyPhys, xnew, ynew);
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976 }
1977 else
1978 {
1980 Down, Up, xnew, ynew, layers_x, layers_y);
1981 }
1982
1983
1985
1986
1987
1988
1989
1990 cout << std::setprecision(8) <<
"xmin=" <<
Vmath::Vmin(nVertTot, xnew, 1)
1991 << endl;
1993 " different xmin val");
1995 " different ymin val");
1997 " different xmax val");
1999 " different ymax val");
2000
2001
2002
2004 charalp, layers_x, layers_y, lay_Eids, curv_lay);
2005}
void GenerateMapEidsv1v2(MultiRegions::ExpListSharedPtr field, Array< OneD, int > &V1, Array< OneD, int > &V2)
void MoveLayerNnormpos(int nvertl, int npedge, Array< OneD, NekDouble > xcPhys, Array< OneD, NekDouble > tmpx_lay, Array< OneD, NekDouble > tmpy_lay, Array< OneD, int > Vids, Array< OneD, NekDouble > &xlay, Array< OneD, NekDouble > &ylay, Array< OneD, NekDouble > &xnew, Array< OneD, NekDouble > &ynew)
void EvaluateTangent(int npoints, Array< OneD, NekDouble > xcQedge, Array< OneD, NekDouble > coeffsinterp, Array< OneD, NekDouble > &txQedge, Array< OneD, NekDouble > &tyQedge)
NekDouble LagrangeInterpolant(NekDouble x, int npts, Array< OneD, NekDouble > xpts, Array< OneD, NekDouble > funcvals)
void Computestreakpositions(int nvertl, MultiRegions::ExpListSharedPtr streak, Array< OneD, NekDouble > xold_up, Array< OneD, NekDouble > yold_up, Array< OneD, NekDouble > xold_low, Array< OneD, NekDouble > yold_low, Array< OneD, NekDouble > xold_c, Array< OneD, NekDouble > yold_c, Array< OneD, NekDouble > &xc, Array< OneD, NekDouble > &yc, NekDouble cr, bool verts)
void Cutrepetitions(int nedges, Array< OneD, NekDouble > inarray, Array< OneD, NekDouble > &outarray)
void MoveOutsidePointsNnormpos(int npedge, SpatialDomains::MeshGraphSharedPtr mesh, Array< OneD, NekDouble > xcold, Array< OneD, NekDouble > ycold, Array< OneD, NekDouble > xolddown, Array< OneD, NekDouble > yolddown, Array< OneD, NekDouble > xoldup, Array< OneD, NekDouble > yoldup, Array< OneD, NekDouble > xlaydown, Array< OneD, NekDouble > ylaydown, Array< OneD, NekDouble > xlayup, Array< OneD, NekDouble > ylayup, Array< OneD, NekDouble > nxPhys, Array< OneD, NekDouble > nyPhys, Array< OneD, NekDouble > &xnew, Array< OneD, NekDouble > &ynew)
void MappingEVids(Array< OneD, NekDouble > xoldup, Array< OneD, NekDouble > yoldup, Array< OneD, NekDouble > xolddown, Array< OneD, NekDouble > yolddown, Array< OneD, NekDouble > xcold, Array< OneD, NekDouble > ycold, Array< OneD, int > Vids_c, SpatialDomains::MeshGraphSharedPtr mesh, MultiRegions::ExpListSharedPtr streak, Array< OneD, int > V1, Array< OneD, int > V2, int &nlays, Array< OneD, Array< OneD, int > > &Eids_lay, Array< OneD, Array< OneD, int > > &Vids_lay)
void CheckSingularQuads(MultiRegions::ExpListSharedPtr Exp, Array< OneD, int > V1, Array< OneD, int > V2, Array< OneD, NekDouble > &xnew, Array< OneD, NekDouble > &ynew)
void Orderfunctionx(Array< OneD, NekDouble > inarray_x, Array< OneD, NekDouble > inarray_y, Array< OneD, NekDouble > &outarray_x, Array< OneD, NekDouble > &outarray_y)
void Replacevertices(string filename, Array< OneD, NekDouble > newx, Array< OneD, NekDouble > newy, Array< OneD, NekDouble > xcPhys, Array< OneD, NekDouble > ycPhys, Array< OneD, int > Eids, int Npoints, string s_alp, Array< OneD, Array< OneD, NekDouble > > x_lay, Array< OneD, Array< OneD, NekDouble > > y_lay, Array< OneD, Array< OneD, int > > lay_eids, bool curv_lay)
void OrderVertices(int nedges, SpatialDomains::MeshGraphSharedPtr graphShPt, MultiRegions::ExpListSharedPtr &bndfield, Array< OneD, int > &Vids, int v1, int v2, NekDouble x_connect, int &lastedge, Array< OneD, NekDouble > &x, Array< OneD, NekDouble > &y)
void PolyFit(int polyorder, int npoints, Array< OneD, NekDouble > xin, Array< OneD, NekDouble > fin, Array< OneD, NekDouble > &coeffsinterp, Array< OneD, NekDouble > &xout, Array< OneD, NekDouble > &fout, int npout)
void GenerateAddPointsNewtonIt(NekDouble xi, NekDouble yi, NekDouble &xout, NekDouble &yout, MultiRegions::ExpListSharedPtr function, Array< OneD, NekDouble > derfunction, NekDouble cr)
void MoveLayersvertically(int nlays, int nvertl, int cntlow, int cntup, Array< OneD, Array< OneD, int > > lay_Vids, Array< OneD, NekDouble > xc, Array< OneD, NekDouble > yc, Array< OneD, int > Down, Array< OneD, int > Up, Array< OneD, NekDouble > &xnew, Array< OneD, NekDouble > &ynew, Array< OneD, Array< OneD, NekDouble > > &layers_x, Array< OneD, Array< OneD, NekDouble > > &layers_y)
void GenerateNeighbourArrays(int index, int neighpoints, Array< OneD, NekDouble > xArray, Array< OneD, NekDouble > yArray, Array< OneD, NekDouble > &Neighbour_x, Array< OneD, NekDouble > &Neighbour_y)
int DetermineclosePointxindex(NekDouble x, Array< OneD, NekDouble > xArray)
General purpose memory allocation routines with the ability to allocate from thread specific memory p...
void GetCoords(Array< OneD, NekDouble > &coords_1, Array< OneD, NekDouble > &coords_2=NullNekDouble1DArray, Array< OneD, NekDouble > &coords_3=NullNekDouble1DArray)
this function returns the physical coordinates of the quadrature points of the expansion
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...
std::shared_ptr< SessionReader > SessionReaderSharedPtr
std::shared_ptr< SegExp > SegExpSharedPtr
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
std::shared_ptr< ContField > ContFieldSharedPtr
std::map< int, BoundaryRegionShPtr > BoundaryRegionCollection
std::shared_ptr< BoundaryConditions > BoundaryConditionsSharedPtr
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::shared_ptr< PointGeom > PointGeomSharedPtr
std::vector< double > z(NPUPPER)
void Vsqrt(int n, const T *x, const int incx, T *y, const int incy)
sqrt y = sqrt(x)
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.
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
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
void Sdiv(int n, const T alpha, const T *x, const int incx, T *y, const int incy)
Scalar multiply y = alpha/x.
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.
void Zero(int n, T *x, const int incx)
Zero vector.
T Vmax(int n, const T *x, const int incx)
Return the maximum element in x – called vmax to avoid conflict with max.
scalarT< T > sqrt(scalarT< T > in)