Author Topic: Export forces  (Read 6720 times)

serkuz

  • Jr. Member
  • **
  • Posts: 26
Export forces
« on: December 07, 2016, 12:34:03 AM »
Dear Prof. Taylor, dear FEAP community,

I would like to export node forces. But I am not sure if I do the right. So, I've created in pouta.f following block:
Code: [Select]
...
character  filetype*4
filetype='.dat'
...
      elseif(pcomp(array,'nfrc',4)) then
        prth = .false.
        node_output = 4   
        call setcount(array,nnfrc,i)
        open(unit = iow,file = trim(array)//filetype,status = 'unknown')
        rewind(iow)
        call prtdis(hr(np(43)),hr(np(40)),ttim,prop,ndm,ndf,
     &              start,ende,inkr,node_output,ndf1,ndf2,prth)
        close(iow)
...
The export starts only from the fourth node, but this is currently unimportant. My question is whether this approach is correct.

Thanks in advance.
Best regards
serkuz
« Last Edit: December 07, 2016, 01:52:59 AM by serkuz »

serkuz

  • Jr. Member
  • **
  • Posts: 26
Re: Export forces
« Reply #1 on: December 07, 2016, 04:06:17 AM »
Dear Prof. Taylor, dear FEAP community,

I would like to export node forces. But I am not sure if I do the right. So, I've created in pouta.f following block:
Code: [Select]
...
character filetype*4
filetype='.dat'
...
  elseif(pcomp(array,'nfrc',4)) then
  prth = .false.
  node_output = 4
  call setcount(array,nnfrc,i)
  open(unit = iow,file = trim(array)//filetype,status = 'unknown')
  rewind(iow)
  call prtdis(hr(np(43)),hr(np(40)),ttim,prop,ndm,ndf,
  & start,ende,inkr,node_output,ndf1,ndf2,prth)
  close(iow)
...
The export starts only from the fourth node, but this is currently unimportant. My question is whether this approach is correct.

Thanks in advance.
Best regards
serkuz
So, why the program does not write the forces is not so unimportant. I have determined that the node forces that are at the nodes with zero displacement are not written out. Where there is no displacement is also no force. This is logical because:
F = K * u (if u = 0, then F = 0)
But I expected the zero forces to be listed, but they would not. Why is it so ?

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Export forces
« Reply #2 on: December 07, 2016, 09:08:58 AM »
There are a couple of things I would suggest.  It appears you want to use the output for import to matlab, which is what pouta is for.

1) Do not write to unit iow as it is the unit used for the output file.  Feap has a scratch disk used for i/o like you want (ios).

2) You should write your own out put file for the forces.  You can look at the file prform.  You can use the id(ndf,numnp) to get the entries to print from the forces.  This array stores the equation number for each dof which will be used to output the correct force.

3.) Generally, many of the files do not output zero values for quantities.  But feap does not form equations for fixed b.c., the specified displacement is used to modify the equations.  Hence, there is no force for these dof's (equations are numbered to account for the fixed dof).

serkuz

  • Jr. Member
  • **
  • Posts: 26
Re: Export forces
« Reply #3 on: December 13, 2016, 03:24:22 AM »
There are a couple of things I would suggest.  It appears you want to use the output for import to matlab, which is what pouta is for.

1) Do not write to unit iow as it is the unit used for the output file.  Feap has a scratch disk used for i/o like you want (ios).

2) You should write your own out put file for the forces.  You can look at the file prform.  You can use the id(ndf,numnp) to get the entries to print from the forces.  This array stores the equation number for each dof which will be used to output the correct force.

3.) Generally, many of the files do not output zero values for quantities.  But feap does not form equations for fixed b.c., the specified displacement is used to modify the equations.  Hence, there is no force for these dof's (equations are numbered to account for the fixed dof).

Dear professor,

Thanks for the suggestions and I apologize that I am only now answer.
To the point 2) I have a question:
How can I get to the array
Code: [Select]
id (*,*)access? Or. Where can I find the array? I ask because I could not find it in any .h file.

P.S. I use FEAP ver. 8.2

serkuz

  • Jr. Member
  • **
  • Posts: 26
Re: Export forces
« Reply #4 on: December 13, 2016, 07:27:02 AM »
Hello again,

Meanwhile, I have found the right subroutine (hopefully)

Code: [Select]
call prtrea(hr(np(26)),hr(np(43)),
  & ndm,ndf,start,ende,inkr,prth)
However, I do not get the right results. Is hr (np (26)) right at all?

In pouta.f I write the following:

Code: [Select]
...
      elseif(pcomp(array,'nfrc',4)) then
      ....
      open (.....)....

       call prtrea(hr(np(26)),hr(np(43)),
     &                ndm,ndf,1,numnp,incr,prth)
     close(...)
...

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Export forces
« Reply #5 on: December 13, 2016, 09:43:18 AM »
All the main arrays in feap have pointers "np(.)" which are identified in the subroutine "palloc.f" in the ./program directory.  there you can find ID as well as others.   Also the main arrays are defined in the programmer manual.  You should study the part on using arrays.  Note the difference between "real*8" and "integer" array use.

serkuz

  • Jr. Member
  • **
  • Posts: 26
Re: Export forces
« Reply #6 on: December 14, 2016, 12:55:43 AM »
All the main arrays in feap have pointers "np(.)" which are identified in the subroutine "palloc.f" in the ./program directory.  there you can find ID as well as others.   Also the main arrays are defined in the programmer manual.  You should study the part on using arrays.  Note the difference between "real*8" and "integer" array use.

Dear Professor Taylor,

Thanks for the answer. I have found the right pointer. For the reaction forces it is np (26).

And then I have inserted in pouta.f the following:

       elseif (pcomp (array, 'nfrc', 4)) then
       prth = .false.
       call setcount(array,nnfrc,i)
       open(unit = ios,file = trim(array)//datatype,status = 'unknown')
       rewind(ios)
        call prtrea (hr (np (26)), hr (np (43)),ndm, ndf, 1, numnp, incr, prth)

However, I get other results than "reac all" in interactive supplies. What am I doing wrong?

Best regards
Serkuz
« Last Edit: December 28, 2016, 12:45:05 PM by serkuz »

Prof. R.L. Taylor

  • Administrator
  • FEAP Guru
  • *****
  • Posts: 2649
Re: Export forces
« Reply #7 on: December 14, 2016, 08:11:58 AM »
Where is pretreat putting the output?  Look at the unit it uses?  You may need to set iOS

Iowsv = iow
Iow.   = ios
..... do the output

Iow. = iowsv

serkuz

  • Jr. Member
  • **
  • Posts: 26
Re: Export forces
« Reply #8 on: December 15, 2016, 01:54:53 AM »
Where is pretreat putting the output? Look at the unit it uses? You may need to set iOS

Iowsv = iow
Iow. = ios
..... do the output

Iow. = iowsv
Thank you very much, Professor Taylor. It works.