Skip to content
Snippets Groups Projects
Commit fed4c2ae authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Do not loop over parset.get needlessly

parent 63ecbaee
No related branches found
No related tags found
No related merge requests found
...@@ -226,6 +226,12 @@ int main(int argc, char *argv[]) { ...@@ -226,6 +226,12 @@ int main(int argc, char *argv[]) {
double const h = 1.0 / timesteps; double const h = 1.0 / timesteps;
auto const &neumannFunction = functions.get("neumannCondition"); auto const &neumannFunction = functions.get("neumannCondition");
auto const &dirichletFunction = functions.get("dirichletCondition"); auto const &dirichletFunction = functions.get("dirichletCondition");
auto const L = parset.get<double>("boundary.friction.ruina.L");
auto const a = parset.get<double>("boundary.friction.ruina.a");
auto const b = parset.get<double>("boundary.friction.ruina.b");
auto const eta = parset.get<double>("boundary.friction.eta");
auto const mu = parset.get<double>("boundary.friction.mu");
for (size_t run = 1; run <= timesteps; ++run) { for (size_t run = 1; run <= timesteps; ++run) {
if (parset.get<bool>("printProgress")) { if (parset.get<bool>("printProgress")) {
std::cout << '*'; std::cout << '*';
...@@ -272,7 +278,6 @@ int main(int argc, char *argv[]) { ...@@ -272,7 +278,6 @@ int main(int argc, char *argv[]) {
for (size_t i = 0; i < frictionalNodes.size(); ++i) { for (size_t i = 0; i < frictionalNodes.size(); ++i) {
if (frictionalNodes[i][0]) { if (frictionalNodes[i][0]) {
auto const L = parset.get<double>("boundary.friction.ruina.L");
double const unorm = u4_diff[i].two_norm(); double const unorm = u4_diff[i].two_norm();
// the (logarithmic) steady state corresponding to the current // the (logarithmic) steady state corresponding to the current
...@@ -310,11 +315,6 @@ int main(int argc, char *argv[]) { ...@@ -310,11 +315,6 @@ int main(int argc, char *argv[]) {
double const V = u4_diff[i].two_norm(); double const V = u4_diff[i].two_norm();
double const state = (*s4_new)[i]; double const state = (*s4_new)[i];
auto const L = parset.get<double>("boundary.friction.ruina.L");
auto const a = parset.get<double>("boundary.friction.ruina.a");
auto const b = parset.get<double>("boundary.friction.ruina.b");
auto const eta = parset.get<double>("boundary.friction.eta");
auto const mu = parset.get<double>("boundary.friction.mu");
coefficient_writer << mu + a *std::log(V * eta) + coefficient_writer << mu + a *std::log(V * eta) +
b * (state - std::log(eta * L)) b * (state - std::log(eta * L))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment