39 namespace LibUtilities
63 NekDouble out[2][2] = {{1.0, 0.0}, {-1.0, 1.0}};
68 out_final[i][j] = out[i][j];
75 {0.5, 0.0, 0.0}, {-1.0, 1.0, 0.5}, {0.5, -1.0, 0.5}};
80 out_final[i][j] = out[i][j];
86 NekDouble out[4][4] = {{1.0 / 6.0, 0, 0, 0},
87 {-0.5, 0.5, 0.5, 1.0 / 6.0},
88 {0.5, -1.0, 0, 2.0 / 3},
89 {-1.0 / 6.0, 0.5, -0.5, 1.0 / 6.0}};
94 out_final[i][j] = out[i][j];
101 {1.0 / 24.0, 0, 0, 0, 0},
102 {-1.0 / 6, 1.0 / 6, 0.25, 1.0 / 6, 1.0 / 24},
103 {0.25, -0.5, -0.25, 0.5, 11.0 / 24},
104 {-1.0 / 6, 0.5, -0.25, -0.5, 11.0 / 24},
105 {1.0 / 24, -1.0 / 6.0, 0.25, -1.0 / 6, 1.0 / 24}};
110 out_final[i][j] = out[i][j];
117 {1.0 / 1.020, 0, 0, 0, 0, 0},
118 {-1.0 / 24, 1.0 / 24, 1.0 / 12, 1.0 / 12, 1.0 / 24, 1.0 / 120},
119 {1.0 / 12, -1.0 / 6, -1.0 / 6, 1.0 / 6, 5.0 / 12, 13.0 / 60},
120 {-1.0 / 12, 0.25, 0, -1.0 / 2, 0, 11.0 / 20},
121 {1.0 / 24, -1.0 / 6, 1.0 / 6, 1.0 / 6, -5.0 / 12, 13.0 / 60},
122 {-1.0 / 120, 1.0 / 24, -1.0 / 12, 1.0 / 12, -1.0 / 24, 1.0 / 120}};
127 out_final[i][j] = out[i][j];
133 NekDouble out[7][7] = {{1.0 / 720, 0, 0, 0, 0, 0, 0},
134 {-1.0 / 120, 1.0 / 120, 1.0 / 48, 1.0 / 36,
135 1.0 / 48, 1.0 / 120, 1.0 / 720},
136 {1.0 / 48, -1.0 / 24, -1.0 / 16, 1.0 / 36,
137 3.0 / 16, 5.0 / 24, 19.0 / 240},
138 {-1.0 / 36, 1.0 / 1.02, 1.0 / 24, -2.0 / 9,
139 -5.0 / 24, 1.0 / 3, 151.0 / 360},
140 {1.0 / 48, -1.0 / 12, 1.0 / 24, 2.0 / 9,
141 -5.0 / 24, -1.0 / 3, 151.0 / 360},
142 {-1.0 / 120, 1.0 / 24, -1.0 / 16, -1.0 / 36,
143 3.0 / 16, -5.0 / 24, 19.0 / 240},
144 {1.0 / 720, -1.0 / 120, 1.0 / 48, -1.0 / 36,
145 1.0 / 48, -1.0 / 120, 1.0 / 720}};
150 out_final[i][j] = out[i][j];
157 {1.0 / 5040, 0, 0, 0, 0, 0, 0, 0},
158 {-1.0 / 720, 1.0 / 720, 1.0 / 240, 1.0 / 144, 1.0 / 144, 1.0 / 240,
159 1.0 / 720, 1.0 / 5040},
160 {1.0 / 240, -1.0 / 120, -1.0 / 60, 0, 1.0 / 18, 1.0 / 10, 7.0 / 90,
162 {-1.0 / 144, 1.0 / 48, 1.0 / 48, -1.0 / 16, -19.0 / 144, 1.0 / 16,
163 49.0 / 144, 397.0 / 1680},
164 {1.0 / 144, -1.0 / 36, 0, 1.0 / 9, 0, -1.0 / 3, 0, 151.0 / 315},
165 {-1.0 / 240, 1.0 / 48, -1.0 / 48, -1.0 / 16, 19.0 / 144, 1.0 / 16,
166 -49.0 / 144, 397.0 / 1680},
167 {1.0 / 720, -1.0 / 120, 1.0 / 60, 0, -1.0 / 18, 1.0 / 10, -7.0 / 90,
169 {-1.0 / 5040, 1.0 / 720, -1.0 / 240, 1.0 / 144, -1.0 / 144,
170 1.0 / 240, -1.0 / 720, 1.0 / 5040}};
175 out_final[i][j] = out[i][j];
192 NekDouble out[3] = {-1.0 / 12, 7.0 / 6, -1.0 / 12};
195 out_final[i] = out[i];
200 NekDouble out[5] = {37.0 / 1920, -97.0 / 480, 437.0 / 320, -97.0 / 480,
204 out_final[i] = out[i];
209 NekDouble out[7] = {-41.0 / 7560, 311.0 / 5040, -919.0 / 2520,
210 12223.0 / 7560, -919.0 / 2520, 311.0 / 5040,
214 out_final[i] = out[i];
220 153617.0 / 92897280, -35411.0 / 1658880, 3153959.0 / 23224320,
221 -6803459.0 / 11612160, 18017975.0 / 9289728, -6803459.0 / 11612160,
222 3153959.0 / 23224320, -35411.0 / 1658880, 153617.0 / 92897280};
225 out_final[i] = out[i];
231 -4201.0 / 7983360, 30773.0 / 3991680, -20813.0 / 380160,
232 2825.0 / 11088, -1179649.0 / 1330560, 1569217.0 / 665280,
233 -1179649.0 / 1330560, 2825.0 / 11088, -20813.0 / 380160,
234 30773.0 / 3991680, -4201.0 / 7983360};
237 out_final[i] = out[i];
242 NekDouble out[13] = {13154671847.0 / 76517631590400.0,
243 -18073154507.0 / 6376469299200.0,
244 287360344573.0 / 12752938598400.0,
245 -2217732343517.0 / 19129407897600.0,
246 1240941746699.0 / 2833986355200.0,
247 -275386671493.0 / 212548976640.0,
248 2648644782397.0 / 910924185600.0,
249 -275386671493.0 / 212548976640.0,
250 1240941746699.0 / 2833986355200.0,
251 -2217732343517.0 / 19129407897600.0,
252 287360344573.0 / 12752938598400.0,
253 -18073154507.0 / 6376469299200.0,
254 13154671847.0 / 76517631590400.0};
257 out_final[i] = out[i];
263 -800993.0 / 14010796800.0, 73587167.0 / 70053984000.0,
264 -651305719.0 / 70053984000.0, 3714581677.0 / 70053984000.0,
265 -3085236289.0 / 14010796800.0, 1426328231.0 / 2001542400.0,
266 -43268401973.0 / 23351328000.0, 42401344373.0 / 11675664000.0,
267 -43268401973.0 / 23351328000.0, 1426328231.0 / 2001542400.0,
268 -3085236289.0 / 14010796800.0, 3714581677.0 / 70053984000.0,
269 -651305719.0 / 70053984000.0, 73587167.0 / 70053984000.0,
270 -800993.0 / 14010796800.0};
273 out_final[i] = out[i];
285 temp[0] = -(
k_width / 2.0) * h;
286 for (i = 1; i <
k_width + 1; i++)
288 temp[i] = temp[i - 1] + h;
297 for (i = 0; i <
k_width + 1; i++)
299 outarray[i] =
k_breaks[i] + x_value;
310 NekDouble first = ceil(inarray[0] / h) * h;
312 NekDouble last = floor(inarray[index] / h) * h;
313 int count = (int)((last - first) / h) +
316 mesh_breaks[0] = first;
317 for (j = 1; j < count; j++)
319 mesh_breaks[j] = mesh_breaks[j - 1] + h;
321 outarray = mesh_breaks;
329 int nvalues = inarray.size();
332 for (i = 0; i < nvalues; i++)
337 for (gamma = -degree; gamma <= degree; gamma++)
339 int cIndex = gamma + degree;
344 for (i = 0; i < nvalues; i++)
346 outarray[i] +=
k_coeffs[cIndex] * bs_values[i];
358 int nvalues = inarray.size();
363 for (i = 0; i < nvalues; i++)
365 inarray_cp[i] = inarray[i] - offset;
366 inarray_cp[i] = inarray_cp[i] / h;
367 int interval = (int)floor(inarray_cp[i] -
371 if (inarray_cp[i] >= min_value && inarray_cp[i] <= max_value)
378 inarray_cp[i] -= shift;
394 for (i = 0; i < deg; i++)
396 poly_value = poly_value * x_value +
b_spline[interval][i + 1];
409 for (j = 0; j < outarray.size(); j++)
411 if (mIndex >= inarray2.size())
413 outarray[j] = inarray1[kIndex];
416 else if (kIndex >= inarray1.size())
418 outarray[j] = inarray2[mIndex];
421 else if (inarray1[kIndex] < inarray2[mIndex])
423 outarray[j] = inarray1[kIndex];
428 outarray[j] = inarray2[mIndex];
#define ASSERTL0(condition, msg)
void EvaluateBspline(Array< OneD, NekDouble > inarray, NekDouble h, NekDouble offset, Array< OneD, NekDouble > &outarray)
This function evaluates the bspline at input values.
void UpdateKernelCoeffs()
This funciton updates the kernel coefficients.
void EvaluateKernel(Array< OneD, NekDouble > inarray, NekDouble h, Array< OneD, NekDouble > &outarray)
This funciton evaluates the kernel at input values.
void FindMeshUnderKernel(Array< OneD, NekDouble > &inarray, NekDouble h, Array< OneD, NekDouble > &outarray)
This funciton calculates the mesh breaks under the kernel support.
void UpdateKernelBspline()
The default destructor.
void MoveKernelCenter(NekDouble x_value, Array< OneD, NekDouble > &outarray)
This funciton moves the center of the kernel to the.
NekDouble EvaluateBsplinePoly(NekDouble x_value, int interval)
This funciton evaluates the piecewise bspline polynomial.
void UpdateKernelBreaks(NekDouble h)
This funciton updates the kernel breaks.
Array< OneD, NekDouble > k_breaks
void UpdateKernelOrder(int order)
This funciton sets the k_order variable.
Array< TwoD, NekDouble > b_spline
void UpdateKernelNumOfCoeffs()
This funciton sets the k_ncoeffs variable.
void Sort(Array< OneD, NekDouble > &inarray1, Array< OneD, NekDouble > &inarray2, Array< OneD, NekDouble > &outarray)
This funciton performs the ordered merge of.
Array< OneD, NekDouble > k_coeffs
void UpdateKernelWidth()
This funciton sets the kernel width size.
Kernel()
The default constructor.
The above copyright notice and this permission notice shall be included.