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

Rename: solution -> u

parent afef5460
No related branches found
No related tags found
No related merge requests found
...@@ -197,7 +197,7 @@ int main(int argc, char *argv[]) { ...@@ -197,7 +197,7 @@ int main(int argc, char *argv[]) {
VectorType u_diff(finestSize); VectorType u_diff(finestSize);
u_diff = 0.0; // Has to be zero! u_diff = 0.0; // Has to be zero!
VectorType solution(finestSize); VectorType u(finestSize);
SingletonVectorType alpha_old(finestSize); SingletonVectorType alpha_old(finestSize);
alpha_old = parset.get<double>("boundary.friction.state.initial"); alpha_old = parset.get<double>("boundary.friction.state.initial");
...@@ -277,7 +277,7 @@ int main(int argc, char *argv[]) { ...@@ -277,7 +277,7 @@ int main(int argc, char *argv[]) {
timeSteppingScheme->setup(problem_rhs, problem_iterate, problem_A); timeSteppingScheme->setup(problem_rhs, problem_iterate, problem_A);
VectorType solution_saved = u_old; VectorType u_saved = u_old;
auto const state_fpi_max = auto const state_fpi_max =
parset.get<size_t>("solver.tnnmg.fixed_point_iterations"); parset.get<size_t>("solver.tnnmg.fixed_point_iterations");
for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) { for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) {
...@@ -297,7 +297,7 @@ int main(int argc, char *argv[]) { ...@@ -297,7 +297,7 @@ int main(int argc, char *argv[]) {
false); // absolute error false); // absolute error
overallSolver.solve(); overallSolver.solve();
timeSteppingScheme->extractSolution(problem_iterate, solution); timeSteppingScheme->extractSolution(problem_iterate, u);
timeSteppingScheme->extractDifference(problem_iterate, u_diff); timeSteppingScheme->extractDifference(problem_iterate, u_diff);
// Update the state // Update the state
...@@ -325,11 +325,11 @@ int main(int argc, char *argv[]) { ...@@ -325,11 +325,11 @@ int main(int argc, char *argv[]) {
std::cerr << '.'; std::cerr << '.';
std::cerr.flush(); std::cerr.flush();
} }
if (energyNorm.diff(solution_saved, solution) < if (energyNorm.diff(u_saved, u) <
parset.get<double>("solver.tnnmg.fixed_point_tolerance")) parset.get<double>("solver.tnnmg.fixed_point_tolerance"))
break; break;
else else
solution_saved = solution; u_saved = u;
if (state_fpi == state_fpi_max) if (state_fpi == state_fpi_max)
std::cerr << "[ref = " << refinements std::cerr << "[ref = " << refinements
...@@ -345,8 +345,8 @@ int main(int argc, char *argv[]) { ...@@ -345,8 +345,8 @@ int main(int argc, char *argv[]) {
double out; double out;
neumannFunction.evaluate(time, out); neumannFunction.evaluate(time, out);
octave_writer << alpha[first_frictional_node][0] << " " octave_writer << alpha[first_frictional_node][0] << " "
<< solution[first_frictional_node][0] * 1e6 << " " << u[first_frictional_node][0] * 1e6 << " " << out
<< out << std::endl; << std::endl;
} }
// Comparison with the analytic solution of a velocity stepping test // Comparison with the analytic solution of a velocity stepping test
...@@ -392,7 +392,7 @@ int main(int argc, char *argv[]) { ...@@ -392,7 +392,7 @@ int main(int argc, char *argv[]) {
std::cout << std::endl; std::cout << std::endl;
} }
u_old_old = u_old; u_old_old = u_old;
u_old = solution; u_old = u;
alpha_old = alpha; alpha_old = alpha;
// Compute von Mises stress and write everything to a file // Compute von Mises stress and write everything to a file
...@@ -400,12 +400,12 @@ int main(int argc, char *argv[]) { ...@@ -400,12 +400,12 @@ int main(int argc, char *argv[]) {
VonMisesStressAssembler<GridType> localStressAssembler( VonMisesStressAssembler<GridType> localStressAssembler(
E, nu, E, nu,
Dune::make_shared<BasisGridFunction<P1Basis, VectorType> const>( Dune::make_shared<BasisGridFunction<P1Basis, VectorType> const>(
p1Basis, solution)); p1Basis, u));
FunctionalAssembler<P0Basis>(p0Basis) FunctionalAssembler<P0Basis>(p0Basis)
.assemble(localStressAssembler, vonMisesStress, true); .assemble(localStressAssembler, vonMisesStress, true);
writeVtk<P1Basis, P0Basis, VectorType, SingletonVectorType, GridView>( writeVtk<P1Basis, P0Basis, VectorType, SingletonVectorType, GridView>(
p1Basis, solution, alpha, p0Basis, vonMisesStress, leafView, p1Basis, u, alpha, p0Basis, vonMisesStress, leafView,
(boost::format("obs%d") % run).str()); (boost::format("obs%d") % run).str());
} }
} }
......
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