178{
180
181 cr = 0;
182
183 if (argc > 6 || argc < 5)
184 {
185 fprintf(stderr, "Usage: ./MoveMesh meshfile fieldfile changefile "
186 "alpha cr(optional)\n");
187 exit(1);
188 }
189
190
191
193 LibUtilities::SessionReader::CreateInstance(2, argv);
195 SpatialDomains::MeshGraph::Read(vSession);
196
197
198 if (argc == 6 && vSession->DefinesSolverInfo("INTERFACE") &&
199 vSession->GetSolverInfo("INTERFACE") == "phase")
200 {
201 cr = boost::lexical_cast<NekDouble>(argv[argc - 1]);
202 argc = 5;
203 }
204
205
207 boundaryConditions =
209 vSession, graphShPt);
211
212
213
214
215
216
217
218
219 string changefile(argv[argc - 2]);
220
221
222
223 string charalp(argv[argc - 1]);
224
225 cout << "read alpha=" << charalp << endl;
226
227
228
229 string fieldfile(argv[argc - 3]);
230 vector<LibUtilities::FieldDefinitionsSharedPtr> fielddef;
231 vector<vector<NekDouble>> fielddata;
232
233
236 vSession, graphShPt, "w", true);
237
239
240 for (int i = 0; i < fielddata.size(); i++)
241 {
242 streak->ExtractDataToCoeffs(fielddef[i], fielddata[i],
243 fielddef[i]->m_fields[0],
244 streak->UpdateCoeffs());
245 }
246 streak->BwdTrans(streak->GetCoeffs(), streak->UpdatePhys());
247
248
249
250
251
252 int nIregions, lastIregion = 0;
254 streak->GetBndConditions();
256
257 nIregions = 0;
258 int nbnd = bndConditions.size();
259 for (int r = 0; r < nbnd; r++)
260 {
261 if (bndConditions[r]->GetUserDefined() == "CalcBC")
262 {
263 lastIregion = r;
264 Iregions[r] = r;
265 nIregions++;
266 }
267 }
268
270 "there is any boundary region with the tag USERDEFINEDTYPE="
271 "CalcBC"
272 " specified");
273 cout << "nIregions=" << nIregions << endl;
274
276 streak->GetBndCondExpansions();
277
278
279 int nedges = bndfieldx[lastIregion]->GetExpSize();
280 int nvertl = nedges + 1;
285
286
289 int lastedge = -1;
290 int v1, v2;
291
292 x_connect = 0;
294 ((bndfieldx[lastIregion]->GetExp(0)->as<LocalRegions::SegExp>())
295 ->GetGeom1D())
296 ->GetVid(0));
297 vertex0->GetCoords(x0, y0, z0);
298 if (x0 != 0.0)
299 {
300 cout << "WARNING x0=" << x0 << endl;
301 x_connect = x0;
302 }
303 v1 = 0;
304 v2 = 1;
305 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 1], Vids_low, v1,
306 v2, x_connect, lastedge, xold_low, yold_low);
307 ASSERTL0(Vids_low[v2] != -10,
"Vids_low[v2] is wrong");
309 graphShPt->GetVertex(Vids_low[v2]);
310
311
312 cout << "x_conn=" << x_connect << " yt=" << yt << " zt=" << zt
313 << " vid=" << Vids_low[v2] << endl;
314 vertex->GetCoords(x_connect, yt, zt);
315
316 int i = 2;
317 while (i < nvertl)
318 {
319 v1 = i;
320 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 1], Vids_low,
321 v1, v2, x_connect, lastedge, xold_low, yold_low);
323 graphShPt->GetVertex(Vids_low[v1]);
324
325 vertex->GetCoords(x_connect, yt, zt);
326 i++;
327 }
328
329
330
331
335
336 x_connect = 0;
337 vertex0 = graphShPt->GetVertex(
338 ((bndfieldx[lastIregion]->GetExp(0)->as<LocalRegions::SegExp>())
339 ->GetGeom1D())
340 ->GetVid(0));
341 vertex0->GetCoords(x0, y0, z0);
342 if (x0 != 0.0)
343 {
344 cout << "WARNING x0=" << x0 << endl;
345 x_connect = x0;
346 }
347 lastedge = -1;
348
349 v1 = 0;
350 v2 = 1;
351 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 2], Vids_up, v1,
352 v2, x_connect, lastedge, xold_up, yold_up);
354 graphShPt->GetVertex(Vids_up[v2]);
355 vertexU->GetCoords(x_connect, yt, zt);
356
357 i = 2;
358 while (i < nvertl)
359 {
360 v1 = i;
361 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion - 2], Vids_up,
362 v1, v2, x_connect, lastedge, xold_up, yold_up);
364 graphShPt->GetVertex(Vids_up[v1]);
365
366
367 vertex->GetCoords(x_connect, yt, zt);
368 i++;
369 }
370
371
372
373
377
378 x_connect = 0;
379 vertex0 = graphShPt->GetVertex(
380 ((bndfieldx[lastIregion]->GetExp(0)->as<LocalRegions::SegExp>())
381 ->GetGeom1D())
382 ->GetVid(0));
383 vertex0->GetCoords(x0, y0, z0);
384 if (x0 != 0.0)
385 {
386 cout << "WARNING x0=" << x0 << endl;
387 x_connect = x0;
388 }
389 lastedge = -1;
390
391 v1 = 0;
392 v2 = 1;
393
394 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion], Vids_c, v1, v2,
395 x_connect, lastedge, xold_c, yold_c);
397 graphShPt->GetVertex(Vids_c[v2]);
398
399
400 vertexc->GetCoords(x_connect, yt, zt);
401
402 i = 2;
403 while (i < nvertl)
404 {
405 v1 = i;
406 OrderVertices(nedges, graphShPt, bndfieldx[lastIregion], Vids_c, v1, v2,
407 x_connect, lastedge, xold_c, yold_c);
409 graphShPt->GetVertex(Vids_c[v1]);
410
411
412 vertex->GetCoords(x_connect, yt, zt);
413 i++;
414 }
415
416
417
420
421 for (int r = 0; r < nvertl; r++)
422 {
423
424
425
426 Deltaup[r] = yold_up[r] - yold_c[r];
427 Deltalow[r] = yold_c[r] - yold_low[r];
429 "distance between upper and layer curve is not positive");
431 "distance between lower and layer curve is not positive");
432 }
433
434
435
437 bcs.GetBoundaryRegions();
440
442 vSession, *(bregions.find(lastIregion)->second), graphShPt, true);
444 *yexp);
445
446
447
448
449
450
451
452 int npedge;
453 if (vSession->DefinesParameter("npedge"))
454 {
455 npedge = (int)vSession->GetParameter("npedge");
456 }
457 else
458 {
459 npedge = 5;
460 }
461
462
463
464 int nq = streak->GetTotPoints();
467 streak->GetCoords(x, y);
473
475 xold_c, yold_c, x_c, y_c, cr, true);
476
478 for (
int q = 0;
q < nvertl;
q++)
479 {
480 if (y_c[
q] < yold_c[
q])
481 {
483 }
484
485 Delta_c[
q] =
abs(yold_c[
q] - y_c[
q]);
486
488 cout << x_c[
q] <<
" " << y_c[
q] << endl;
489 }
490
491 if (shift < 0.001)
492 {
493 cout << "Warning: the critical layer is stationary" << endl;
494 }
495
496
497
503
506
508
509 int Eid, id1, id2;
514 for (int r = 0; r < nedges; r++)
515 {
516
517 bndSegExp =
519 Eid = (bndSegExp->GetGeom1D())->GetGlobalID();
520 id1 = (bndSegExp->GetGeom1D())->GetVid(0);
521 id2 = (bndSegExp->GetGeom1D())->GetVid(1);
522 vertex1 = graphShPt->GetVertex(id1);
523 vertex2 = graphShPt->GetVertex(id2);
525 vertex2->GetCoords(x2, y2, z2);
526
527
528 cout << "edge=" << r << " x1=" << x1 << " y1=" << y1 << " x2=" << x2
529 << " y2=" << y2 << endl;
530 if (x2 > x1)
531 {
532 Cpointsx[r] = x1 + (x2 - x1) / 2;
533
534
535
536 if (Cpointsx[r] > x2 || Cpointsx[r] < x1)
537 {
538 Cpointsx[r] = -Cpointsx[r];
539 }
540 for (
int w = 0;
w < npedge - 2;
w++)
541 {
542
543 Addpointsx[r * (npedge - 2) +
w] =
544 x1 + ((x2 - x1) / (npedge - 1)) * (
w + 1);
545 if (Addpointsx[r * (npedge - 2) +
w] > x2 ||
546 Addpointsx[r * (npedge - 2) +
w] < x1)
547 {
548 Addpointsx[r * (npedge - 2) +
w] =
549 -Addpointsx[r * (npedge - 2) +
w];
550 }
551
552 Addpointsy[r * (npedge - 2) +
w] =
553 y_c[r] + ((y_c[r + 1] - y_c[r]) / (x_c[r + 1] - x_c[r])) *
554 (Addpointsx[r * (npedge - 2) +
w] - x1);
555
556
558 Addpointsy[r * (npedge - 2) +
w],
559 Addpointsx[r * (npedge - 2) +
w],
560 Addpointsy[r * (npedge - 2) +
w],
561 streak, dU, cr);
562
563
564
565
566 }
567
568
569
570
571 }
572 else if (x1 > x2)
573 {
574 Cpointsx[r] = x2 + (x1 - x2) / 2;
575
576 if (Cpointsx[r] > x1 || Cpointsx[r] < x2)
577 {
578 Cpointsx[r] = -Cpointsx[r];
579 }
580 for (
int w = 0;
w < npedge - 2;
w++)
581 {
582 Addpointsx[r * (npedge - 2) +
w] =
583 x2 + ((x1 - x2) / (npedge - 1)) * (
w + 1);
584 if (Addpointsx[r * (npedge - 2) +
w] > x1 ||
585 Addpointsx[r * (npedge - 2) +
w] < x2)
586 {
587 Addpointsx[r * (npedge - 2) +
w] =
588 -Addpointsx[r * (npedge - 2) +
w];
589 }
590
591
592 Addpointsy[r * (npedge - 2) +
w] =
593 y_c[r + 1] +
594 ((y_c[r] - y_c[r + 1]) / (x_c[r] - x_c[r + 1])) *
595 (Addpointsx[r * (npedge - 2) +
w] - x2);
596
597
598
600 Addpointsy[r * (npedge - 2) +
w],
601 Addpointsx[r * (npedge - 2) +
w],
602 Addpointsy[r * (npedge - 2) +
w],
603 streak, dU, cr);
604
605
606
607 }
608
609
610
611
612 }
613 else
614 {
615 ASSERTL0(
false,
"point not generated");
616 }
617
618
619
620
621
622
623
624
625 Eids[r] = Eid;
626 }
627
628
629
632
633 for (int a = 0; a < nedges; a++)
634 {
635
636 xcPhys[a * npedge + 0] = x_c[a];
637 ycPhys[a * npedge + 0] = y_c[a];
638
639 xcPhys[a * npedge + npedge - 1] = x_c[a + 1];
640 ycPhys[a * npedge + npedge - 1] = y_c[a + 1];
641
642 for (int b = 0; b < npedge - 2; b++)
643 {
644 xcPhys[a * npedge + b + 1] = Addpointsx[a * (npedge - 2) + b];
645 ycPhys[a * npedge + b + 1] = Addpointsy[a * (npedge - 2) + b];
646 }
647 }
648
649 cout << "xc,yc before tanevaluate" << endl;
650 for (int v = 0; v < xcPhys.size(); v++)
651 {
652 cout << xcPhys[v] << " " << ycPhys[v] << endl;
653 }
654
655
656
657
660
664 int nlays = 0;
665 MappingEVids(xold_up, yold_up, xold_low, yold_low, xold_c, yold_c, Vids_c,
666 graphShPt, streak, V1, V2, nlays, lay_Eids, lay_Vids);
667
668 cout << "nlays=" << nlays << endl;
671
672 for (int g = 0; g < nlays; g++)
673 {
675 }
676
677
678
679
680
681
683 if (vSession->DefinesParameter("Delta"))
684 {
685 Delta0 = vSession->GetParameter("Delta");
686 }
687 else
688 {
689 Delta0 = 0.1;
690 }
691
692
693
694
695
696
697 int nVertTot = graphShPt->GetNvertices();
698
701
706 int cntup = 0;
707 int cntlow = 0;
708
713 for (int i = 0; i < nVertTot; i++)
714 {
715 bool mvpoint = false;
718 vertex->GetCoords(x, y,
z);
719
720 xold[i] = x;
721 yold[i] = y;
722
723
724 xnew[i] = x;
725
726
727 if (x == 0 && y < yold_low[0] && y > bleft)
728 {
729 bleft = y;
730 }
731
732 if (x == xold_c[nvertl - 1] && y > yold_up[nvertl - 1] && y < tright)
733 {
734 tright = y;
735 }
736
737 if (x == xold_c[nvertl - 1] && y < yold_low[nvertl - 1] && y > bright)
738 {
739 bright = y;
740 }
741
742 if (x == 0 && y > yold_up[0] && y < tleft)
743 {
744 tleft = y;
745 }
746
747 for (int j = 0; j < nvertl; j++)
748 {
749 if ((xold_up[j] == x) && (yold_up[j] == y))
750 {
751
752
753 ynew[i] = y_c[j] + Delta0;
754 mvpoint = true;
755 Up[j] = i;
756 }
757 if ((xold_low[j] == x) && (yold_low[j] == y))
758 {
759
760
761 ynew[i] = y_c[j] - Delta0;
762 mvpoint = true;
763 Down[j] = i;
764 }
765 if ((xold_c[j] == x) && (yold_c[j] == y))
766 {
767 ynew[i] = y_c[j];
768 mvpoint = true;
769 }
770 }
771 if (mvpoint == false)
772 {
773
775 int qp_closer = 0;
776 for (int k = 0; k < nvertl; k++)
777 {
778 if (
abs(x - xold_up[k]) < diff)
779 {
780 diff =
abs(x - xold_up[k]);
781 qp_closer = k;
782 }
783 }
784 if (y > yold_up[qp_closer] && y < 1)
785 {
786
787
788
789
790
791
792
793
794 ynew[i] = y_c[qp_closer] + (y - yold_c[qp_closer]) *
795 (1 - y_c[qp_closer]) /
796 (1 - yold_c[qp_closer]);
797
798 }
799 else if (y < yold_low[qp_closer] && y > -1)
800 {
801
802
803
804
805
806
807
808
809 ynew[i] = y_c[qp_closer] + (y - yold_c[qp_closer]) *
810 (-1 - y_c[qp_closer]) /
811 (-1 - yold_c[qp_closer]);
812 }
813
814 else if (y > yold_c[qp_closer] && y < yold_up[qp_closer])
815 {
816 if (x == 0)
817 {
818 cntup++;
819 }
820
821
822
823 }
824 else if (y < yold_c[qp_closer] && y > yold_low[qp_closer])
825 {
826 if (x == 0)
827 {
828 cntlow++;
829 }
830
831
832
833 }
834 else if (y == 1 || y == -1)
835 {
836 ynew[i] = y;
837
838
839 }
840
841
842 if ((ynew[i] > 1 || ynew[i] < -1) &&
843 (y > yold_up[qp_closer] || y < yold_low[qp_closer]))
844 {
845 cout << "point x=" << xnew[i] << " y=" << y
846 << " closer x=" << xold_up[qp_closer]
847 << " ynew=" << ynew[i] << endl;
848 ASSERTL0(
false,
"shifting out of range");
849 }
850 }
851 }
852
853 int nqedge = streak->GetExp(0)->GetNumPoints(0);
854 int nquad_lay = (nvertl - 1) * nqedge;
856
857 bool curv_lay = true;
858 bool move_norm = true;
859 int np_lay = (nvertl - 1) * npedge;
860
868
869 if (move_norm == true)
870 {
871
872
875
878
880
881 cout << "nquad per edge=" << nqedge << endl;
882 for (int l = 0; l < 2; l++)
883 {
884 Edge_newcoords[l] = bndfieldx[lastIregion]
885 ->GetExp(0)
887 }
895
902
905
907
908 bndfieldx[lastIregion]->GetCoords(xcQ, ycQ, zcQ);
909
910
917 for (int l = 0; l < xcQ.size(); l++)
918 {
922
923
925
927 }
928
929
930
931 Vmath::Vcopy(nquad_lay, ycQ, 1, Cont_y->UpdatePhys(), 1);
933
934 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffsy);
935 Cont_y->BwdTrans(coeffsy, Cont_y->UpdatePhys());
937
938 cout << "xcQ, ycQ" << endl;
939 for (int s = 0; s < xcQ.size(); s++)
940 {
941 cout << xcQ[s] << " " << ycQ[s] << endl;
942 }
943
944 bool evaluatetan = false;
947 int wrong = 0;
948 for (int k = 0; k < nedges; k++)
949 {
950 Vmath::Vcopy(nqedge, &xcQ[k * nqedge], 1, &xcedgeQ[0], 1);
951 Vmath::Vcopy(nqedge, &ycQ[k * nqedge], 1, &ycedgeQ[0], 1);
952
953 Edge_newcoords[0]->StdPhysDeriv(xcedgeQ, txedgeQ);
954 Edge_newcoords[1]->StdPhysDeriv(ycedgeQ, tyedgeQ);
955
956 Vmath::Vmul(nqedge, txedgeQ, 1, txedgeQ, 1, normsQ, 1);
957
958 Vmath::Vvtvp(nqedge, tyedgeQ, 1, tyedgeQ, 1, normsQ, 1, normsQ, 1);
959
962
963 Vmath::Vmul(nqedge, txedgeQ, 1, normsQ, 1, txedgeQ, 1);
964 Vmath::Vmul(nqedge, tyedgeQ, 1, normsQ, 1, tyedgeQ, 1);
965
966
967
968 evaluatetan = false;
969 for (int u = 0; u < nqedge - 1; u++)
970 {
971 incratio = (ycedgeQ[u + 1] - ycedgeQ[u]) /
972 (xcedgeQ[u + 1] - xcedgeQ[u]);
973 cout << "incratio=" << incratio << endl;
974 if (
abs(incratio) > 4.0 && evaluatetan ==
false)
975 {
976 cout << "wrong=" << wrong << endl;
977 evaluatetan = true;
978 ASSERTL0(wrong < 2,
"number edges to change is too high!!");
979 edgeinterp[wrong] = k;
980 wrong++;
981 }
982 }
983
984 if (evaluatetan)
985 {
986 cout << "tan bef" << endl;
987 for (int e = 0; e < nqedge; e++)
988 {
989 cout << xcedgeQ[e] << " " << ycedgeQ[e] << " "
990 << txedgeQ[e] << endl;
991 }
992
993
994 int polyorder = 3;
998 Vmath::Vcopy(npedge, &xcPhysMOD[k * npedge + 0], 1, &xPedges[0],
999 1);
1000 Vmath::Vcopy(npedge, &ycPhysMOD[k * npedge + 0], 1, &yPedges[0],
1001 1);
1002
1003 PolyFit(polyorder, nqedge, xcedgeQ, ycedgeQ, coeffsinterp,
1004 xPedges, yPedges, npedge);
1005
1006 Vmath::Vcopy(npedge, &xPedges[0], 1, &xcPhysMOD[k * npedge + 0],
1007 1);
1008 Vmath::Vcopy(npedge, &yPedges[0], 1, &ycPhysMOD[k * npedge + 0],
1009 1);
1010
1012 tyedgeQ);
1013 }
1014
1015 Vmath::Vcopy(nqedge, &(txedgeQ[0]), 1, &(txQ[nqedge * k]), 1);
1016 Vmath::Vcopy(nqedge, &(tyedgeQ[0]), 1, &(tyQ[nqedge * k]), 1);
1017 }
1018
1021 for (
int w = 0;
w < fz.size();
w++)
1022 {
1023 txQ[
w] = cos(atan(fz[
w]));
1024 tyQ[
w] = sin(atan(fz[
w]));
1025 cout << xcQ[
w] <<
" " << ycQ[
w] <<
" " << fz[
w] << endl;
1026 }
1027
1028
1029
1030 Vmath::Vcopy(nquad_lay, txQ, 1, Cont_y->UpdatePhys(), 1);
1031 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffsy);
1032 Cont_y->BwdTrans(coeffsy, Cont_y->UpdatePhys());
1034
1035 Vmath::Vcopy(nquad_lay, tyQ, 1, Cont_y->UpdatePhys(), 1);
1036 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffsy);
1037 Cont_y->BwdTrans(coeffsy, Cont_y->UpdatePhys());
1039
1040
1042
1043
1044
1045
1046 int edgebef;
1047
1048 for (
int q = 0;
q < 2;
q++)
1049 {
1050 edgebef = edgeinterp[
q] - 1;
1051 incbefore =
1052 (txQ[edgebef * nqedge + nqedge - 1] - txQ[edgebef * nqedge]) /
1053 (xcQ[edgebef * nqedge + nqedge - 1] - xcQ[edgebef * nqedge]);
1054 inc = (txQ[edgeinterp[
q] * nqedge + nqedge - 1] -
1055 txQ[edgeinterp[
q] * nqedge]) /
1056 (xcQ[edgeinterp[
q] * nqedge + nqedge - 1] -
1057 xcQ[edgeinterp[
q] * nqedge]);
1058 int npoints = 2 * nqedge;
1059
1064 cout << "inc=" << inc << " incbef=" << incbefore << endl;
1065 if ((inc / incbefore) > 0.)
1066 {
1067 cout << "before!!" << edgebef << endl;
1068 int polyorder = 2;
1071 &xQedges[0], 1);
1073 &yQedges[0], 1);
1075 &txQedges[0], 1);
1077 &tyQedges[0], 1);
1078
1079 PolyFit(polyorder, npoints, xQedges, txQedges, coeffsinterp,
1080 xQedges, txQedges, npoints);
1081
1082
1084 &txQ[edgebef * nqedge + 0], 1);
1085
1086 PolyFit(polyorder, npoints, xQedges, tyQedges, coeffsinterp,
1087 xQedges, tyQedges, npoints);
1088
1089
1091 &tyQ[edgebef * nqedge + 0], 1);
1092 }
1093 else
1094 {
1095 cout << "after!!" << endl;
1096 int polyorder = 2;
1099 &xQedges[0], 1);
1101 &yQedges[0], 1);
1103 &txQedges[0], 1);
1105 &tyQedges[0], 1);
1106
1107 PolyFit(polyorder, npoints, xQedges, txQedges, coeffsinterp,
1108 xQedges, txQedges, npoints);
1109
1110
1112 &txQ[edgeinterp[
q] * nqedge + 0], 1);
1113
1114 PolyFit(polyorder, npoints, xQedges, tyQedges, coeffsinterp,
1115 xQedges, tyQedges, npoints);
1116
1117
1119 &tyQ[edgeinterp[
q] * nqedge + 0], 1);
1120 }
1121 }
1122
1123
1124 Vmath::Vcopy(nquad_lay, tyQ, 1, Cont_y->UpdatePhys(), 1);
1125 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1126 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1128
1129 Vmath::Vcopy(nquad_lay, txQ, 1, Cont_y->UpdatePhys(), 1);
1130 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1131 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1133
1134 for (int k = 0; k < nedges; k++)
1135 {
1136
1137
1138
1139
1140
1141 Vmath::Vcopy(nqedge, &(txQ[nqedge * k]), 1, &(txedgeQ[0]), 1);
1142 Vmath::Vcopy(nqedge, &(tyQ[nqedge * k]), 1, &(tyedgeQ[0]), 1);
1143
1144 Vmath::Vdiv(nqedge, txedgeQ, 1, tyedgeQ, 1, tx_tyedgeQ, 1);
1145 Vmath::Vmul(nqedge, tx_tyedgeQ, 1, tx_tyedgeQ, 1, tx_tyedgeQ, 1);
1146 Vmath::Sadd(nqedge, 1.0, tx_tyedgeQ, 1, nxedgeQ, 1);
1149
1150 Vmath::Smul(nqedge, -1.0, nxedgeQ, 1, nxedgeQ, 1);
1151 Vmath::Vcopy(nqedge, &(nxedgeQ[0]), 1, &(nxQ[nqedge * k]), 1);
1152
1153 Vmath::Vmul(nqedge, nxedgeQ, 1, nxedgeQ, 1, nyedgeQ, 1);
1154 Vmath::Smul(nqedge, -1.0, nyedgeQ, 1, nyedgeQ, 1);
1157
1158 Vmath::Smul(nqedge, -1.0, nyedgeQ, 1, nyedgeQ, 1);
1159 Vmath::Vcopy(nqedge, &(nyedgeQ[0]), 1, &(nyQ[nqedge * k]), 1);
1160
1161 cout << "edge:" << k << endl;
1162 cout << "tan/normal" << endl;
1163 for (int r = 0; r < nqedge; r++)
1164 {
1165 cout << xcQ[k * nqedge + r] << " " << txedgeQ[r] << " "
1166 << tyedgeQ[r] << " " << nxedgeQ[r] << " "
1167 << nyedgeQ[r] << endl;
1168 }
1169 }
1170
1171
1172
1173 Vmath::Vcopy(nquad_lay, nyQ, 1, Cont_y->UpdatePhys(), 1);
1174
1175 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1176 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1178
1180 Vmath::Zero(Cont_y->GetNcoeffs(), Cont_y->UpdateCoeffs(), 1);
1181 Vmath::Vcopy(nquad_lay, nxQ, 1, Cont_y->UpdatePhys(), 1);
1182 Cont_y->FwdTransLocalElmt(Cont_y->GetPhys(), coeffstmp);
1183 Cont_y->BwdTrans(coeffstmp, Cont_y->UpdatePhys());
1185
1186
1187 for (int k = 0; k < nedges; k++)
1188 {
1189 if (k > 0)
1190 {
1191
1192
1193 nyQ[(k - 1) * nqedge + nqedge - 1] = nyQ[k * nqedge + 0];
1194
1195
1196
1197 nxQ[(k - 1) * nqedge + nqedge - 1] = nxQ[k * nqedge + 0];
1198 }
1199 }
1200
1202
1204
1205 cout << "nx,yQbefore" << endl;
1206 for (int u = 0; u < xcQ.size(); u++)
1207 {
1208 cout << xcQ[u] << " " << nyQ[u] << " " << txQ[u] << endl;
1209 }
1210
1212
1214 cout << "nx,yQ" << endl;
1215 for (int u = 0; u < x_tmpQ.size(); u++)
1216 {
1217 cout << x_tmpQ[u] << " " << tmpnyQ[u] << endl;
1218 }
1219
1220
1221 for (int k = 0; k < nedges; k++)
1222 {
1223
1224 for (int a = 0; a < npedge; a++)
1225 {
1226 if (a == 0)
1227 {
1228 nxPhys[k * npedge + a] = nxQ[k * nqedge + 0];
1229 nyPhys[k * npedge + a] = nyQ[k * nqedge + 0];
1230 }
1231 else if (a == npedge - 1)
1232 {
1233 nxPhys[k * npedge + a] = nxQ[k * nqedge + nqedge - 1];
1234 nyPhys[k * npedge + a] = nyQ[k * nqedge + nqedge - 1];
1235
1236 }
1237 else
1238 {
1239
1240
1241
1242
1243
1244
1245 int index;
1246
1247
1249 Addpointsx[k * (npedge - 2) + a - 1], x_tmpQ);
1250
1253
1254
1256 Pyinterp);
1257
1259 Addpointsx[k * (npedge - 2) + a - 1], 4, Pxinterp,
1260 Pyinterp);
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270 nxPhys[k * npedge + a] = -
sqrt(
abs(
1271 1 - nyPhys[k * npedge + a] * nyPhys[k * npedge + a]));
1272
1273
1274
1275
1276
1277
1278
1279 }
1280
1281
1282 if (k > 0)
1283 {
1284
1285
1286 nyPhys[(k - 1) * npedge + npedge - 1] =
1287 nyPhys[k * npedge + 0];
1288
1289
1290
1291 nxPhys[(k - 1) * npedge + npedge - 1] =
1292 nxPhys[k * npedge + 0];
1293 }
1294 }
1295 }
1296 cout << "xcPhys,," << endl;
1297 for (int s = 0; s < np_lay; s++)
1298 {
1299
1300 cout << xcPhysMOD[s] << " " << ycPhysMOD[s] << " "
1301 << nxPhys[s] << " " << nyPhys[s] << endl;
1302 }
1303
1304
1305
1306
1307
1308
1309
1313 for (int m = 0; m < nlays; m++)
1314 {
1315
1316
1317
1318 if (m < cntlow + 1)
1319 {
1320 delta[m] = -(cntlow + 1 - m) * Delta0 / (cntlow + 1);
1321 }
1322 else
1323 {
1324 delta[m] = (m - (cntlow)) * Delta0 / (cntlow + 1);
1325 }
1326
1328
1329
1330 for (int h = 0; h < nvertl; h++)
1331 {
1332
1333
1334
1335
1336
1337
1338 if (move_norm == false)
1339 {
1340 ynew[lay_Vids[m][h]] = y_c[h] + delta[m];
1341 xnew[lay_Vids[m][h]] = x_c[h];
1342 }
1343 else
1344 {
1345 if (h == 0 || h == nvertl - 1)
1346 {
1347 ynew[lay_Vids[m][h]] = y_c[h] + delta[m];
1348 xnew[lay_Vids[m][h]] = x_c[h];
1349 }
1350 else
1351 {
1352 ynew[lay_Vids[m][h]] =
1353 y_c[h] + delta[m] *
abs(nyPhys[h * npedge + 0]);
1354 xnew[lay_Vids[m][h]] =
1355 x_c[h] + delta[m] *
abs(nxPhys[h * npedge + 0]);
1356 }
1357 }
1358 cout << "Vid x=" << xnew[lay_Vids[m][h]]
1359 << " y=" << ynew[lay_Vids[m][h]] << endl;
1360 if (h < nedges
1361
1362 )
1363 {
1364 cout << "edge==" << h << endl;
1365 if (h > 0)
1366 {
1368 nyPhys[(h - 1) * npedge + npedge - 1],
1369 " normaly wrong");
1371 nxPhys[(h - 1) * npedge + npedge - 1],
1372 " normalx wrong");
1373 }
1374 if (move_norm == false)
1375 {
1376
1377 layers_y[m][h * npedge + 0] = y_c[h] + delta[m];
1378 layers_x[m][h * npedge + 0] = xnew[lay_Vids[m][h]];
1379
1380 layers_y[m][h * npedge + npedge - 1] =
1381 y_c[h + 1] + delta[m];
1382 layers_x[m][h * npedge + npedge - 1] =
1383 xnew[lay_Vids[m][h + 1]];
1384
1385 for (
int d = 0;
d < npedge - 2;
d++)
1386 {
1387 layers_y[m][h * npedge +
d + 1] =
1388 ycPhysMOD[h * npedge +
d + 1] + delta[m];
1389
1390 layers_x[m][h * npedge +
d + 1] =
1391 xcPhysMOD[h * npedge +
d + 1];
1392
1393 }
1394 }
1395 else
1396 {
1397 if (h == 0)
1398 {
1399
1400 tmpy_lay[h * npedge + 0] = y_c[h] + delta[m];
1401 tmpx_lay[h * npedge + 0] = xnew[lay_Vids[m][h]];
1402
1403 tmpy_lay[h * npedge + npedge - 1] =
1404 y_c[h + 1] +
1405 delta[m] *
abs(nyPhys[h * npedge + npedge - 1]);
1406 tmpx_lay[h * npedge + npedge - 1] =
1407 x_c[h + 1] +
1408 delta[m] *
abs(nxPhys[h * npedge + npedge - 1]);
1409 }
1410 else if (h == nedges - 1)
1411 {
1412
1413 tmpy_lay[h * npedge + 0] =
1414 y_c[h] + delta[m] *
abs(nyPhys[h * npedge + 0]);
1415 tmpx_lay[h * npedge + 0] =
1416 x_c[h] + delta[m] *
abs(nxPhys[h * npedge + 0]);
1417
1418 tmpy_lay[h * npedge + npedge - 1] =
1419 y_c[h + 1] + delta[m];
1420 tmpx_lay[h * npedge + npedge - 1] =
1421 xnew[lay_Vids[m][h + 1]];
1422 }
1423 else
1424 {
1425
1426 tmpy_lay[h * npedge + 0] =
1427 y_c[h] + delta[m] *
abs(nyPhys[h * npedge + 0]);
1428 tmpx_lay[h * npedge + 0] =
1429 x_c[h] + delta[m] *
abs(nxPhys[h * npedge + 0]);
1430
1431 tmpy_lay[h * npedge + npedge - 1] =
1432 y_c[h + 1] +
1433 delta[m] *
abs(nyPhys[h * npedge + npedge - 1]);
1434 tmpx_lay[h * npedge + npedge - 1] =
1435 x_c[h + 1] +
1436 delta[m] *
abs(nxPhys[h * npedge + npedge - 1]);
1437 }
1438
1439
1440 for (
int d = 0;
d < npedge - 2;
d++)
1441 {
1442
1443 tmpy_lay[h * npedge +
d + 1] =
1444 ycPhysMOD[h * npedge +
d + 1] +
1445 delta[m] *
abs(nyPhys[h * npedge +
d + 1]);
1446
1447
1448 tmpx_lay[h * npedge +
d + 1] =
1449 xcPhysMOD[h * npedge +
d + 1] +
1450 delta[m] *
abs(nxPhys[h * npedge +
d + 1]);
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463 }
1464 }
1465 }
1466 }
1467
1468 for (int s = 0; s < np_lay; s++)
1469 {
1470 cout << tmpx_lay[s] << " " << tmpy_lay[s] << endl;
1471 }
1473 cout << "fisrt interp" << endl;
1474 for (int s = 0; s < np_lay; s++)
1475 {
1476 cout << tmpx_lay[s] << " " << tmpy_lay[s] << endl;
1477 }
1478
1479
1480
1481
1482
1483
1484
1485
1486
1488 NekDouble boundright = xcPhysMOD[np_lay - 1];
1489 bool outboundleft = false;
1490 bool outboundright = false;
1491 if (tmpx_lay[1] < boundleft)
1492 {
1493 outboundleft = true;
1494 }
1495 if (tmpx_lay[np_lay - 2] > boundright)
1496 {
1497 outboundright = true;
1498 }
1499
1500 int outvert = 0;
1501 int outmiddle = 0;
1502 int outcount = 0;
1503
1505 for (int r = 0; r < nedges; r++)
1506 {
1507
1508 if (tmpx_lay[r * npedge + npedge - 1] < boundleft &&
1509 outboundleft == true)
1510 {
1511 vertout[outvert] = r;
1512 outvert++;
1513
1514 if (r < nedges - 1)
1515 {
1516
1517 if (tmpx_lay[(r + 1) * npedge + npedge - 1] > boundleft)
1518 {
1519 for (int s = 0; s < npedge - 2; s++)
1520 {
1521 if (tmpx_lay[(r + 1) * npedge + s + 1] <
1522 boundleft)
1523 {
1524 outmiddle++;
1525 }
1526 }
1527 }
1528 }
1529 }
1530
1531 if (tmpx_lay[r * npedge + 0] > boundright &&
1532 outboundright == true)
1533 {
1534 vertout[outvert] = r;
1535 outvert++;
1536
1537 if (r > 0)
1538 {
1539
1540 if (tmpx_lay[(r - 1) * npedge + 0] < boundright)
1541 {
1542 for (int s = 0; s < npedge - 2; s++)
1543 {
1544 if (tmpx_lay[(r - 1) * npedge + s + 1] >
1545 boundright)
1546 {
1547 outmiddle++;
1548 }
1549 }
1550 }
1551 }
1552 }
1553 }
1554
1555
1556 outcount = outvert * npedge + 1 + outmiddle;
1557
1558 int replacepointsfromindex = 0;
1559 for (int c = 0; c < nedges; c++)
1560 {
1561
1562 if (xcPhysMOD[c * npedge + npedge - 1] <=
1563 tmpx_lay[c * (npedge - (npedge - 2)) + 2] &&
1564 outboundright == true)
1565 {
1566 replacepointsfromindex = c * (npedge - (npedge - 2)) + 2;
1567 break;
1568 }
1569
1570
1571 if (xcPhysMOD[(nedges - 1 - c) * npedge + 0] >=
1572 tmpx_lay[np_lay - 1 -
1573 (c * (npedge - (npedge - 2)) + 2)] &&
1574 outboundleft == true)
1575 {
1576 replacepointsfromindex =
1577 np_lay - 1 - (c * (npedge - (npedge - 2)) + 2);
1578 break;
1579 }
1580 }
1581
1582
1583
1584
1585
1586 if (outcount > 1)
1587 {
1588
1589
1590 int pstart, shift;
1592
1593 if (outboundright == true)
1594 {
1595 pstart = replacepointsfromindex;
1596 shift = np_lay - outcount;
1597 increment =
1598 (xcPhysMOD[np_lay - outcount] - xcPhysMOD[pstart]) /
1599 (outcount + 1);
1600 outcount = outcount - 1;
1601 ASSERTL0(tmpx_lay[np_lay - outcount] >
1602 xcPhysMOD[(nedges - 1) * npedge + 0],
1603 "no middle points in the last edge");
1604 }
1605 else
1606 {
1607 shift = 1;
1608 pstart = outcount - 1;
1609 increment = (xcPhysMOD[replacepointsfromindex] -
1610 xcPhysMOD[pstart]) /
1611 (outcount + 1);
1613 xcPhysMOD[0 * npedge + npedge - 1],
1614 "no middle points in the first edge");
1615 }
1616
1617
1620
1627
1631 NekDouble xctmp, ycinterp, nxinterp, nyinterp;
1632
1633 for (int v = 0; v < outcount; v++)
1634 {
1635 xctmp = xcPhysMOD[pstart] + (v + 1) * increment;
1636
1637
1639
1640
1641
1643 closeny);
1644
1645
1647
1648
1649 nxinterp =
sqrt(
abs(1 - nyinterp * nyinterp));
1650
1651
1653 closey);
1654
1656
1657 replace_x[v] = xctmp + delta[m] *
abs(nxinterp);
1658 replace_y[v] = ycinterp + delta[m] *
abs(nyinterp);
1659 tmpx_lay[v + shift] = replace_x[v];
1660 tmpy_lay[v + shift] = replace_y[v];
1661
1662
1663
1664 }
1665 }
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680 int closepoints = 4;
1681
1684
1685
1686 int pointscount = 0;
1687 for (
int q = 0;
q < np_lay;
q++)
1688 {
1689 for (int e = 0; e < nedges; e++)
1690 {
1691 if (tmpx_lay[
q] <= x_c[e + 1] && tmpx_lay[
q] >= x_c[e])
1692 {
1693 pointscount++;
1694 }
1695 if (
q == e * npedge + npedge - 1 && pointscount != npedge)
1696 {
1697
1698 pointscount = 0;
1699 }
1700 else if (
q == e * npedge + npedge - 1)
1701 {
1702 pointscount = 0;
1703 }
1704 }
1705 }
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1721 lay_Vids[m], layers_x[m], layers_y[m], xnew,
1722 ynew);
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
1800
1801 if (curv_lay == true)
1802 {
1803
1804
1805
1806
1807 }
1808
1809
1810 int npoints = npedge;
1813 for (int f = 0; f < nedges; f++)
1814 {
1815 int polyorder = 2;
1816
1818
1820 &xPedges[0], 1);
1822 &yPedges[0], 1);
1823
1824 PolyFit(polyorder, npoints, xPedges, yPedges, coeffsinterp,
1825 xPedges, yPedges, npoints);
1826
1827
1829 &layers_y[m][(f)*npedge + 0], 1);
1830
1831
1832 layers_y[m][f * npedge + 0] = ynew[lay_Vids[m][f]];
1833 layers_y[m][f * npedge + npedge - 1] = ynew[lay_Vids[m][f + 1]];
1834 }
1835
1836 cout << " xlay ylay lay:" << m << endl;
1837 for (int l = 0; l < np_lay; l++)
1838 {
1839
1840 cout << std::setprecision(8) << layers_x[m][l] << " "
1841 << layers_y[m][l] << endl;
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
1876
1877 cout << "lay=" << m << endl;
1880 " different layer ymin val");
1883 " different layer ymax val");
1886 " different layer xmin val");
1889 " different layer xmax val");
1890 }
1891
1892
1893
1894
1895
1896
1897
1899 npedge, graphShPt, xold_c, yold_c, xold_low, yold_low, xold_up,
1900 yold_up, layers_x[0], layers_y[0], layers_x[nlays - 1],
1901 layers_y[nlays - 1], nxPhys, nyPhys, xnew, ynew);
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
1978 }
1979 else
1980 {
1982 Down, Up, xnew, ynew, layers_x, layers_y);
1983 }
1984
1985
1987
1988
1989
1990
1991
1992 cout << std::setprecision(8) <<
"xmin=" <<
Vmath::Vmin(nVertTot, xnew, 1)
1993 << endl;
1995 " different xmin val");
1997 " different ymin val");
1999 " different xmax val");
2001 " different ymax val");
2002
2003
2004
2006 charalp, layers_x, layers_y, lay_Eids, curv_lay);
2007}
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)