-orion-
Structural
- Dec 27, 2017
- 3
Hello everyone!
I am a beginner structutal analysis engineer working for an aerospace company.
Problem description:
Usually only a small portion of the mesh has significant stress and needs to be included in downsteam fatigue post-processing. To tell the external fatigue solver which parts of the mesh to analyse I have to export element lists from Wrokbench. External fatigue solver requires the text file to be formated nastran-wise (hence the hard coded FSET3 and ELEM keywords and 8 charter per column formatting).
I have written a macro (pasted below) which works properly as long as I specify whole bodies as named selections in WB. It then outputs a separate text file for each named selection named EXPORT1, EXPORT2, EXPORT3 which contain elements for that particular selected body.
Subsequently I tried to limit the scope of the export even further because usually I do not require an entire body to be analysed for fatigue. It is sufficient for me to export just a few critical fillets of a body. The problem is that when I specify a face or even use the worksheet add>face>convert to>mesh node>convert to> mesh element to create the named selection the macro does not work properly, it starts putting out all the nodes in the model! Right clicking on the named selection and exporting manually to a text file is of no use since I require the element numbers and not the node numbers WB writes out.
Here is the macro that works properly only when EXPORT%l% is scoped on a body, does anyone know what I did wrong? Can anyone point me in the right direction? Thanks in advance .
!EXPORT_MACRO:
! Input:
ll=5 ! number of bodies to export
!------------------------------------------------------------------
*dim,s,string,24
*do,l,1,ll,1
cmsel,s,EXPORT%l%,elem
*get,ee,elem,,count
e_id=0
*cfopen,EXPORT%l%,out
val=chrval(l)
s(1)='FSET3'
s(9)=val
s(17)='ELEM'
*vwrite,s(1)
%C
*do,i,1,ee,1
s(1)=' '
*GET,e_id,ELEM,e_id,NXTH
s(9)=chrval(e_id)
*vwrite,s(1)
%C
*enddo
*cfclose
allsel
*enddo
I am a beginner structutal analysis engineer working for an aerospace company.
Problem description:
Usually only a small portion of the mesh has significant stress and needs to be included in downsteam fatigue post-processing. To tell the external fatigue solver which parts of the mesh to analyse I have to export element lists from Wrokbench. External fatigue solver requires the text file to be formated nastran-wise (hence the hard coded FSET3 and ELEM keywords and 8 charter per column formatting).
I have written a macro (pasted below) which works properly as long as I specify whole bodies as named selections in WB. It then outputs a separate text file for each named selection named EXPORT1, EXPORT2, EXPORT3 which contain elements for that particular selected body.
Subsequently I tried to limit the scope of the export even further because usually I do not require an entire body to be analysed for fatigue. It is sufficient for me to export just a few critical fillets of a body. The problem is that when I specify a face or even use the worksheet add>face>convert to>mesh node>convert to> mesh element to create the named selection the macro does not work properly, it starts putting out all the nodes in the model! Right clicking on the named selection and exporting manually to a text file is of no use since I require the element numbers and not the node numbers WB writes out.
Here is the macro that works properly only when EXPORT%l% is scoped on a body, does anyone know what I did wrong? Can anyone point me in the right direction? Thanks in advance .
!EXPORT_MACRO:
! Input:
ll=5 ! number of bodies to export
!------------------------------------------------------------------
*dim,s,string,24
*do,l,1,ll,1
cmsel,s,EXPORT%l%,elem
*get,ee,elem,,count
e_id=0
*cfopen,EXPORT%l%,out
val=chrval(l)
s(1)='FSET3'
s(9)=val
s(17)='ELEM'
*vwrite,s(1)
%C
*do,i,1,ee,1
s(1)=' '
*GET,e_id,ELEM,e_id,NXTH
s(9)=chrval(e_id)
*vwrite,s(1)
%C
*enddo
*cfclose
allsel
*enddo