usvpst don't see the "ipart" variation

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Post Reply
rezki

usvpst don't see the "ipart" variation

Post by rezki »

Hello,
I defined an additional post-processing meshes (2 median planes "plan_z" and "plan_y") in "usdpst"

Code: Select all

nbcas = 1
do icas = 1, nbcas
  do ii = 1, len(nomcas)
    nomcas (II:II) = ' '
  enddo
  do ii = 1, len(nomrep)
    nomrep (ii:ii) = ' '
  enddo
  do ii = 1, len(nomfmt)
    nomfmt (ii:ii) = ' '
  enddo
  do ii = 1, len(optfmt)
    optfmt (ii:ii) = ' '
  enddo
 if (icas .eq. 1) then
    nomcas = 'chr'
    nomrep = 'EnSight'
    nomfmt = 'EnSight Gold'
    optfmt = 'binary'
    indmod = 0
    ntchrl = 1
 endif
enddo

Code: Select all

nbpart = 2
 do ipart = 1, nbpart
  nlcel = 0
  nlfac = 0
  nlfbr = 0
  do iel = 1, ncelet
    lstcel(iel) = 0
  enddo
  do ifac = 1, nfac
    lstfac(ifac) = 0
  enddo
  do ifac = 1, nfabor
    lstfbr(ifac) = 0
  enddo
  do ii = 1, len(nommai)
    nommai(ii:ii) = ' '
  enddo
  ! Part 1: "plan Z"
  !=================
   if (ipart .eq. 1) then
     nommai = 'Plan_z'
     ! Interior faces
     call getfac('plane[0, 0, -1, 0.0445, epsilon = 0.0001]', nlfac, lstfac)
     !==========
    ! Create post-processing mesh
    !============================
     call pstcma (ipart, nommai, nlcel, nlfac, nlfbr, lstcel, lstfac, lstfbr)
    !==========
 ! Part 2: "plan Y"
 ! ================
   elseif (ipart .eq. 2) then
      nommai = 'Plan_y'
      ! Interior faces
      call getfac('plane[0, -1, 0, 0.017, epsilon = 0.0001]', nlfac, lstfac)
      !==========
      ! Create post-processing mesh
      !============================
      call pstcma (ipart, nommai, nlcel, nlfac, nlfbr, lstcel, lstfac, lstfbr)
   end if
 enddo
endif
 if ((ipart .eq. 1) .or. (ipart .eq. 2)) then
!    ! Associate post-processing meshes 1 and 2 with writers  1 and 2.
    icas = 1
    call pstass(ipart, icas)
 endif
The problem is that "usvpst" don't see this variation of "ipart". When I print "ipart" in listing file I get "ipart= -1 or -2" !! although "nbpart" is set to 2 in "usdpst" !!

Code: Select all

   if (ipart.eq.1 .or. ipart.eq.2) then 
   ! Initialize variable name
    do ii = 1, 32
      namevr (ii:ii) = ' '
    enddo
    ! Variable name
    namevr = 'Interpol pressure'
    ! Variable dimension (1: scalar, 3: vector, 6/9: symm/non-symm tensor)
    idimt = 1
    ! Values are not interlaced (dimension 1 here, so no effect).
    ientla = 0
    iphas = 1   ! We only consider phase 1 in this example
    ! Variable number
    ivar = ipr(iphas)
    ! Compute variable values on interior faces.
    ! we use a simple linear interpolation. 
    if(irangp.ge.0) then
      call parcom (rtp(1,ivar))
    endif
    if(iperio.eq.1) then
      idimte = 0
      itenso = 0
      call percom(idimte, itenso,                         &
      !==========
                  rtp(1,ivar), rtp(1,ivar), rtp(1,ivar),  &
                  rtp(1,ivar), rtp(1,ivar), rtp(1,ivar),  &
                  rtp(1,ivar), rtp(1,ivar), rtp(1,ivar))
    endif

    do iloc = 1, nfacps
      ifac = lstfac(iloc)
      ii = ifacel(1, ifac)
      jj = ifacel(2, ifac)
      pond = ra(ipond-1+ifac)

      trafac(iloc) =           pond  * rtp(ii, ivar)  &
                     + (1.d0 - pond) * rtp(jj, ivar)
    enddo
  ! Compute variable values on boundary faces.
  ! In this example, we use a simple copy of the adjacent cell value.
    !   do iloc = 1, nfbrps
    !
    !    ifac = lstfbr(iloc)
    !    ii = ifabor(ifac)

     !    trafbr(iloc) = rtp(ii, ivar)
     !  enddo

    ! Values are defined on the work array, not on the parent.
    ivarpr = 0
    ! Output values
    call psteva(ipart, namevr, idimt, ientla, ivarpr,    &
    !==========
                ntcabs, ttcabs, tracel, trafac, trafbr)
  endif
Any idea about that !!
Best regards
Yvan Fournier
Posts: 4208
Joined: Mon Feb 20, 2012 3:25 pm

Re: usvpst don't see the "ipart" variation

Post by Yvan Fournier »

Hello,

There is an error in your usdpst.f90: after the first loop, you probably have ipart = 3, so pstass is never called.

Regards,

Yvan
Post Reply