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

Cleanup

parent 0e0b6830
No related branches found
No related tags found
No related merge requests found
......@@ -425,24 +425,26 @@ int main(int argc, char *argv[]) {
solver_tolerance, &energyNorm, verbosity);
overallSolver.solve();
if (parset.get<bool>("state.enable")) {
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0]) {
double const L = 1e-4; // FIXME: magic value
double const unorm = u4_diff[i].two_norm();
double ret1 =
compute_state_update_bisection(h, unorm, L, s4_old[i][0]);
assert(abs(1.0 / h * ret1 - (s4_old[i] - unorm / L) / h -
exp(-ret1)) < 1e-12);
double ret2 =
compute_state_update_lambert(h, unorm, L, s4_old[i][0]);
assert(abs(1.0 / h * ret2 - (s4_old[i] - unorm / L) / h -
exp(-ret2)) < 1e-12);
assert(abs(ret2 - ret1) < 1e-14);
(*s4_new)[i][0] = ret1;
}
if (!parset.get<bool>("state.enable"))
continue;
for (size_t i = 0; i < frictionalNodes.size(); ++i) {
if (frictionalNodes[i][0]) {
double const L = 1e-4; // FIXME: magic value
double const unorm = u4_diff[i].two_norm();
double ret1 =
compute_state_update_bisection(h, unorm, L, s4_old[i][0]);
assert(abs(1.0 / h * ret1 - (s4_old[i] - unorm / L) / h -
exp(-ret1)) < 1e-12);
double ret2 =
compute_state_update_lambert(h, unorm, L, s4_old[i][0]);
assert(abs(1.0 / h * ret2 - (s4_old[i] - unorm / L) / h -
exp(-ret2)) < 1e-12);
assert(abs(ret2 - ret1) < 1e-14);
(*s4_new)[i][0] = ret1;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment