MCPcopy Create free account
hub / github.com/SeisSol/SeisSol / loadSources

Method loadSources

src/SourceTerm/Manager.cpp:580–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

578namespace seissol::sourceterm {
579
580void Manager::loadSources(seissol::initializer::parameters::PointSourceType sourceType,
581 const char* fileName,
582 const seissol::geometry::MeshReader& mesh,
583 seissol::initializer::LTSTree* ltsTree,
584 seissol::initializer::LTS* lts,
585 seissol::initializer::Lut* ltsLut,
586 time_stepping::TimeManager& timeManager) {
587#ifdef ACL_DEVICE
588 auto memkind = useUSM() ? seissol::memory::DeviceUnifiedMemory : seissol::memory::Standard;
589#else
590 auto memkind = seissol::memory::Standard;
591#endif
592 auto sourceClusters =
593 std::unordered_map<LayerType, std::vector<seissol::kernels::PointSourceClusterPair>>{};
594 if (sourceType == seissol::initializer::parameters::PointSourceType::NrfSource) {
595 logInfo(seissol::MPI::mpi.rank()) << "Reading an NRF source (type 42).";
596#if defined(USE_NETCDF) && !defined(NETCDF_PASSIVE)
597 sourceClusters = loadSourcesFromNRF(fileName, mesh, ltsTree, lts, ltsLut, memkind);
598#else
599 logError() << "NRF sources (type 42) need SeisSol to be linked with an (active) Netcdf "
600 "library. However, this is not the case for this build.";
601#endif
602 } else if (sourceType == seissol::initializer::parameters::PointSourceType::FsrmSource) {
603 logInfo(seissol::MPI::mpi.rank()) << "Reading an FSRM source (type 50).";
604 sourceClusters = loadSourcesFromFSRM(fileName, mesh, ltsTree, lts, ltsLut, memkind);
605 } else if (sourceType == seissol::initializer::parameters::PointSourceType::None) {
606 logInfo(seissol::MPI::mpi.rank()) << "No source term specified.";
607 } else {
608 logError() << "The source type" << static_cast<int>(sourceType)
609 << "has been defined, but not yet been implemented in SeisSol.";
610 }
611 // otherwise, we do not have any source term.
612
613 timeManager.setPointSourcesForClusters(std::move(sourceClusters));
614}
615
616} // namespace seissol::sourceterm

Callers

nothing calls this directly

Calls 5

useUSMFunction · 0.85
loadSourcesFromNRFFunction · 0.85
loadSourcesFromFSRMFunction · 0.85
rankMethod · 0.80

Tested by

no test coverage detected