allocate fields for components required by any source on any process ... this is needed after calling the low-level fields::add_srcdata
| 506 | // allocate fields for components required by any source on any process |
| 507 | // ... this is needed after calling the low-level fields::add_srcdata |
| 508 | void fields::require_source_components() { |
| 509 | fix_boundary_sources(); // needed if add_srcdata put sources on non-owned points |
| 510 | |
| 511 | int needed[NUM_FIELD_COMPONENTS]; |
| 512 | memset(needed, 0, sizeof(needed)); |
| 513 | for (int i = 0; i < num_chunks; i++) { |
| 514 | FOR_FIELD_TYPES(ft) { |
| 515 | for (const auto &src : chunks[i]->get_sources(ft)) { |
| 516 | needed[src.c] = 1; |
| 517 | } |
| 518 | } |
| 519 | } |
| 520 | int allneeded[NUM_FIELD_COMPONENTS]; |
| 521 | am_now_working_on(MpiAllTime); |
| 522 | or_to_all(needed, allneeded, NUM_FIELD_COMPONENTS); |
| 523 | finished_working(); |
| 524 | |
| 525 | bool aniso2d = is_aniso2d(); |
| 526 | for (int c = 0; c < NUM_FIELD_COMPONENTS; ++c) |
| 527 | if (allneeded[c]) _require_component(component(c), aniso2d); |
| 528 | } |
| 529 | |
| 530 | // check if we are in 2d but anisotropy couples xy with z |
| 531 | bool fields::is_aniso2d() { |
no test coverage detected