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