"" I've been using abaqus for over a year now but I am still not familiar with how to use subroutines and have a problem I need to address. Lets say I create a wire, with a certain length, and assign it a beam section. I then mesh the wire, with a certain number of beam elements. Now I want to give this wire a certain shape using some parametric equations. In order to do this, I need to apply a force or a displacement at each node of the wire mesh. Lets just say I want it to take the shape defined by F(x)=sin(x), where x is the distance along the wire. How do I create a sub-routine to make this happen? Is there already one that does this sort of thing. Thanks for the help! ""
If this is still your question, this is the answer:
subroutine vdisp(
c Read only variables -
* nblock, nDof, nCoord, kstep, kinc,
* stepTime, totalTime, dtNext, dt,
* cbname, jBCType, jDof, jNodeUid, amp,
* coordNp, u, v, a, rf, rmass, rotaryI,
c Write only variable -
* rval )
c
include 'vaba_param.inc'
parameter( zero = 0.d0, half = 0.5d0, one = 1.d0 )
c
character*80 cbname
dimension jDof(nDof), jNodeUid(nblock),
* amp(nblock), coordNp(nCoord,nblock),
* u(nDof,nblock), v(nDof,nblock), a(nDof,nblock),
* rf(nDof,nblock), rmass(nblock),
* rotaryI(3,3,nblock), rval(nDof,nblock)
c
c Impose displacement
c jBCType
c Indicator for type of prescribed variable: 0 for displacement, 1 for velocity, and 2 for acceleration.
c
if( jBCType .eq. 0 ) then
c
if( stepTime .lt. zero ) then
c
c Initialization 1
c
a0 = zero
do 310 k=1, nblock
do 310 j=1, nDof
if ( jDof(j) .gt. 0 ) then
rval(j,k) = 0
end if
310 continue
c
else if( stepTime .eq. zero ) then
c
c Initialization 2
c
a0 = zero
do 320 k=1, nblock
do 320 j=1, nDof
if ( jDof(j) .gt. 0 ) then
rval(j,k) = a0
end if
320 continue
c
else
c
c Time incrementation
c
c
do 350 k=1, nblock
do 350 j=1, nDof
if ( jDof(j) .gt. 0 ) then
Xcoord = coordNp(1, k)
rval(j,k) = sin (Xcoord)*amp(k)
end if
350 continue
end if
end if
c
return
end
this is when using the amplitude, else you can scale using stepTime.
Note: I just adjusted this from the example in the manual, I did not debug or anything and don't know if it'll work.
Also when c/p, make sure to obey all fortran syntax rules.
The initialization are a bit stupid and are only useful for giving velocities & accelerations.