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

Function readModelParameters

src/Initializer/Parameters/ModelParameters.cpp:39–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39ModelParameters readModelParameters(ParameterReader* baseReader) {
40 auto* reader = baseReader->readSubNode("equations");
41
42 const auto boundaryFileName = reader->readPath("boundaryfileName");
43 const std::string materialFileName =
44 reader->readPathOrFail("materialfilename", "No material file given.");
45 const bool hasBoundaryFile = !boundaryFileName.value_or("").empty();
46
47 const bool plasticity = reader->readWithDefault("plasticity", false);
48 const bool useCellHomogenizedMaterial =
49 reader->readWithDefault("usecellhomogenizedmaterial", true);
50
51 const double gravitationalAcceleration =
52 reader->readWithDefault("gravitationalacceleration", 9.81);
53 const double tv = reader->readWithDefault("tv", 0.1);
54
55 const auto freqCentral = reader->readIfRequired<double>("freqcentral", isModelViscoelastic());
56 const auto freqRatio = reader->readIfRequired<double>("freqratio", isModelViscoelastic());
57 if constexpr (isModelViscoelastic()) {
58 if (freqRatio <= 0) {
59 logError()
60 << "The freqratio parameter must be positive---but that is currently not the case.";
61 }
62 }
63
64 const ITMParameters itmParameters = readITMParameters(baseReader);
65
66 reader->warnDeprecated({"adjoint", "adjfilename", "anisotropy"});
67
68 const auto flux =
69 reader->readWithDefaultStringEnum<NumericalFlux>("numflux",
70 "godunov",
71 {
72 {"godunov", NumericalFlux::Godunov},
73 {"rusanov", NumericalFlux::Rusanov},
74 });
75
76 const auto fluxNearFault =
77 reader->readWithDefaultStringEnum<NumericalFlux>("numfluxnearfault",
78 "godunov",
79 {
80 {"godunov", NumericalFlux::Godunov},
81 {"rusanov", NumericalFlux::Rusanov},
82 });
83
84 return ModelParameters{hasBoundaryFile,
85 plasticity,
86 useCellHomogenizedMaterial,
87 freqCentral,
88 freqRatio,
89 gravitationalAcceleration,
90 tv,
91 boundaryFileName.value_or(""),
92 materialFileName,
93 itmParameters,
94 flux,
95 fluxNearFault};
96}

Callers 1

readSeisSolParametersFunction · 0.85

Calls 8

isModelViscoelasticFunction · 0.85
readITMParametersFunction · 0.85
readSubNodeMethod · 0.80
readPathMethod · 0.80
readPathOrFailMethod · 0.80
emptyMethod · 0.80
readWithDefaultMethod · 0.80
warnDeprecatedMethod · 0.80

Tested by

no test coverage detected