Author Topic: Infinite calling of ISW 26  (Read 18657 times)

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Infinite calling of ISW 26
« on: May 29, 2017, 04:07:03 AM »
Hello,

I've used the FEAPpv 3.1 a while and I am trying to migrate to the newly purchased FEAP 8.4. After solving some troubles I've managed to compile FEAP 8.4. Now I'm trying to continue debugging my user element (somewehere in my code is an error that cause a divergence of my calculations) but unfortunately I got stuck in an infinite loop of calling the ISW-task 26. While using FEAPpv this ISW-task was never called, so I do not have any experiences in using it.

I've checked the way the built-in solid2d- and solid3d-element handles this task and copied the way (calling the pcorner-subroutine). I've also checked that FEAP 8.4 is executing the code-snippet, where my edits take part by doing an output to stdout (both, the code-snippet in my element and the external subroutine pcorner are called regularly). But, as I mentioned before, unfortunately FEAP never goes past this ISW-task 26 (started a calculation earlier this day and it ran the ISW-task 26 for 30 minutes till I manually aborted it).

Anyone had some analogous problems and can tell me what I need to check or how I probably am able to solve this issue?

Greetings,
Jan Frischmann

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Infinite calling of ISW 26
« Reply #1 on: May 29, 2017, 09:31:17 AM »
Hard to say why the infinite loop, but if the code runs using the built-in elements it must relate to your user element.
Can you describe your operating system, compiler used and version, and any other information how you build the program that may give us a clue.

Feap 8.4 does require your user element to have an isw=26 part.  It can be dummy that is,
         if(isw.eq.26) return

If your element uses the structure
       go to(1,2,3, .....) isw
then add a return after this for any isw larger than the list
       go to (1,2,3, ...,8) isw
       return

Somehow, your element must create a recursion that causes the infinite loop.

The call for isw=26 comes from the routine "pextndc.f" in the ./program directory.  You can see if there is something happening after the return (or comment the call toe elmlib to see what happens).

Please let us know what happens if you find the difficulty.  Otherwise
if you can post your element  we can try to see what is happening.

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #2 on: May 30, 2017, 04:21:31 AM »
Dear Prof. Taylor,

after declaring all the variables and arrays I do need during my element the following code-snipet is coded by me:

Code: [Select]
  ! Store all relevant values for later calls
  save
 
  ! Set all element-temperatures to zero with double-precision
  tl = 0.0d0
 
  !   ===========================================================================================
  !   Set flags for analytical solution and debugging mode
  !   ===========================================================================================

  ! set debugging-mode for log-file
  debug = .true.
  ! set output of ISW-task on standard-out
  ISWdebug = .true.
 
  if( ISWdebug ) then
     write(*,*) ''
     write(*,*) 'Element: ',n,' isw: ', isw
  endif
 
  ! list which jump-mark corresponds to which isw-task (first entry corresponds to isw=1, etc.)
  go to ( 1, 2, 3, 4, 5, 3 ), isw
5 return

As far as I know the save-statement should only store all the values assigned to the previously declared variables, after that I am initializing vanishing nodal temperatures (I want to code a purely mechanical element), after that I am initializing to boolean flags and I have coded an output on stdout which tells me which element-number and which ISW-task currently is processed. The main part concerning my problem are the last three lines, in which I am defining, that FEAP should jump to the jumpmarks assigned to the ISW-tasks (if ISW equals 1 it should jump to the first jumpmark '1', if ISW equals 2 FEAP should jump to the jumpmark '2', and so on). If I understand your message correctly FEAP should jump to the jumpmark 3 if ISW equals '6' (the last defined jumpmark in my list) and for every value greather than 6 FEAP should proceed with the code and reach the return-statement after jumpmark 5. So at ISW 26 it should reach this return-statement and exit the code. But obviously FEAP doesn't reassign the ISW-flag/-value to an other value than 26 and so the next time my code is called the previously described behaviour occurs another time and this without ever modifying 'ISW'. So it seems to me, that FEAP needs something to be done at ISW 26, but defining a jumpmark for this ISW (defining jumpmark 5 for every ISW in between 7 and 25) with a code at jumpmark 26 nalogous to the code-snippet of solid2d.f (calling 'pcorner2d()' ) doesn't change anything the same infinite loop occurs.

I have compiled the FEAPpv 3.1 with exact the same code (opened my code for FEAP 8.4 and saved it in the FEAPpv 3.1-user-subfolder) and the code works fine never trying to call ISW 26 (Starting with ISW 1-> 14 -> 12 -> 3). Thats why I am confused of the behaviour of FEAP 8.4, because I have coded the element with the user and programmer manual of FEAP 8.4 so if it works for FEAPpv 3.1 it should work also for FEAP 8.4 (but not necessarily vice versa).

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: Infinite calling of ISW 26
« Reply #3 on: May 30, 2017, 07:04:11 AM »
Why don't you start the code in gdb and then figure out where it is in the stack when you are stuck in the 'infinite loop'?

