1 // c99 -I .. vswf_single.c -lqpms -lgsl -lblas
6 int main(int argc
, char **argv
) {
7 const qpms_l_t lMax
= 2;
8 csph_t point
= {1.4554, 1.2424, 4.2545};
10 qpms_vswf_set_spec_t
*bspec
= qpms_vswf_set_spec_from_lMax(lMax
, QPMS_NORMALISATION_CONVENTION_KRISTENSSON
);
12 csphvec_t arr
[bspec
->n
];
13 qpms_uvswf_fill(arr
, bspec
, point
, QPMS_BESSEL_REGULAR
);
15 for(size_t i
= 0; i
< bspec
->n
; i
++) {
17 qpms_vswf_type_t t
; qpms_m_t m
; qpms_l_t l
;
18 qpms_uvswfi2tmn(bspec
->ilist
[i
], &t
, &m
, &l
);
19 printf("arr; l=%d,m=%+d,t=%d, @(%g,%g,%g): (%g%+gj, %g%+gj, %g%+gj)\n",
20 l
, m
, t
, creal(point
.r
), point
.theta
, point
.phi
, creal(v
.rc
), cimag(v
.rc
),
21 creal(v
.thetac
), cimag(v
.thetac
), creal(v
.phic
), cimag(v
.phic
));
22 if (t
== QPMS_VSWF_ELECTRIC
)
23 v
= qpms_vswf_single_el_csph(m
, l
, point
,QPMS_BESSEL_REGULAR
,bspec
->norm
);
25 v
= qpms_vswf_single_mg_csph(m
, l
, point
,QPMS_BESSEL_REGULAR
,bspec
->norm
);
26 printf("sgl; l=%d,m=%+d,t=%d, @(%g,%g,%g): (%g%+gj, %g%+gj, %g%+gj)\n",
27 l
, m
, t
, creal(point
.r
), point
.theta
, point
.phi
, creal(v
.rc
), cimag(v
.rc
),
28 creal(v
.thetac
), cimag(v
.thetac
), creal(v
.phic
), cimag(v
.phic
));
30 qpms_vswf_set_spec_free(bspec
);