| 23 | : clusterMapping_(std::move(mapping)), sources_(std::move(sources)) {} |
| 24 | |
| 25 | void PointSourceClusterOnHost::addTimeIntegratedPointSources( |
| 26 | double from, double to, seissol::parallel::runtime::StreamRuntime& runtime) { |
| 27 | auto& mapping = clusterMapping_->cellToSources; |
| 28 | if (mapping.size() > 0) { |
| 29 | #ifdef _OPENMP |
| 30 | #pragma omp parallel for schedule(static) |
| 31 | #endif |
| 32 | for (unsigned m = 0; m < mapping.size(); ++m) { |
| 33 | const unsigned startSource = mapping[m].pointSourcesOffset; |
| 34 | const unsigned endSource = mapping[m].pointSourcesOffset + mapping[m].numberOfPointSources; |
| 35 | if (sources_->mode == sourceterm::PointSourceMode::Nrf) { |
| 36 | for (unsigned source = startSource; source < endSource; ++source) { |
| 37 | addTimeIntegratedPointSourceNRF(source, from, to, *mapping[m].dofs); |
| 38 | } |
| 39 | } else { |
| 40 | for (unsigned source = startSource; source < endSource; ++source) { |
| 41 | addTimeIntegratedPointSourceFSRM(source, from, to, *mapping[m].dofs); |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | unsigned PointSourceClusterOnHost::size() const { return sources_->numberOfSources; } |
| 49 | |