On Tue, 22 May 2007, Ben Tay wrote: > Hi, > > I'm advancing my solution thru each time step. So after each time step, > it'll be called again
Unless you are destroying and recreating [ksp/pc] objects in this loop, you don't need to call PCSetType repeatedly.. Satish > > call PCHYPRESetType(pc,'boomeramg',ierr) > > call PCSetType(pc,'hypre',ierr) > > I tried to call "call PCHYPRESetType(pc,'boomeramg',ierr)" once during the > entire run and it's ok. Is it supposed to be so? > > Thanks > > > > > > On 5/22/07, Satish Balay <balay at mcs.anl.gov> wrote: > > > > you are probably doing this inside a loop. check the code. > > > > satish > > > > On Tue, 22 May 2007, Ben Tay wrote: > > > > > Sorry to trouble you ppl again. > > > > > > The 1st step worked but subsequently I got the error msg: > > > > > > --------------------- Error Message ------------------------------------ > > > [0]PETSC ERROR: Operation done in wrong order! > > > [0]PETSC ERROR: Cannot set the HYPRE preconditioner type once it has > > been > > > set! > > > > > > I have used : > > > > > > call PCHYPRESetType(pc,'boomeramg',ierr) > > > > > > call PCSetType(pc,'hypre',ierr) > > > > > > > > > I changed the 2 order but it still can't work. > > > > > > Thanks again > > > > > > > > > > > > > > > > > > > > > On 5/22/07, Ben Tay <zonexo at gmail.com> wrote: > > > > > > > > Ops.... how careless. Thanks again. > > > > > > > > On 5/22/07, Barry Smith <bsmith at mcs.anl.gov> wrote: > > > > > > > > > > > > > > > pcsettype > > > > > > > > > > > > > > > On Tue, 22 May 2007, Ben Tay wrote: > > > > > > > > > > > Sorry I got this error during linking: > > > > > > > > > > > > petsc_sub.o(.text+0x20c): In function > > > > > `petsc_sub_mp_petsc_solver_pois_': > > > > > > /nfs/home/enduser/g0306332/ns2d_c/petsc_sub.F:125: undefined > > reference > > > > > to > > > > > > `pcsetype_' > > > > > > > > > > > > Did I miss out something? > > > > > > > > > > > > Thanks > > > > > > > > > > > > > > > > > > On 5/22/07, Satish Balay <balay at mcs.anl.gov> wrote: > > > > > > > > > > > > > > use: > > > > > > > > > > > > > > call PCSetType(pc,'hypre',ierr) > > > > > > > call PCHYPRESetType(pc,'boomeramg',ierr) > > > > > > > > > > > > > > Satish > > > > > > > > > > > > > > On Tue, 22 May 2007, Ben Tay wrote: > > > > > > > > > > > > > > > Hi, > > > > > > > > > > > > > > > > presently I am using ./a.out -pc_type hypre -pc_hypre_type > > > > > boomeramg to > > > > > > > use > > > > > > > > hypre. > > > > > > > > > > > > > > > > However, I have 2 matrix to solve and now I only want one of > > them > > > > > to use > > > > > > > > hypre, while the other use jacobi + bcgs. > > > > > > > > > > > > > > > > for the solver using hypre, > > > > > > > > > > > > > > > > initially it's just: > > > > > > > > > > > > > > > > call PCSetType(pc,PCLU,ierr) - direct solver > > > > > > > > > > > > > > > > I now changed to > > > > > > > > > > > > > > > > call PCSetType(pc,hypre,ierr) > > > > > > > > > > > > > > > > call PCHYPRESetType(pc,boomeramg,ierr) > > > > > > > > > > > > > > > > However, I got the error msg: > > > > > > > > > > > > > > > > fortcom: Error: petsc_sub.F, line 125: This name does not have > > a > > > > > type, > > > > > > > and > > > > > > > > must have an explicit type. [HYPRE] > > > > > > > > call PCSetType(pc,hypre,ierr) > > > > > > > > > > > > > > > > Sorry I don't really understand the eg. hyppilut.c since my > > > > > knowledge of > > > > > > > the > > > > > > > > c language is very basic. > > > > > > > > > > > > > > > > So how should I set the options to use hypre? > > > > > > > > > > > > > > > > Thank you. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >