[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SNES problem
- To: petsc-users@xxxxxxxxxxx
- Subject: Re: SNES problem
- From: "Lisandro Dalcin" <dalcinl@xxxxxxxxx>
- Date: Wed, 3 Oct 2007 12:40:28 -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:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=/fahw8sRblS1u927SoTd2BkbxArglu/lKZQwmW1fBn8=; b=QEszk/HohowDnu3Wl3+Wf+5zDcFuGUxAQ+BcSDBuW0A27KH82c0AjeKMj6bk4WOKLOtlQZNJubGgM8xKpbcH80ZFsCH6ak0eZXyzN/aDO97ROwvpmDtq6RZSbPB6bsHTfjhABJE0jCnmciNdr+SvIbB7Wqzk4CWjiY6XiCzFsBI=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uMFQCfKRNOdft9E09hFJCpL9qRfJzw8Xe+J78FXh2K9uwxM6aFhhaXXx8FcEQ+NLxH0raMoXBoN7wx6DobEQ2OQwramRPVI3J2+scnLRuPLs5Jtb1ZdHkars3NNBWERiOwjvQpRZRhwxZStxw4PYjwMy2zjxh48qDvcCWSBynwg=
- In-reply-to: <20071003151159.BMZ12167@mirapoint-ms1.jcu.edu.au>
- References: <20071003151159.BMZ12167@mirapoint-ms1.jcu.edu.au>
- Reply-to: petsc-users@xxxxxxxxxxx
- Sender: owner-petsc-users@xxxxxxxxxxx
Flavio, are you completelly sure your FormFunction1() is actually
being called? I can see the SNES monitor at iter 0, but I did not see
in the the outputs of VecView() or your 'cout << "Residual " << endl'.
Did you called SNESSetFunction() to set your FormFunction1()??
On 10/3/07, JoaoFlavio Vasconcellos <joaoflavio.vasconcellos@xxxxxxxxxx> wrote:
> Hello
>
> I'm trying to use SNES to solve a problem. I wrote the code above to evaluate the residual of the linear system. In this routine norm_2 of F is different from zero but outside of this routine norm_2 of F is zero.
>
> #undef __FUNCT__
> #define __FUNCT__ "FormFunction1"
> PetscErrorCode FormFunction1(SNES snes, Vec X, Vec F, void *_simulator) {
> Simulator *simulator = (Simulator*) _simulator;
> PetscErrorCode ierr;
>
> VecView (X, 0);
> ierr = simulator->CalculateMatrixCoefficient(X); CHKERRQ(ierr);
> ierr = simulator->CalculateSourceTerm(X); CHKERRQ(ierr);
> ierr = simulator->CalculateResidual (X, &F); CHKERRQ(ierr);
>
> cout << "Residual " << endl;
> VecView (F, 0); // norm_2 of F is != zero
> return 0;
>
> }
>
> // End of routine
>
>
>
>
> Messages from -snes_view:
>
> 0 SNES Function norm 0.000000000000e+00
> SNES Object:
> type: ls
> line search variant: SNESLineSearchCubic
> alpha=0.0001, maxstep=1e+08, steptol=1e-12
> maximum iterations=50, maximum function evaluations=10000
> tolerances: relative=1e-08, absolute=1e-50, solution=1e-08
> total number of linear solver iterations=0
> total number of function evaluations=1
> KSP Object:
> type: gmres
> GMRES: restart=30, using Classical (unmodified) Gram-Schmidt Orthogonalization with no iterative refinement
> GMRES: happy breakdown tolerance 1e-30
> maximum iterations=10000, initial guess is zero
> tolerances: relative=1e-05, absolute=1e-50, divergence=10000
> left preconditioning
> PC Object:
> type: ilu
> ILU: 0 levels of fill
> ILU: factor fill ratio allocated 1
> ILU: tolerance for zero pivot 1e-12
> out-of-place factorization
> matrix ordering: natural
>
> // end of message
>
> I dont know why "SNES Function norm 0.000000000000e+00" if
> F's norm_2 inside my routine is not. Has anyone that could sugest how to fix this problem ?
>
>
> Thank you in advance.
>
>
> Joao Flavio Vieira de Vasconcellos
> School of Engineering
> James Cook University
>
> Phone: +61 7 4781 4340
> Fax: +61 7 4775 1184
> Email: jflavio@xxxxxxxxxxxx
> joaoflavio.vasconcellos@xxxxxxxxxx
> skype: jflavio_vasconcellos
> msn: jf_vasconcellos@xxxxxxxxxxx
>
>
--
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