You are here
FEAP - history variables for Elements
Hi all,
my question is about the history data storage in FEAP.
I am writing element subroutine (elmt01) in FEAP 8.3 for a history dependent problem.
I have written the stiffness matrix subroutine (stiff01), but it needs the data from the previous solution steps (previous strains, stresses, plastic strains, dislocation densities .... nh1,nh2=30 per point).
The problem is :: I am unable to figure out how to assign these variables to the history arrays (at t_n+1) so that I can get these values back at the start of next step. In the programmer's manual (page: 8) it is written that hr arrays are pointer arrays, not the data storage arrays and in the same manual after a few pages (page: 28), the program uses these hr arrays to store the history data .
I will be very very thankful for any advice related to this problem from FEA veterans at this forum.
- Mubeen's blog
- Log in or register to post comments
- 11704 reads
Comments
hr(nh1 + ...)
The previous Time_n values are located at hr(nh1 + k) for k=0,1,2,...,number_hist_var_in_element
You need to write the new Time_n+1 values to hr(nh2 + k) for k=0,1,2,...,number_hist_var_in_element
nh1 and nh2 are set for you and are located in hdata.h. After you set the values, FEAP copies them to a global array. When you go to the next time step FEAP automatically moves the time_n+1 values into the time_n locations.
My FEAP site has an example (viscoelastic element) but it is (a) in C so it is not easy to read due to Fortran-C interfacing issues and (b) it is for a much older version of FEAP so some of it is rather outdated.
Prof. Dr. Sanjay Govindjee
University of California, Berkeley
array problem
Dear Professor,
I used the history arrays but got some errors while executing the program (feap.exe), e.g.
"error: severe (157): program exception - access violation" , and "stack trace terminated abnormally".
I checked the subroutines I have added to FEAP, however there is no array bounds violation in those little subroutines.
I suspect that I made a mistake in history arrays :-
nh1=240, nh2=240
real*8 history0(240), history1(240) ! arrays containg the data at t_n, and t_n+1
if (isw.eq.12) then !update element history data
do i=1,240
hr(nh2+i) = history1(i)
enddo
Similarly, I used the same syntax to initialze the history array.
elseif (isw.eq.14) then ! initialize history data
do i=1,240
hr(nh1+i) =ini_hist(i)
enddo
....
endif
-----------------------------
Is it possible that the above statements are causing this error ?
Array Index
Hi Mubeen,
I think you are exceeding the array index. The first history data in the array is hr(nh1). So you should go from hr(nh1) to hr(nh1 + 239). You should either do the loops over i= 0 to 239, or access hr(nh1+i-1).
In addition, in isw=1 assign a value for nh1 only.
Thanks
Thanks Markos,
I corrected this mistake .... almost everything inorder now, but still while running, FEAP is complaining about this issue. I am using IVF 11.x.x with Microsoft Visual Studio 2008. I tried for many days (compiler gives no error, it compiles successfully) but this RUNTIME error is persistent. I use release configuration, so I think array bound check is not the problem.
So I asked my colleague for help, and she compiled my subroutines on her computer (Compaq Visual Fortran 5.x or something like this, but very old version), and I was surprised to see that the resulting FEAP.exe ran without any error (except a matrix inversion error that might be due to my own subroutine).
I googled this problem and found that modern day Intel compiler (IVF) can cause this problem (http://software.intel.com/en-us/forums/showthread.php?t=60219 ) with legacy codes which contain arrays with undefined lengths and dimensions.