User macro customized to change material data

From FEAP Wiki
Jump to navigation Jump to search

Copy one of the umacrXX.f files from the user folder to your working directory. Add the include files

include 'cdat1.h'
include 'pointer.h'
include 'comblk.h'

Set the uct variable to what you would like to name your macro (4 letters). Let's say

  uct = 'resd'

We will call the macro as resd,,ma,dl,dv where ma will correspond to our material number and dl the data location that we will change, and dv the new data value we would like to store. Now after the else place the following code

call resdsub(hr(np(25)),nint(ctl(1)),nint(ctl(2)),ctl(3))

This will pass the location of the element data arrays for all materials and our 3 command line parameters ma,dl,dv to the subroutine resdsub; the first two parameters are passed as nearest integers and the data arrays are at offset np(25) in hr. The subroutine resdsub should look like

subroutine resdsub(d,ma,dl,dv)
implicit none
include 'cdat1.h'
integer       :: ma, dl
real (kind=8) :: d(ndd,*), dv

d(dl,ma) = dv

end