42 Array<OneD, NekDouble> &xc,
43 Array<OneD, NekDouble> &yc,
48 int npts = xc.num_elements();
50 int nq = streak->GetTotPoints();
51 Array<OneD, NekDouble> derstreak(nq);
52 Array<OneD, NekDouble> x(nq);
53 Array<OneD, NekDouble> y(nq);
54 streak->GetCoords(x,y);
56 streak->BwdTrans(streak->GetCoeffs(),streak->UpdatePhys());
63 for(i = 0; i <
npts; ++i)
65 xc[i] = x_min + (x_max - x_min)*i/((
NekDouble)(npts-1));
70 int elmtid, offset,cnt;
76 Array<OneD, NekDouble> coord(2);
80 for(
int e=0; e<
npts; e++)
92 while((abs(F)> ConvTol)&&(cnt < maxiter))
94 elmtid = streak->GetExpIndex(coord,CoordTol);
95 offset = streak->GetPhys_Offset(elmtid);
97 U = streak->GetExp(elmtid)->PhysEvaluate(coord, streak->GetPhys() + offset);
98 dU = streak->GetExp(elmtid)->PhysEvaluate(coord, derstreak + offset);
100 coord[1] = coord[1] - (U-cr)/dU;
105 ASSERTL0(cnt < maxiter,
"Failed to converge Newton iteration");
114 FILE *fp = fopen(
"interfacedat.geo",
"w");
120 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
122 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
124 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
126 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
129 for(i = 0; i <
npts; ++i)
131 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
139 fp = fopen(
"interfacedat_up.geo",
"w");
144 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",cnt++,xc[0],yc[0]+trans);
146 for(i = 1; i < npts-1; ++i)
148 norm = sqrt((xc[i+1]-xc[i-1])*(xc[i+1]-xc[i-1])+(yc[i+1]-yc[i-1])*(yc[i+1]-yc[i-1]));
149 nx = (yc[i-1]-yc[i+1])/norm;
150 ny = (xc[i+1]-xc[i-1])/norm;
152 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
153 cnt++,xc[i]+nx*trans,yc[i]+ny*trans);
156 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",cnt++,xc[npts-1],yc[npts-1]+trans);
160 fp = fopen(
"interfacedat_dn.geo",
"w");
164 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",cnt++,xc[0],yc[0]+trans);
166 for(i = 1; i < npts-1; ++i)
168 norm = sqrt((xc[i+1]-xc[i-1])*(xc[i+1]-xc[i-1])+(yc[i+1]-yc[i-1])*(yc[i+1]-yc[i-1]));
169 nx = (yc[i-1]-yc[i+1])/norm;
170 ny = (xc[i+1]-xc[i-1])/norm;
172 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",
173 cnt++,xc[i]+nx*trans,yc[i]+ny*trans);
176 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n",cnt++,xc[npts-1],yc[npts-1]+trans);