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

u*_diff_new -> u*_diff

parent 43012c12
No related branches found
No related tags found
No related merge requests found
......@@ -246,11 +246,11 @@ int main(int argc, char *argv[]) {
VectorType u3 = u1;
VectorType u4 = u1;
VectorType u1_diff_new(grid.size(grid.maxLevel(), dim));
u1_diff_new = 0.0; // Has to be zero!
VectorType u2_diff_new = u1_diff_new;
VectorType u3_diff_new = u1_diff_new;
VectorType u4_diff_new = u1_diff_new;
VectorType u1_diff(grid.size(grid.maxLevel(), dim));
u1_diff = 0.0; // Has to be zero!
VectorType u2_diff = u1_diff;
VectorType u3_diff = u1_diff;
VectorType u4_diff = u1_diff;
CellVectorType vonMisesStress;
......@@ -288,21 +288,21 @@ int main(int argc, char *argv[]) {
stiffnessMatrix.mmv(u4, b4);
if (parset.get<bool>("useNonlinearGS")) {
MyConvexProblemType myConvexProblem(
stiffnessMatrix, *myGlobalNonlinearity, b1, u1_diff_new);
MyConvexProblemType myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b1, u1_diff);
auto myBlockProblem = new MyBlockProblemType(parset, myConvexProblem);
nonlinearGSStep.setProblem(u1_diff_new, *myBlockProblem);
nonlinearGSStep.setProblem(u1_diff, *myBlockProblem);
LoopSolver<VectorType> solver(&nonlinearGSStep, solver_maxIterations,
solver_tolerance, &energyNorm, verbosity);
solver.solve();
}
u1 += u1_diff_new;
u1 += u1_diff;
if (parset.get<bool>("useTNNMG")) {
MyConvexProblemType myConvexProblem(
stiffnessMatrix, *myGlobalNonlinearity, b4, u4_diff_new);
MyConvexProblemType myConvexProblem(stiffnessMatrix,
*myGlobalNonlinearity, b4, u4_diff);
auto myBlockProblem = new MyBlockProblemType(parset, myConvexProblem);
// {{{ Linear Solver;
......@@ -354,7 +354,7 @@ int main(int argc, char *argv[]) {
auto multigridStep =
new TNNMGStepType(*linearIterationStep, *nonlinearSmoother);
multigridStep->setProblem(u4_diff_new, *tnnmgProblem);
multigridStep->setProblem(u4_diff, *tnnmgProblem);
multigridStep->setSmoothingSteps(
parset.get<int>("solver.tnnmg.main.nu1"),
parset.get<int>("solver.tnnmg.main.mu"),
......@@ -370,7 +370,7 @@ int main(int argc, char *argv[]) {
overallSolver.solve();
}
u4 += u4_diff_new;
u4 += u4_diff;
{ // Compute von Mises stress and write everything to a file
auto *displacement =
......@@ -396,7 +396,7 @@ int main(int argc, char *argv[]) {
if (parset.get<bool>("useGS")) {
BlockGSStep<OperatorType, VectorType> blockGSStep(stiffnessMatrix,
u2_diff_new, b2);
u2_diff, b2);
blockGSStep.ignoreNodes_ = &ignoreNodes;
LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations,
......@@ -404,13 +404,13 @@ int main(int argc, char *argv[]) {
solver.solve();
}
u2 += u2_diff_new;
u2 += u2_diff;
// Use a linear solver for comparison; should return roughly the
// same results if phi vanishes (e.g. because the normalstress is zero)
if (parset.get<bool>("useTruncatedGS")) {
TruncatedBlockGSStep<OperatorType, VectorType> blockGSStep(
stiffnessMatrix, u3_diff_new, b3);
stiffnessMatrix, u3_diff, b3);
blockGSStep.ignoreNodes_ = &ignoreNodes;
LoopSolver<VectorType> solver(&blockGSStep, solver_maxIterations,
......@@ -418,7 +418,7 @@ int main(int argc, char *argv[]) {
solver.solve();
}
u3 += u3_diff_new;
u3 += u3_diff;
}
std::cout << std::endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment