diff --git a/src/one-body-sample.cc b/src/one-body-sample.cc index 9fc19e0b9b338e355a36f964adae56be3dd20585..e3a1969065deba273eca5035f3b776c8fa7e83d1 100644 --- a/src/one-body-sample.cc +++ b/src/one-body-sample.cc @@ -198,8 +198,8 @@ int main(int argc, char *argv[]) { VectorType u_diff(finestSize); u_diff = 0.0; // Has to be zero! - auto alpha_new = Dune::make_shared<SingletonVectorType>(finestSize); - *alpha_new = alpha_old; + auto alpha = Dune::make_shared<SingletonVectorType>(finestSize); + *alpha = alpha_old; SingletonVectorType vonMisesStress; VectorType rhs; @@ -268,8 +268,7 @@ int main(int argc, char *argv[]) { ++state_fpi) { auto myGlobalNonlinearity = assemble_nonlinearity<MatrixType, VectorType>( - parset.sub("boundary.friction"), nodalIntegrals, alpha_new, - h); + parset.sub("boundary.friction"), nodalIntegrals, alpha, h); MyConvexProblemType const myConvexProblem(stiffnessMatrix, *myGlobalNonlinearity, rhs); @@ -295,12 +294,11 @@ int main(int argc, char *argv[]) { switch (parset.get<Config::state_model>( "boundary.friction.state.model")) { case Config::Dieterich: - (*alpha_new)[i] = + (*alpha)[i] = state_update_dieterich(h, unorm / L, alpha_old[i]); break; case Config::Ruina: - (*alpha_new)[i] = - state_update_ruina(h, unorm / L, alpha_old[i]); + (*alpha)[i] = state_update_ruina(h, unorm / L, alpha_old[i]); break; } } @@ -319,7 +317,7 @@ int main(int argc, char *argv[]) { if (parset.get<bool>("writeEvolution")) { double out; neumannFunction.evaluate(time, out); - octave_writer << (*alpha_new)[first_frictional_node][0] << " " + octave_writer << (*alpha)[first_frictional_node][0] << " " << u[first_frictional_node][0] * 1e6 << " " << out << std::endl; } @@ -330,7 +328,7 @@ int main(int argc, char *argv[]) { if (parset.get<bool>("printVelocitySteppingComparison")) { double const v = u_diff[first_frictional_node].two_norm() / h / L; - double const euler = (*alpha_new)[first_frictional_node]; + double const euler = (*alpha)[first_frictional_node]; double direct; if (run < 120) { direct = euler; @@ -353,7 +351,7 @@ int main(int argc, char *argv[]) { // Record the coefficient of friction at a fixed node if (parset.get<bool>("printCoefficient")) { double const V = u_diff[first_frictional_node].two_norm(); - double const state = (*alpha_new)[first_frictional_node]; + double const state = (*alpha)[first_frictional_node]; coefficient_writer << (mu + a * std::log(V * eta) + b * (state - std::log(eta * L))) << std::endl; @@ -361,7 +359,7 @@ int main(int argc, char *argv[]) { } u += u_diff; - alpha_old = *alpha_new; + alpha_old = *alpha; // Compute von Mises stress and write everything to a file if (parset.get<bool>("writeVTK")) { @@ -373,7 +371,7 @@ int main(int argc, char *argv[]) { .assemble(localStressAssembler, vonMisesStress, true); writeVtk<P1Basis, P0Basis, VectorType, SingletonVectorType, GridView>( - p1Basis, u, *alpha_new, p0Basis, vonMisesStress, leafView, + p1Basis, u, *alpha, p0Basis, vonMisesStress, leafView, (boost::format("obs%d") % run).str()); } }