- 积分
- 34
- 注册时间
- 2009-9-1
- 仿真币
-
- 最后登录
- 1970-1-1
|
发表于 2012-11-14 12:42:13
|
显示全部楼层
来自 浙江杭州
Question:
How do I obtain element IDs, element connectivity, nodal coordinates, etc. from within my user-defined material subroutine?
Answer:
Functions that will return node IDs and element IDs:
Internal node or element ID = lqfint(a,b,c) where
a = external ID
b = data type:
1 = node
2 = brick
3 = beam
4 = shell
5 = thick shell
c = returned error flag:
0 = ID found
1 = ID not found
Exteral element ID = lqfinvf(internal_element_ID,ityp)
c
c ityp=2 solid
c ityp=3 beam
c ityp=4 shell
c ityp=5 thick shell
External node ID = lqfinv(internal_node_id, 1)
-------------------------------
Shortly after the release of 971 R5.0, Chen prepared a subroutine lqfnode which returns nodal coordinates and internal element ID if the external element ID is known.
That subroutine, along with a subroutine umat41v that demonstrates its use, are included in dyn21.extIDin.f. The print statements therein are specific to the test case 2x_sphere2plate.k.
I made some slight modifications to subroutine lqfnode and the aforementioned umat41v so that nodal coordinates and external element ID will be returned if the internal element ID is known. Those modifications are included in dyn21.intIDin.f.
Note that the argument nnm1 was added to subroutine umat41v and to the calls to umat41v in subroutines urmats and urmathn.
For reference, dyn21.f from ls971_d_R5_0_intel64_redhat54.tar.gz is the standard source code from which dyn21.extIDin.f and dyn21.intIDin.f sprang.
All aforementioned files are in http://ftp.lstc.com/anonymous/ou ... node_example.tar.gz
For older releases of LS-DYNA (than 971 R5.0), read on. Subroutine umat41 in dyn21.f of version 970 or subroutine userrrefin in dyn21.f of version 971
illustrates how to access IDs, coords, connectivity.
Here's an excerpt from 970 source code...
From within umat41-calling subroutine urmathn:
include 'mema.inc'
integer i_mem
common/dynmem/i_mem(1)
real r_mem(1)
equivalence (i_mem,r_mem)
integer*4 dm_x, dm_v, dm_xms, dm_me1
integer*4 dm_x0,dm_v0,dm_xms0,dm_me10
common /dynmem1/ dm_x, dm_v, dm_xms, dm_me1,
& dm_x0,dm_v0,dm_xms0,dm_me10
common/bk13/lc0,lc1h,lc1b,lc1s,lc1t,lc2,lc3,lc4,lc5,lc6,lc7,lc9,
1 lc10,lc11,lc12,lc13,lc14,lc15,lc16,lc17,lc18,lb0,lb1,lb2,
2 lc7a,lc7b,lc7c,lc7d,lc7e,lc7f,lc7g,lc7h,lc7i,lc7j,lc7k,lc7l
...
41 call umat41 (cm(mx+1),eps,sig,hsv,dt1,capa,'shell',tt,
. temper,nnm1+i,a(lc1s),r_mem(dm_x),5,i)
Then in umat41:
subroutine umat41 (cm,eps,sig,hisv,dt1,capa,etype,time,
. temp,i,ixs,x,k,j)
...
c i = internal element ID
c iext = external element ID
c ip = internal part ID
c ipext = external part ID
c n1,n2,... = internal node ID for element connectivity
c next1, next2,... = external node ID for element connectivity
c x1,y1,z1 = coordinates of first node in the connectivity
c x2,y2,z2 = coordinates of second node in the connectivity
c etc.
...
dimension ixs(k,*),x(3,*)
...
c 2nd argument of function nelmntid is 0 for solids, 1 for beams, 2 for shells,
c 3 for tshells
iext=nelmntid(i,0)
ip=ixs(1,i)
n1=ixs(2,i)
n2=ixs(3,i)
n3=ixs(4,i)
n4=ixs(5,i)
n5=ixs(6,i)
n6=ixs(7,i)
n7=ixs(8,i)
n8=ixs(9,i)
c external part and node ids
ipext=lqfmiv(ip)
next1=lqfinv(n1,1)
next2=lqfinv(n2,1)
next3=lqfinv(n3,1)
next4=lqfinv(n4,1)
next5=lqfinv(n5,1)
next6=lqfinv(n6,1)
next7=lqfinv(n7,1)
next8=lqfinv(n8,1)
c spot check coordinates
x8=x(1,n8)
y8=x(2,n8)
z8=x(3,n8)
...
|
评分
-
1
查看全部评分
-
|