/ get_field_components is a utility routine, designed to be */ called by chunkloop functions, for fetching values of field */ components at grid points, accounting for the complications */ of symmetry and yee-grid averaging. */ /
| 191 | /* of symmetry and yee-grid averaging. */ |
| 192 | /***************************************************************/ |
| 193 | chunkloop_field_components::chunkloop_field_components(fields_chunk *fc, component cgrid, |
| 194 | std::complex<double> shift_phase, |
| 195 | const symmetry &S, int sn, int num_fields, |
| 196 | const component *components) |
| 197 | : fc(fc), parent_components(num_fields), phases(num_fields), offsets(2 * num_fields), |
| 198 | values(num_fields) { |
| 199 | // for each requested component, get symmetry-parent component, yee-grid offsets, and phase shift |
| 200 | for (int nc = 0; nc < num_fields; nc++) { |
| 201 | parent_components[nc] = S.transform(components[nc], -sn); |
| 202 | phases[nc] = shift_phase * S.phase_shift(parent_components[nc], sn); |
| 203 | ptrdiff_t ofs1 = 0, ofs2 = 0; |
| 204 | if (cgrid == Centered) fc->gv.yee2cent_offsets(parent_components[nc], ofs1, ofs2); |
| 205 | offsets[2 * nc] = ofs1; |
| 206 | offsets[2 * nc + 1] = ofs2; |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | void chunkloop_field_components::update_values(ptrdiff_t idx) { |
| 211 | for (size_t nc = 0; nc < values.size(); nc++) { |
nothing calls this directly
no test coverage detected