Also the behavior of a blanket save statement is to preserve the values of ALL local variables upon exit from a subroutine.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Infinite calling of ISW 26
« Reply #4 on: May 30, 2017, 09:15:14 AM »
Remember that feappv3.1 never has a call to the element with isw = 26, only feap.

Do you use "implicit none" in your element to ensure type casting is correct?

Does feap run correctly with the built in elements?

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #5 on: May 30, 2017, 11:16:24 PM »
"implicite none" is actually the first line of code of my element and I've tried to run feap with my input file calling for the built-in element solid2d and it exits normally (throwing an IEEE_DIVIDE_BY_ZERO-Exception that isn't thrown by feappv3.1).

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: Infinite calling of ISW 26
« Reply #6 on: May 30, 2017, 11:50:09 PM »
The IEEE warning can be ignored (it is related to how version 8.4 does NaN and Inf checks).

The main issue is to figure out where you element is hanging.   Perhaps some print statements at the top of
the element could help figure out what is going on.  Is your element being called in an infinite loop?

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #7 on: May 31, 2017, 02:06:22 AM »
I have inserted another output to stdout and edited my isw-jump to:
Code: [Select]
   write (*,*) 'Checkpoint 1'
  ! list which jump-mark corresponds to which isw-task (first entry corresponds to isw=1, etc.)
  go to ( 1, 2, 3, 4, 5, 3 ), isw
  write (*,*) 'Checkpoint 2'
5 return
  write (*,*) 'Checkpoint 3'
The first and second Checkpoint are being reached infinitely often but Checkpoint 3 is never reached. So Calling ISW 26 results in executing the return-statement after the go-to-statement but as I said before ISW isn't modified and so my element is being called infinitely often.

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #8 on: May 31, 2017, 04:55:12 AM »
I've tried the same input file with another user element of mine and the same problem occurs. I've attached my input file and the standard elastic user element with which the loop occurs. Still can't see any problems in my code yet.

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Infinite calling of ISW 26
« Reply #9 on: May 31, 2017, 05:38:04 PM »
I do not know what is in your "use math" files, but could they conflict with feap?

I have not compiled because of "use" but make some comments in the file attached (name change to avoid conflict with your file).

Also I would remove all the file I/O to unit 78  until you resolve what is causing the problem.

IF you e-mail the module for "math" we can check further.

 

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Infinite calling of ISW 26
« Reply #10 on: May 31, 2017, 06:01:03 PM »
Just look for RLT in the file to see my comments

FEAP_Admin

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 993
Re: Infinite calling of ISW 26
« Reply #11 on: May 31, 2017, 08:06:42 PM »
I compiled your routine with ver84, and it seems to run without infinite looping.  The call sequence printed to the screen is isw = 1, 16 x 26, 14, 6, 12, 3, 4.  Followed by normal termination.  Certainly no infinite loops on isw.eq.26.  Note I commented out all the 'use math' lines since you did not provide the module along with all the lines with calls to det( ), inverse( ), and trace( ) which appear to be in that module.

Perhaps you do not have a clean copy of version 8.4?

Note, I use the Intel Fortran Compiler.

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #12 on: June 01, 2017, 01:30:37 AM »
Oh sorry, was some month ago I used the attached element for the last time, so I forgot about the module I don't use anymore in the new element. The math-module is attached to this post and is only used for distributing some mathematical functions.

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #13 on: June 01, 2017, 04:26:25 AM »
I compiled your routine with ver84, and it seems to run without infinite looping.  The call sequence printed to the screen is isw = 1, 16 x 26, 14, 6, 12, 3, 4.  Followed by normal termination.  Certainly no infinite loops on isw.eq.26.  Note I commented out all the 'use math' lines since you did not provide the module along with all the lines with calls to det( ), inverse( ), and trace( ) which appear to be in that module.

Perhaps you do not have a clean copy of version 8.4?

Note, I use the Intel Fortran Compiler.

I have downloaded the source some days ago because we purchased feap only two weeks ago. I am using the GFortran-Compiler and will try the new release FEAP8.5 with a new and clean installation, checking wether this works.

Jfrisch

  • Full Member
  • ***
  • Posts: 65
Re: Infinite calling of ISW 26
« Reply #14 on: June 01, 2017, 05:16:38 AM »
Still resulting in an infinite-loop of calling ISW 26 when compiling the newly released FEAP 8.5. To use my code, which is written in Fortran90, I have adjusted the makefile.in and the makefile in the user-subdirectory (see attachement). No errors printed on stdout and feap tells me that my element (elmt03.f90) is compiled. The benchmark inputfile I am using is also attached to this post. Are there any adjustments I forget about or any issues probably caused by my adjustments?

@Prof. Taylor: You commented in my example-routine, that I do not need to use the ud-array. How can I use the d-array with my user-specific material parameters (how to adjust input-file and in which entries of the d-array are they stored)?