anchor.diff:      !For each iteration
       do k=1,numit
   
  -       !For each grid point
  -       do i=1,n
  -
  -          laptmp=0_r8
  -          laptmp1=0_r8 
  -          ledhx=0_r8 
  -          Lchx=0_r8
  -
  -          !For each grid neighboring of i
  -          do j=1,mesh%v(i)%nnb 
  -
  -             !Edge length
  -             ledhx=mesh%edhx(mesh%v(i)%ed(j))%leng
  -
  -             !Distance between two neighboring
  -             !arclen(mesh%v(mesh%v(i)%nb(j))%p,mesh%v(i)%p)
  -             Lchx=mesh%ed(mesh%v(i)%ed(j))%leng
  -
  -             laptmp1=laptmp1+(ledhx/Lchx)
  -             laptmp=laptmp+(ledhx/Lchx)*(fap%f(mesh%v(i)%nb(j)))
  -
  -          enddo
  -
  -          laptmp=laptmp/mesh%hx(i)%areag
  -          laptmp1=laptmp1/mesh%hx(i)%areag
  -
  -          !problem -lap f+f =g
  -          fap_aux%f(i)=(1-w)*(fap%f(i))+w*((laptmp+g%f(i))/(laptmp1+1))
  -
  -
  -          !problem lap f =g
  -          !fap_aux%f(i)=(1-w)*fap%f(i)+w*((laptmp-g%f(i))/(laptmp1))
  -
  -       enddo
  -
  -       fap%f=fap_aux%f
  +      !For each grid point
  +      do i=1,n
  +
  +        laptmp=0_r8
  +        laptmp1=0_r8
  +        ledhx=0_r8
  +        Lchx=0_r8
  +
  +        !For each grid neighboring of i
  +        do j=1,mesh%v(i)%nnb
  +
  +          !Edge length
  +          ledhx=mesh%edhx(mesh%v(i)%ed(j))%leng
  +
  +          !Distance between two neighboring
  +          !arclen(mesh%v(mesh%v(i)%nb(j))%p,mesh%v(i)%p)
  +          Lchx=mesh%ed(mesh%v(i)%ed(j))%leng
  +
  +          laptmp1=laptmp1+(ledhx/Lchx)
  +          laptmp=laptmp+(ledhx/Lchx)*(fap%f(mesh%v(i)%nb(j)))
  +
  +        enddo
  +
  +        laptmp=laptmp/mesh%hx(i)%areag
  +        laptmp1=laptmp1/mesh%hx(i)%areag
  +
  +        !problem -lap f+f =g
  +        fap_aux%f(i)=(1-w)*(fap%f(i))+w*((laptmp+g%f(i))/(laptmp1+1))
  +
  +
  +         !problem lap f =g
  +         !fap_aux%f(i)=(1-w)*fap%f(i)+w*((laptmp-g%f(i))/(laptmp1))
  +
  +      enddo
  +
  +      fap%f=fap_aux%f
   
       enddo
   
  
positive.code:   end subroutine getsimulpars
  
    subroutine poisson_main(mesh)
     !---------------------------------------------------
      ! poisson_main
      !    Main routine for test cases related to poisson superconv. analysis
      !
  
negative.code:     !For each iteration
      do k=1,numit
  
        !For each grid point
        do i=1,n
  
          laptmp=0_r8
          laptmp1=0_r8
          ledhx=0_r8
          Lchx=0_r8
  
          !For each grid neighboring of i
          do j=1,mesh%v(i)%nnb
  
            !Edge length
            ledhx=mesh%edhx(mesh%v(i)%ed(j))%leng
  
            !Distance between two neighboring
            Lchx=mesh%ed(mesh%v(i)%ed(j))%leng
            laptmp1=laptmp1+(ledhx/Lchx)
            laptmp=laptmp+(ledhx/Lchx)*(fap%f(mesh%v(i)%nb(j)))
          enddo
  
          laptmp=laptmp/mesh%hx(i)%areag
          laptmp1=laptmp1/mesh%hx(i)%areag
  
          !para o problema lap f =g
          !fap%f(i)=(1-w)*fap%f(i)+w*((laptmp-g%f(i))/(laptmp1))
  
  
          !para o problema -lap f+f =g
          fap%f(i)=(1-w)*(fap%f(i))+w*((laptmp+g%f(i))/(laptmp1+1))
  
  
        enddo
  
      enddo
  
  