Page 2 of 2

Re: Mesh_Check SIGSEV signal intercepted

Posted: Mon Nov 19, 2012 12:34 am
by knewlands
Hello,

Apologies for returning to this topic, but whilst I managed to avoid the SIGFPE and Valgrind errors mentioned in my last post by finding (and removing) the source of the problem, I have not been able to fix the issue. I managed to narrow the cause of the problem to a section of code in usvpst in which I asked for the instantaneous velocity components to be written on an alias of the volume mesh. This is the section of the code:

Code: Select all

  iphas = 1

  if(irangp.ge.0) then
    call parcom (rtp(1,iu(iphas)))
    call parcom (rtp(1,iv(iphas)))
    call parcom (rtp(1,iw(iphas)))
    call parcom (rtp(1,ipr(iphas)))
  endif

  if(iperio.eq.1) then
    idimte = 1
    itenso = 0
    call percom(idimte, itenso,                                         &
    !==========
                rtp(1,iu(iphas)), rtp(1,iu(iphas)), rtp(1,iu(iphas)),   &
                rtp(1,iv(iphas)), rtp(1,iv(iphas)), rtp(1,iv(iphas)),   &
                rtp(1,iw(iphas)), rtp(1,iw(iphas)), rtp(1,iw(iphas)))

    idimte = 0
    itenso = 0
    call percom(idimte, itenso,                                           &                                                  
    !==========
                rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)),  &
                rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)),  &
                rtp(1,ipr(iphas)), rtp(1,ipr(iphas)), rtp(1,ipr(iphas)))
        
  endif


  ! Output of the velocities and pressure
  ! ------------------------

  ! Initialize variable name
  do ii = 1, 32
    namevr (ii:ii) = ' '
  enddo

  ! Values are not interlaced.
  ientla = 0
  ! Variable name
  namevr = 'VelX'
  ! Variable dimension (1: scalar, 3: vector, 6/9: symm/non-symm tensor)
  idimt = 3

  do iloc = 1, ncelps
     iel = lstcel(iloc)
     tracel(iloc) = rtp(iel,iu(iphas))
  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)


  ! Initialize variable name
  do ii = 1, 32
    namevr (ii:ii) = ' '
  enddo

  namevr = 'VelY'
  idimt = 3
  ientla = 0
  
  do iloc = 1, ncelps
     iel = lstcel(iloc)
     tracel(iloc) = rtp(iel,iv(iphas))
  enddo

  ivarpr = 0
  ! Output values
  call psteva(ipart, namevr, idimt, ientla, ivarpr,  &
                  ntcabs, ttcabs, tracel, trafac, trafbr)


  ! Initialize variable name
  do ii = 1, 32
    namevr (ii:ii) = ' '
  enddo

  namevr = 'VelZ'
  idimt = 3
  ientla = 0

  do iloc = 1, ncelps
     iel = lstcel(iloc)
     tracel(iloc) = rtp(iel,iw(iphas))
  enddo

  ivarpr = 0
  ! Output values
  call psteva(ipart, namevr, idimt, ientla, ivarpr,  &
                  ntcabs, ttcabs, tracel, trafac, trafbr)


  ! Initialize variable name
  do ii = 1, 32
    namevr (ii:ii) = ' '
  enddo

  namevr = 'Pressure'
  idimt = 1
  ientla = 0
  
  do iloc = 1, ncelps
     iel = lstcel(iloc)
     tracel(iloc) = rtp(iel,ipr(iphas))
  enddo

  ivarpr = 0

  ! Output values
  call psteva(ipart, namevr, idimt, ientla, ivarpr,  &
                  ntcabs, ttcabs, tracel, trafac, trafbr)
I was able to remove this section of code as I also output the values in the CHR.ENSIGHT.xxxx folder as standard, but I am unclear on the format in which the velocity file is saved there. I can access the individual velocity components in ParaView having used the CellDataToPointData filter, but I would like to have the data in a format that can be read by Matlab for further processing, with the same coordinates as the mean values I am able to output successfully in usvpst. Is there something obviously wrong with the above code?

Thank you in advance for your help and apologies for the long post,

Kristin

Re: Mesh_Check SIGSEV signal intercepted

Posted: Mon Nov 19, 2012 1:07 am
by Yvan Fournier
Hello,

As you separate components, anw write them one by one from a work array, you should set idimt = 1, not 3, for the output of velocity components.

I am not sure this is the cause of the crash, but in any case, it would lead to incorrect output.

If you still have the crash, can you alternately remove parts of the output so as to further pinpoint for which variable you have the crash (other option: run a version built for debugging, so the line number appears in a traceback).

Regards,

Yvan

Re: Mesh_Check SIGSEV signal intercepted

Posted: Mon Nov 19, 2012 1:58 am
by knewlands
Hello Yvan,

Thank you for your prompt reply, I will try changing the incorrect value for idimt. However, if this would still lead to incorrect output it isn't a good solution.

Would you be able to tell me what the format for the velocity output file in the CHR.ENSIGHT.xxxx folder is or how I could obtain the correct output?

Thank you,

Kristin

Re: Mesh_Check SIGSEV signal intercepted

Posted: Mon Nov 19, 2012 9:49 pm
by Yvan Fournier
Hello,

Sorry if I was not clear: fixing idimt should lead to correct results, but since I would expect an incorrect value of idimt to lead to wrong output rather than a crash, I believe there may be another bug lurking in addition to that one.

In any case, you should re-check your calculation after setting idimt to 1 for velocity components, to see if this improves things.

Otherwise, the EnSight format is documented in the EnSight user's guide, and a link to that (hopefully up to date) is provided in the Code_Saturne user documentation. This format is also readable by VTK-based tools.

Best regards,

Yvan