[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fixing values in a poisson eqn



Hi,

I am trying to solve a pressure poisson eqn resulting from the NS eqn. How can I fixed the pressure at some nodes while solving the poisson eqn?

I tried to make the coefficient of the diagonal location of the node very big e.g. 1e100. I also use

call KSPSetInitialGuessNonzero(ksp,PETSC_TRUE,ierr)

and insert the original values as initial solution:

do i=1,blk(1)%size_x
do j=1,blk(1)%size_y


               call VecSetValue(xx,k,blk(1)%p(i,j),INSERT_VALUES,ierr)

               k=k+1

           end do

       end do

in my code. However, after solving the eqn, the value I got is 1e-16 or 0. So what have I done wrong?

Thanks