50 int nq = streak->GetTotPoints();
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));
69 int elmtid, offset, cnt;
79 for (
int e = 0; e < npts; e++)
91 while ((
abs(F) > ConvTol) && (cnt < maxiter))
93 elmtid = streak->GetExpIndex(coord, CoordTol);
94 offset = streak->GetPhys_Offset(elmtid);
96 U = streak->GetExp(elmtid)->PhysEvaluate(coord, streak->GetPhys() +
99 streak->GetExp(elmtid)->PhysEvaluate(coord, derstreak + offset);
101 coord[1] = coord[1] - (U - cr) / dU;
106 ASSERTL0(cnt < maxiter,
"Failed to converge Newton iteration");
115 FILE *fp = fopen(
"interfacedat.geo",
"w");
121 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++, x_min,
123 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++, x_max,
125 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++, x_max,
127 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++, x_min,
130 for (i = 0; i < npts; ++i)
132 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++,
140 fp = fopen(
"interfacedat_up.geo",
"w");
144 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++, xc[0],
147 for (i = 1; i < npts - 1; ++i)
149 norm =
sqrt((xc[i + 1] - xc[i - 1]) * (xc[i + 1] - xc[i - 1]) +
150 (yc[i + 1] - yc[i - 1]) * (yc[i + 1] - yc[i - 1]));
151 nx = (yc[i - 1] - yc[i + 1]) / norm;
152 ny = (xc[i + 1] - xc[i - 1]) / norm;
154 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++,
155 xc[i] + nx * trans, yc[i] + ny * trans);
158 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++,
159 xc[npts - 1], yc[npts - 1] + trans);
163 fp = fopen(
"interfacedat_dn.geo",
"w");
167 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++, xc[0],
170 for (i = 1; i < npts - 1; ++i)
172 norm =
sqrt((xc[i + 1] - xc[i - 1]) * (xc[i + 1] - xc[i - 1]) +
173 (yc[i + 1] - yc[i - 1]) * (yc[i + 1] - yc[i - 1]));
174 nx = (yc[i - 1] - yc[i + 1]) / norm;
175 ny = (xc[i + 1] - xc[i - 1]) / norm;
177 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++,
178 xc[i] + nx * trans, yc[i] + ny * trans);
181 fprintf(fp,
"Point(%d)={%12.10lf,%12.10lf,0,1.0}; \n", cnt++,
182 xc[npts - 1], yc[npts - 1] + trans);
#define ASSERTL0(condition, msg)
std::shared_ptr< ExpList > ExpListSharedPtr
Shared pointer to an ExpList object.
static const NekDouble kNekUnsetDouble
T Vmin(int n, const T *x, const int incx)
Return the minimum element in x - called vmin to avoid conflict with min.
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 > abs(scalarT< T > in)
scalarT< T > sqrt(scalarT< T > in)