protected:
/**
- * Auxiliary vector.
+ * A pointer to the solution vector passed to solve().
*/
VectorType *Vx;
typename VectorMemory<VectorType>::Pointer Vv;
/**
- * Right hand side vector.
+ * A pointer to the right hand side vector passed to solve().
*/
const VectorType *Vb;
print_vectors(step, *Vx, r, y);
}
while (state == SolverControl::iterate);
+
return IterationResult(false, state, step, res);
}
+
template <typename VectorType>
template <typename MatrixType, typename PreconditionerType>
void
const PreconditionerType &preconditioner)
{
LogStream::Prefix prefix("Bicgstab");
+
+ // Allocate temporary memory.
Vr = typename VectorMemory<VectorType>::Pointer(this->memory);
Vrbar = typename VectorMemory<VectorType>::Pointer(this->memory);
Vp = typename VectorMemory<VectorType>::Pointer(this->memory);
IterationResult state(false, SolverControl::failure, 0, 0);
- // iterate while the inner iteration returns a breakdown
+ // Iterate while the inner iteration returns a breakdown, i.e., try and try
+ // until we succeed.
do
{
if (step != 0)
}
while (state.breakdown == true);
- // in case of failure: throw exception
+ // Release the temporary memory again.
+ Vr.reset();
+ Vrbar.reset();
+ Vp.reset();
+ Vy.reset();
+ Vz.reset();
+ Vt.reset();
+ Vv.reset();
+
+ // In case of failure: throw exception
AssertThrow(state.state == SolverControl::success,
SolverControl::NoConvergence(state.last_step,
state.last_residual));
- // otherwise exit as normal
+ // Otherwise exit as normal
}
#endif // DOXYGEN