struct AdditionalData
{
/**
- * Constructor.
+ * Constructor. (Default values
+ * taken from function PCCreate_LU
+ * of the PetSC lib.)
*/
- AdditionalData ();
+ AdditionalData (const double pivoting = 1.e-6,
+ const double zero_pivot = 1.e-12,
+ const double damping = 0.0);
+
+ /**
+ * Determines, when Pivoting is
+ * done during LU decomposition.
+ * 0.0 indicates no pivoting,
+ * and 1.0 complete pivoting.
+ * Confer PetSC manual for more
+ * details.
+ */
+ double pivoting;
+
+ /**
+ * Size at which smaller pivots
+ * are declared to be zero.
+ * Confer PetSC manual for more
+ * details.
+ */
+ double zero_pivot;
+
+ /**
+ * This quantity is added to the
+ * diagonal of the matrix during
+ * factorisation.
+ */
+ double damping;
};
/**
* generates a compiler fault.
*/
PreconditionLU (const MatrixBase &matrix,
- const AdditionalData &additional_data = AdditionalData());
+ const AdditionalData &additional_data =
+ AdditionalData(1.e-6, 1.e-12, 0.0));
protected:
/**
/* ----------------- PreconditionLU -------------------- */
PreconditionLU::AdditionalData::
- AdditionalData ()
+ AdditionalData (const double pivoting,
+ const double zero_pivot,
+ const double damping)
+ :
+ pivoting (pivoting),
+ zero_pivot (zero_pivot),
+ damping (damping)
{}
// preconditioner
int ierr;
ierr = PCSetType (pc, const_cast<char *>(PCLU));
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ // set flags as given
+ ierr = PCLUSetPivoting (pc, additional_data.pivoting);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ ierr = PCLUSetZeroPivot (pc, additional_data.zero_pivot);
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ ierr = PCLUSetDamping (pc, additional_data.damping);
AssertThrow (ierr == 0, ExcPETScError(ierr));
}