| 45 | } |
| 46 | |
| 47 | static void array_to_fields(const complex<realnum> *x, fields &f) { |
| 48 | size_t ix = 0; |
| 49 | for (int i = 0; i < f.num_chunks; i++) |
| 50 | if (f.chunks[i]->is_mine()) FOR_COMPONENTS(c) { |
| 51 | if (is_D(c) || is_B(c)) { |
| 52 | realnum *fr, *fi; |
| 53 | #define COPY_TO_FIELD(fld) \ |
| 54 | if ((fr = f.chunks[i]->fld[0]) && (fi = f.chunks[i]->fld[1])) \ |
| 55 | LOOP_OVER_VOL_OWNED(f.chunks[i]->gv, c, idx) { \ |
| 56 | fr[idx] = real(x[ix]); \ |
| 57 | fi[idx] = imag(x[ix++]); \ |
| 58 | } |
| 59 | COPY_TO_FIELD(f[c]); |
| 60 | COPY_TO_FIELD(f_u[c]); |
| 61 | COPY_TO_FIELD(f_cond[c]); |
| 62 | COPY_TO_FIELD(f_bfast[c]); |
| 63 | component c2 = field_type_component(is_D(c) ? E_stuff : H_stuff, c); |
| 64 | COPY_TO_FIELD(f_w[c2]); |
| 65 | if (f.chunks[i]->f_w[c2][0]) COPY_TO_FIELD(f[c2]); |
| 66 | #undef COPY_TO_FIELD |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | f.step_boundaries(D_stuff); |
| 71 | f.update_eh(E_stuff, true); |
| 72 | f.step_boundaries(E_stuff); |
| 73 | |
| 74 | /* done in f.step before updating D: |
| 75 | f.step_boundaries(B_stuff); |
| 76 | f.update_eh(H_stuff); |
| 77 | f.step_boundaries(H_stuff); */ |
| 78 | } |
| 79 | |
| 80 | typedef struct { |
| 81 | size_t n; |
no test coverage detected