Welcome, Guest
Username: Password: Remember me

TOPIC: Calling different mesh zones to assign head losses

Calling different mesh zones to assign head losses 6 years 6 months ago #29846

  • pilou1253
  • pilou1253's Avatar
  • OFFLINE
  • openTELEMAC Guru
  • Posts: 584
  • Thank you received: 106
Hi,

Once more, you should not use PRIVE%ADR(1)%P%R(I), which is the 1st 3D PRIVATE ARRAY, but PRIVE2D%ADR(1)%P%R(I), which is the one corresponding to the 1st 2D PRIVATE VARIABLE stored into your geometry file.

It is therefore normal that printing PRIVE%ADR(1)%P%R(I) gives you 0 (=2.2E-229).

I am not familiar with FIND_VARIABLE so I can't help with that.

It is awkward that you can't manage to have the regular private variables function to work. I am completely overloaded this week so I can't even run your test model. I can try to test it next week.

Just one thing, I have been using this function mainly on version 7.1 I think, I did not migrate my 3D models to the latest versions yet. I would be very surprised if it would be a version-related issue, but if you have the time to try...

Best regards
PL
The administrator has disabled public write access.

Calling different mesh zones to assign head losses 6 years 6 months ago #29877

  • SDAC
  • SDAC's Avatar
Unfortunately the write command for PRIVE2D%ADR(1)%P%R(I) prints nothing. I got around to testing it on v7p3 today but there wasn't a change, although I'm just ticking off any possible factor at the moment.

I think it must be how Telemac is processing/reading the file, however diving into the code hasn't revealed much. If you do manage to give it a test at some point I'd be exceptionally grateful - at this point I'm scratching my head. I appreciate the advice and time you've given. I've attached the files again if you do have time.

Good luck with your work.


File Attachment:

File Name: PRIVEtest.zip
File Size: 151 KB
The administrator has disabled public write access.

Calling different mesh zones to assign head losses 6 years 6 months ago #30002

  • SDAC
  • SDAC's Avatar
I have a working code. The code simply opens and reads the node IDs to an array using a loop, then uses simple array logic to determine which layers head losses are applied to. It works fine for my low resolution mesh in serial. However, when I increase the number of nodes to loop through then Telemac crashes. A sample code is:
OPEN(12,FILE='../0.1_SER.dat')
       DO I=1,8189
         READ(12,*) SEID(I)
!         write(*,*)I, SEID(I)
       END DO
      CLOSE(12)

      DO I = 1, 8189 !for each NODE
        I1=SEID(I)
         write(*,*)I1
        A = 24.3816D0
       DO IPLAN = NPLAN-9,NPLAN !for layers at that node
          I3D = I1+NPOIN2*(IPLAN-1) !get the 3D node IDs
       
         NORM =SQRT(UN3%R(I3D)**2+VN3%R(I3D)**2+WN3%R(I3D)**2)
         S1U%R(I3D)=0.5D0*A*CD2*NORM
         S1V%R(I3D)=0.5D0*A*CD2*NORM
         S1W%R(I3D)=0.5D0*A*CD2*NORM
           
       END DO
      END DO

I get a "*.exe has stopped working" error followed by:
_____________
runcode::main:
:
|runCode: Fail to run
|C:\TELEMAC\VEG\May\PRIVEtest.cas_2018-05-08-12h14min40s\out_MworkER_3.exe
|~~~~~~~~~~~~~~~~~~
|
|~~~~~~~~~~~~~~~~~~

I receive warnings that I don't otherwise see when looping through fewer nodes:
t3dfort.f:662:0: warning: iteration 60 invokes undefined behavior [-Waggressive-
loop-optimizations]
I3=PNID(I)
^
t3dfort.f:661:0: note: containing loop
DO I = 1, 877 !for each NODE
^
t3dfort.f:646:0: warning: iteration 80 invokes undefined behavior [-Waggressive-
loop-optimizations]
I2=SMID(I)
^
t3dfort.f:645:0: note: containing loop
DO I = 1, 2215 !for each NODE
^
t3dfort.f:630:0: warning: iteration 700 invokes undefined behavior [-Waggressive
-loop-optimizations]
I1=SEID(I)
^
t3dfort.f:629:0: note: containing loop
DO I = 1, 8189 !for each NODE
^

I think with a larger number of iterations the program fails because it is optimised into an infinite loop. Or at least something is changing the loop condition. I would have assumed that the code is impossible to execute given a previous case, but there isn't one. I think. Is this the case - Is the loop poorly defined for this case?
The administrator has disabled public write access.
Moderators: pham

The open TELEMAC-MASCARET template for Joomla!2.5, the HTML 4 version.