Skip to content
Snippets Groups Projects
Commit d73f3df4 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/small-fixes-newton' into 'master'

Feature/small fixes newton

See merge request !756
parents f8491cde 8a4a440b
No related branches found
No related tags found
1 merge request!756Feature/small fixes newton
......@@ -206,7 +206,7 @@ public:
* \param u The initial solution
*/
template<class SolutionVector>
void newtonBegin(const SolutionVector &u)
void newtonBegin(const SolutionVector& u)
{
numSteps_ = 0;
}
......@@ -214,7 +214,8 @@ public:
/*!
* \brief Indicates the beginning of a Newton iteration.
*/
void newtonBeginStep()
template<class SolutionVector>
void newtonBeginStep(const SolutionVector& u)
{
lastShift_ = shift_;
if (numSteps_ == 0)
......@@ -546,7 +547,7 @@ protected:
}
template<class JacobianAssembler, class SolutionVector>
void lineSearchUpdate_(const JacobianAssembler& assembler,
void lineSearchUpdate_(JacobianAssembler& assembler,
SolutionVector &uCurrentIter,
const SolutionVector &uLastIter,
const SolutionVector &deltaU)
......
......@@ -81,12 +81,11 @@ public:
* The controller is responsible for all the strategic decisions.
*/
template<class SolutionVector, class ConvergenceWriter = ConvergenceWriterInferface>
bool solve(SolutionVector& u, const std::unique_ptr<ConvergenceWriter>& convWriter = nullptr)
bool solve(SolutionVector& uCurrentIter, const std::unique_ptr<ConvergenceWriter>& convWriter = nullptr)
{
try
{
// the given solution is the initial guess
SolutionVector& uCurrentIter = u;
SolutionVector uLastIter(uCurrentIter);
SolutionVector deltaU(uCurrentIter);
......@@ -103,7 +102,7 @@ public:
{
// notify the controller that we're about to start
// a new timestep
controller_->newtonBeginStep();
controller_->newtonBeginStep(uCurrentIter);
// make the current solution to the old one
if (controller_->newtonNumSteps() > 0)
......@@ -120,7 +119,7 @@ public:
// linearize the problem at the current solution
assembleTimer.start();
controller_->assembleLinearSystem(*assembler_, u);
controller_->assembleLinearSystem(*assembler_, uCurrentIter);
assembleTimer.stop();
///////////////
......@@ -182,7 +181,7 @@ public:
// reset state if newton failed
if (!controller_->newtonConverged())
{
controller_->newtonFail(*assembler_, u);
controller_->newtonFail(*assembler_, uCurrentIter);
return false;
}
......@@ -204,7 +203,7 @@ public:
{
if (controller_->verbose())
std::cout << "Newton: Caught exception: \"" << e.what() << "\"\n";
controller_->newtonFail(*assembler_, u);
controller_->newtonFail(*assembler_, uCurrentIter);
return false;
}
}
......
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