* 30, i.e. do a restart every 30
* iterations.
*/
- AdditionalData (const unsigned int restart_parameter = 30);
+ AdditionalData (const unsigned int restart_parameter = 30,
+ const bool right_preconditioning = false);
/**
* Maximum number of
* tmp vectors.
*/
unsigned int restart_parameter;
+
+ /**
+ * Flag for right
+ * preconditioning.
+ */
+ bool right_preconditioning;
};
/**
*/
SolverGMRES (SolverControl &cn,
const MPI_Comm &mpi_communicator = PETSC_COMM_SELF,
- const AdditionalData &data = AdditionalData(30));
+ const AdditionalData &data = AdditionalData(30,false));
protected:
/**
/* ---------------------- SolverGMRES ------------------------ */
SolverGMRES::AdditionalData::
- AdditionalData (const unsigned int restart_parameter)
+ AdditionalData (const unsigned int restart_parameter,
+ const bool right_preconditioning)
:
- restart_parameter (restart_parameter)
+ restart_parameter (restart_parameter),
+ right_preconditioning (right_preconditioning)
{}
ierr = (*fun_ptr)(ksp,additional_data.restart_parameter);
AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ // Set preconditioning side to
+ // right
+ if (additional_data.right_preconditioning)
+ {
+ ierr = KSPSetPreconditionerSide(ksp, PC_RIGHT);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+ }
}