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