[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
changes in KSP convergence tests
- To: petsc-dev@xxxxxxxxxxx
- Subject: changes in KSP convergence tests
- From: "Lisandro Dalcin" <dalcinl@xxxxxxxxx>
- Date: Fri, 19 Oct 2007 20:17:57 -0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=XxsSlkmSyy81GncyfoZkiRFyqljhCXMx6qz+QRUqE08=; b=NK+LFbEpP9vpop5gp+P8dMyems7hEUPpBM7DKGJij8RF+UNu01t/f2FUE+w0MVoErgBLAzYMq+DO8MFYZ1BLl9wmN+fm5s9bN5qrvPRg6bD3ksHwmztTbkErGVvnA7pYhUNvHq9KUtYXqPr7glcWo226zn3pdUOBAORpLTPcVRo=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=Upj7Wr4aNxeVm+bKDzFandwVQFlOyTk1VBGG8PRKnarzvvX0RFrnwFqudTkx/8YTSotF1/HSXEaFwmbgpEfszv1o7DZxTTkOdkkw9ea7lEUhlrDflDJlh4wK4GkoFXTSwSbbIsopq9XWjTlqU4ifAS21+F4jpPomMBne2kF7pRg=
- Reply-to: petsc-dev@xxxxxxxxxxx
- Sender: owner-petsc-dev@xxxxxxxxxxx
I've fixed KSPDestroy() to use user provided destroy routine for
convergence context. Please review.
BTW, from some time ago in petsc4py I hack things to use the default
convergence test as below. Does it make sense to use this on
KSPDefaultConverged? If not, I thing an error should be generated if
the norm type is KSP_NORM_NO. What do you think?
#undef __FUNCT__
#define __FUNCT__ "KSPDefaultConverged_Safe"
static PetscErrorCode
KSPDefaultConverged_Safe(KSP ksp,
PetscInt its, PetscReal rnorm,
KSPConvergedReason* reason, void* ctx)
{
KSPNormType normtype;
PetscErrorCode ierr;
PetscFunctionBegin;
ierr = KSPGetNormType(ksp, &normtype); CHKERRQ(ierr);
if (normtype == KSP_NORM_NO) {
ierr = KSPSkipConverged(ksp,its,rnorm,reason,ctx);CHKERRQ(ierr);
} else {
ierr = KSPDefaultConverged(ksp,its,rnorm,reason,ctx);CHKERRQ(ierr);
}
PetscFunctionReturn(0);
}
--
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594