40 #define anm(N_, M_) this->stencil[(N_) * this->method->q + (M_)]
62 method->
p * (method->
p + 1) / 2);
90 for (indx = 0, i = 0; i < this->method->q; i++) {
91 for (j = 0; j < this->method->q; j++) {
92 this->stencil[indx++] = va_arg (ap,
double);
102 if (this->method->set_coeffs != NULL) {
103 this->method->set_coeffs (
this);
118 int ir,
int iz,
int itheta)
123 assert (ar->
ntheta > itheta);
126 for (indx = 0, i = 0; i < this->method->q; i++) {
128 if (this->method->masses) {
129 r =
cyl_r_at (ir + i - this->method->ir0, grid->level);
134 ap =
RZTP (ar, ir + i - this->method->ir0,
135 iz - this->method->iz0, itheta);
137 for (j = 0; j < this->method->q; j++, ap += ar->
strides[
Z_INDX]) {
149 if (this->method->set_coeffs != NULL) {
150 this->method->set_coeffs (
this);
168 matrix = this->method->matrix;
173 for (ip = 0, pindx = 0, mindx = 0; ip < this->method->p; ip++) {
174 Lrn[ip + 1] = Lrn[ip] * this->Lr;
175 Lzn[ip + 1] = Lzn[ip] * this->Lz;
176 for (n = 0; n <= ip; n++) {
180 for (j = 0; j < this->method->q * this->method->q; j++)
181 sum += matrix[mindx++] * this->stencil[j];
183 this->coeffs[pindx++] = sum / Lrn[
n] / Lzn[ip -
n];
195 if (this->method->apply != NULL) {
196 result = this->method->apply (
this, r, z);
202 if (this->method->masses) {
203 return result /
cyl_q(r);
213 double deltar, deltaz, sum;
215 deltar = r - this->r0;
216 deltaz = z - this->z0;
218 int ipmax=this->method->p;
220 fprintf(stdout,
"ipmax=%d\n",ipmax);
221 fatal(
"interpol2: order interpolation not equal to 3\n");
224 if (deltar==deltaz) {
225 sum = this->coeffs[0] +
226 deltar * (this->coeffs[1] +
228 deltar * (this->coeffs[3] +
234 sum = this->coeffs[0] +
235 deltaz * (this->coeffs[1] + deltaz * this->coeffs[3]) +
236 deltar * (this->coeffs[2] +
237 deltaz * this->coeffs[4] +
238 deltar * this->coeffs[5] );
261 {-0.1111111111111111, 0.2222222222222222, -0.1111111111111111,
262 0.2222222222222222, 0.5555555555555556, 0.2222222222222222,
263 -0.1111111111111111, 0.2222222222222222, -0.1111111111111111,
264 -0.1666666666666667, 0 , 0.1666666666666667,
265 -0.1666666666666667, 0 , 0.1666666666666667,
266 -0.1666666666666667, 0 , 0.1666666666666667,
267 -0.1666666666666667, -0.1666666666666667, -0.1666666666666667,
269 0.1666666666666667, 0.1666666666666667, 0.1666666666666667,
270 0.1666666666666667, -0.3333333333333333, 0.1666666666666667,
271 0.1666666666666667, -0.3333333333333333, 0.1666666666666667,
272 0.1666666666666667, -0.3333333333333333, 0.1666666666666667,
277 0.1666666666666667, 0.1666666666666667, 0.1666666666666667,
278 -0.3333333333333333, -0.3333333333333333, -0.3333333333333333,
279 0.1666666666666667, 0.1666666666666667, 0.1666666666666667
297 -0.1666666666666667, 0 , 0.1666666666666667,
298 -0.1666666666666667, 0 , 0.1666666666666667,
299 -0.1666666666666667, 0 , 0.1666666666666667,
300 -0.1666666666666667, -0.1666666666666667, -0.1666666666666667,
302 0.1666666666666667, 0.1666666666666667, 0.1666666666666667,
323 { -0.01880341880341880 , -0.008547008547008547, -0.01880341880341880 ,
324 -0.008547008547008547, 1.109401709401709 , -0.008547008547008547,
325 -0.01880341880341880 , -0.008547008547008547, -0.01880341880341880 ,
326 -0.1666666666666667 , 0 , 0.1666666666666667 ,
327 -0.1666666666666667 , 0 , 0.1666666666666667 ,
328 -0.1666666666666667 , 0 , 0.1666666666666667 ,
329 -0.1666666666666667 , -0.1666666666666667 , -0.1666666666666667 ,
331 0.1666666666666667 , 0.1666666666666667 , 0.1666666666666667 ,
332 0.1128205128205128 , -0.1987179487179487 , 0.1128205128205128 ,
333 0.3012820512820513 , -0.6564102564102564 , 0.3012820512820513 ,
334 0.1128205128205128 , -0.1987179487179487 , 0.1128205128205128 ,
338 0.1128205128205128 , 0.3012820512820513 , 0.1128205128205128 ,
339 -0.1987179487179487 , -0.6564102564102564 , -0.1987179487179487 ,
340 0.1128205128205128 , 0.3012820512820513 , 0.1128205128205128 };
352 { 1.0, 0.0, 0.0, 0.0,
356 1.0, -1.0, -1.0, 1.0,
374 c[1] = (
anm(0, 1) -
anm(0, 0)) / Lz;
375 c[2] = (
anm(1, 0) -
anm(0, 0)) / Lr;
377 c[4] = (
anm(0, 0) -
anm(1, 0) -
anm(0, 1) +
anm(1, 1)) / Lr / Lz;
392 return c[0] + d_z * (c[1] + c[4] * d_r) + c[2] * d_r;
414 for (indx = 0, i = 0; i < this->method->q; i++) {
415 for (j = 0; j < this->method->q; j++) {
416 this->stencil[indx] = log (this->stencil[indx]);