Skip to content

Commit 376f339

Browse files
author
Edward Palmer
committed
Moves SetSolverOptions to bottom of ConstructJacobianSolver to fix bug.
The Jacobian solver and preconditioner were not set when SetSolverOptions was called!
1 parent d52c285 commit 376f339

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/formulations/Dual/dual_formulation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,11 @@ DualOperator::ConstructJacobianSolver()
215215
auto solver = std::make_unique<mfem::HyprePCG>(_problem._comm);
216216
solver->SetPreconditioner(*precond);
217217

218-
SolverOptions default_options;
219-
SetSolverOptions(default_options);
220-
221218
_jacobian_preconditioner = std::move(precond);
222219
_jacobian_solver = std::move(solver);
220+
221+
auto default_options = SolverOptions();
222+
SetSolverOptions(default_options);
223223
}
224224

225225
void

src/formulations/HCurl/hcurl_formulation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ HCurlProblemOperator::ConstructJacobianSolver()
9898
auto solver = std::make_unique<mfem::HyprePCG>(_problem._comm);
9999
solver->SetPreconditioner(*precond);
100100

101-
SolverOptions default_options;
102-
SetSolverOptions(default_options);
103-
104101
_jacobian_preconditioner = std::move(precond);
105102
_jacobian_solver = std::move(solver);
103+
104+
auto default_options = SolverOptions();
105+
SetSolverOptions(default_options);
106106
}
107107

108108
void

src/formulations/Magnetostatic/statics_formulation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,11 @@ StaticsOperator::ConstructJacobianSolver()
109109
auto solver = std::make_unique<mfem::HypreFGMRES>(_problem._comm);
110110
solver->SetPreconditioner(*precond);
111111

112-
SolverOptions default_options{._max_iteration = 100};
113-
SetSolverOptions(default_options);
114-
115112
_jacobian_preconditioner = std::move(precond);
116113
_jacobian_solver = std::move(solver);
114+
115+
SolverOptions default_options{._max_iteration = 100};
116+
SetSolverOptions(default_options);
117117
}
118118

119119
void

src/problem_operators/problem_operator_base.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ ProblemOperatorBase::ConstructJacobianSolver()
1414
auto solver = std::make_unique<mfem::HypreGMRES>(_problem._comm);
1515
solver->SetPreconditioner(*precond);
1616

17-
SolverOptions default_options;
18-
SetSolverOptions(default_options);
19-
2017
_jacobian_preconditioner = std::move(precond);
2118
_jacobian_solver = std::move(solver);
19+
20+
auto default_options = SolverOptions();
21+
SetSolverOptions(default_options);
2222
}
2323

2424
void

0 commit comments

Comments
 (0)