40 printf(
"Species-lookup-failure: %s!\n",spec_name);
52 debug (3,
"react_add (...)\n");
54 printf(
"Adding reaction with table: %s\n",react->
tablefile);
64 reactions_list = react;
71 int i, ir, iz, itheta;
74 double *in = NULL, *out = NULL, eabs;
78 double e1, e2, val1, val2, log_e, res, r_mod;
79 int cnt, curr_species;
86 for (i = 0; i < react->
nin; i++) {
91 for (i = react->
nin; i < react->nin + react->
nout; i++) {
95 #pragma omp parallel private(ir, iz, i, in, out)
99 in = (
double *)
xmalloc (
sizeof(
double) * react->
nin);
104 if (react->
nout > 0) {
105 out = (
double *)
xmalloc (
sizeof(
double) * (react->
nout + react->
nin));
122 eabs = fabs (
RZT(grid_eabs, ir, iz, itheta));
123 for (i = 0; i < react->
nin; i++) {
124 in[
i] = fabs (
RZT(grid_in[i], ir, iz, itheta));
131 if (log_e < react->rt->e_min) {
140 e2 = e1 * pow(10, react->
rt->
e_step);
142 rate = val1 + ((val2 - val1) / (e2 - e1)) * (eabs - e1);
145 for (i = 0; i < react->
nin; i++){ rate *=
MYMAX(0, in[i]); }
147 for (i = 0; i < react->
nin + react->
nout; i++) {
148 if (i < react->nin) {
149 curr_species = react->
input[
i]; r_mod = -rate;
150 }
else { curr_species = react->
output[i - react->
nin]; r_mod = rate; }
152 if (
spec_index[curr_species]->charge != 0.0) {
153 RZT(grid_out[i], ir, iz, itheta) += r_mod;
182 int ir, iz, itheta,
i;
186 RZT(grid->
d_dens[i], ir, iz, itheta) = 0.0;
203 for (react = reactions_list; react; react = react->
next) {
231 #define EPS_EABS 1e-6