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

Function readSourceParameters

src/Initializer/Parameters/SourceParameters.cpp:6–25  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4namespace seissol::initializer::parameters {
5
6SourceParameters readSourceParameters(ParameterReader* baseReader) {
7 auto* reader = baseReader->readSubNode("sourcetype");
8
9 const auto type = reader->readWithDefaultEnum(
10 "type",
11 PointSourceType::None,
12 {PointSourceType::None, PointSourceType::FsrmSource, PointSourceType::NrfSource});
13 const auto fileName = [&]() -> std::string {
14 if (type == PointSourceType::None) {
15 reader->markUnused({"filename"});
16 return "";
17 } else {
18 return reader->readPathOrFail("filename",
19 "Point sources were enabled but no file was given.");
20 }
21 }();
22 reader->warnDeprecated({"rtype", "ndirac", "npulsesource", "nricker"});
23
24 return SourceParameters{type, fileName};
25}
26
27} // namespace seissol::initializer::parameters

Callers 1

readSeisSolParametersFunction · 0.85

Calls 5

readSubNodeMethod · 0.80
readWithDefaultEnumMethod · 0.80
markUnusedMethod · 0.80
readPathOrFailMethod · 0.80
warnDeprecatedMethod · 0.80

Tested by

no test coverage detected