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

Remove benchmarking code

parent 14eda0a0
No related branches found
No related tags found
No related merge requests found
......@@ -187,25 +187,19 @@ int main(int argc, char *argv[]) {
VectorType u4(finestSize);
u4 = 0.0; // Has to be zero!
VectorType u5 = u4;
SingletonVectorType s4_old(finestSize);
s4_old = parset.get<double>("boundary.friction.state.initial");
SingletonVectorType s5_old = s4_old;
VectorType u4_diff(finestSize);
u4_diff = 0.0; // Has to be zero!
VectorType u5_diff = u4_diff;
auto s4_new = Dune::make_shared<SingletonVectorType>(finestSize);
*s4_new = s4_old;
auto s5_new = Dune::make_shared<SingletonVectorType>(finestSize);
*s5_new = s5_old;
SingletonVectorType vonMisesStress;
VectorType b4;
VectorType b5;
auto const nodalIntegrals =
assemble_frictional<GridType, GridView, SmallVector, P1Basis>(
......@@ -306,50 +300,6 @@ int main(int argc, char *argv[]) {
u4 += u4_diff;
s4_old = *s4_new;
if (parset.get<bool>("benchmarks.fpi.enable")) {
assemble_neumann<GridType, GridView, SmallVector, P1Basis>(
leafView, p1Basis, neumannNodes, b5,
functions.get("neumannCondition"), h * run);
stiffnessMatrix.mmv(u5, b5);
for (int state_fpi = 0;
state_fpi < parset.get<int>("benchmarks.fpi.iterations");
++state_fpi) {
auto myGlobalNonlinearity =
assemble_nonlinearity<VectorType, OperatorType>(
finestSize, parset, nodalIntegrals, s5_new, h);
MyConvexProblemType const myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b5);
MyBlockProblemType myBlockProblem(parset, myConvexProblem);
auto multigridStep = mySolver.getSolver();
multigridStep->setProblem(u5_diff, myBlockProblem);
LoopSolver<VectorType> overallSolver(
multigridStep, parset.get<size_t>("solver.tnnmg.maxiterations"),
solver_tolerance, &energyNorm, verbosity,
false); // absolute error
overallSolver.solve();
if (!parset.get<bool>("boundary.friction.state.evolve"))
continue;
for (size_t i = 0; i < frictionalNodes.size(); ++i) {
if (frictionalNodes[i][0]) {
double const L = parset.get<double>("boundary.friction.ruina.L");
double const unorm = u5_diff[i].two_norm();
(*s5_new)[i] = compute_state_update(h, unorm, L, s5_old[i]);
}
}
}
}
u5 += u5_diff;
s5_old = *s5_new;
if (parset.get<bool>("benchmarks.fpi.enable"))
std::cout << energyNorm.diff(u5, u4) / energyNorm(u5) << std::endl;
// Compute von Mises stress and write everything to a file
if (parset.get<bool>("writeVTK")) {
// Compute von Mises stress
......@@ -373,12 +323,10 @@ int main(int argc, char *argv[]) {
if (parset.get<bool>("printFrictionalBoundary")) {
// Print displacement on frictional boundary
boost::format const formatter("u4[%02d] = %+3e, "
"%|40t|u5[%02d] = %+3e");
boost::format const formatter("u4[%02d] = %+3e");
for (size_t i = 0; i < frictionalNodes.size(); ++i)
if (frictionalNodes[i][0])
std::cout << boost::format(formatter) % i % u4[i] % i % u5[i]
<< std::endl;
std::cout << boost::format(formatter) % i % u4[i] << std::endl;
}
Python::stop();
}
......
......@@ -9,10 +9,6 @@ printProgress = false
writeVTK = true
[benchmarks.fpi]
enable = false
iterations = 50
[grid]
refinements = 4
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment