XANSYS Message: 40968 [Go back to message list]
No rating yet
Subject: Re: CDWRIT,CM
Author: Juha Tyllinen
Date: 2002-08-21 08:34:00Well,
Now that we are trying to speed things up, here is a fully vectorized
version where you can select the entity type you are saving. The saved
component (well, select status) is stored as file with 'cmp' extension and
includes two header lines: entity type and number of selected entities.
CMSave saves the status and CMResu resumes it from the file. Enjoy...
JKT
! Macro CMSave for ANSYS Rev. 6.1 by JKT
! This macro saves selection status
! Arg1 = 'FileName' (=component name)
! Arg2 = Entity type - 'kp'
! - 'line'
! - 'area'
! - 'volu'
! - 'node'
! - 'elem'
*IF,Arg2,eq,'node',then
Ar10=ndinqr(0,14) $Ar11=ndinqr(0,13)
*ELSEIF,Arg2,eq,'elem',then
Ar10=elmiqr(0,14) $Ar11=elmiqr(0,13)
*ELSEIF,Arg2,eq,'kp',then
Ar10=kpinqr(0,14) $Ar11=kpinqr(0,13)
*ELSEIF,Arg2,eq,'line',then
Ar10=lsinqr(0,14) $Ar11=lsinqr(0,13)
*ELSEIF,Arg2,eq,'area',then
Ar10=arinqr(0,14) $Ar11=arinqr(0,13)
*ELSEIF,Arg2,eq,'volu',then
Ar10=vlinqr(0,14) $Ar11=vlinqr(0,13)
*ENDIF
Ar12=strsub(Arg2,1,1)
Ar12=strcat(Ar12,'sel')
*DIM,Apu1_,array,Ar10 $*DIM,Apu2_,array,Ar10
*VGE,Apu1_(1),Arg2,1,Ar12 $*VFI,Apu2_(1),ramp,1,1
*VMA,Apu1_(1) $*VFU,Apu2_(1),comp,Apu2_(1)
Apu1_=
*DIM,Apu1_,array,Ar11 $*VFU,Apu1_(1),copy,Apu2_(1)
*CFO,Arg1,cmp
*VWR,Arg2
%C
*VWR,Ar11
%I
*VWR,Apu1_(1)
%10I
*CFC
Apu1_=
Apu2_=
/eof
! Macro CMResu for ANSYS Rev. 6.1 by JKT
! This macro resumes selection status saved by CMSave
! Arg1 = 'FileName' (=component name)
*DIM,Apu1_,string,4
*VRE,Apu1_(1),Arg1,cmp,,,1,,,0
(A4)
*DIM,Apu2_,array,1
*VRE,Apu2_(1),Arg1,cmp,,,1,,,1
(F10.0)
Arg2=Apu1_(1) $Apu1_=
Ar11=Apu2_(1) $Apu2_=
*IF,Arg2,eq,'node',then
Ar10=ndinqr(0,14)
*ELSEIF,Arg2,eq,'elem',then
Ar10=elmiqr(0,14)
*ELSEIF,Arg2,eq,'kp',then
Ar10=kpinqr(0,14)
*ELSEIF,Arg2,eq,'line',then
Ar10=lsinqr(0,14)
*ELSEIF,Arg2,eq,'area',then
Ar10=arinqr(0,14)
*ELSEIF,Arg2,eq,'volu',then
Ar10=vlinqr(0,14)
*ENDIF
Ar12=strsub(Arg2,1,1)
Ar12=strcat(Ar12,'sel')
*DIM,Apu2_,array,Ar11
*VRE,Apu2_(1),Arg1,cmp,,, ,,,2
(F10.0)
*DIM,Apu1_,array,Ar10
*VOP,Apu1_(1),1,scat,Apu2_(1)
%Ar12%,all ! This should not be necessary, but is!!!!
*VPU,Apu1_(1),Arg2,1,Ar12
Apu1_=
Apu2_=
/eof
> -----Original Message-----
> From: Joe Woodward [mailto:joe.woodward@p...]
> Mark, Dan, John,
> If you want to save time on large models, removing the *do
> loop makes a
> world of difference. I tried John's macro on 26746 nodes and
> it took ~30
> seconds. The vector command's below took 4 seconds. It also
> took only 6
> seconds to run on all 378372 nodes with a maximum node number
> of 892191.
| Posts possibly associated with message #40968 | Author | Date | Score |
| 40933 | CDWRIT,CM | Dan Bohlen | 2002/08/20 | |
| 40935 | Re: CDWRIT,CM | Sheldon Imaoka | 2002/08/20 | 0 |
| 40939 | Re: CDWRIT,CM | Dan Bohlen | 2002/08/20 | |
| 40942 | Re: CDWRIT,CM | John Crawford | 2002/08/20 | |
| 40943 | Re: CDWRIT,CM | Dan Bohlen | 2002/08/20 | |
| 40944 | Re: CDWRIT,CM | John Crawford | 2002/08/20 | |
| 40945 | Re: CDWRIT,CM | John Swanson | 2002/08/20 | |
| 40948 | Re: CDWRIT,CM | Mark Hommel | 2002/08/20 | |
| 40949 | Re: CDWRIT,CM | Dan Bohlen | 2002/08/20 | |
| 40950 | Re: CDWRIT,CM | Joe Woodward | 2002/08/20 | |
| 40951 | Re: CDWRIT,CM | Mark Hommel | 2002/08/20 | |
| 40968 | Re: CDWRIT,CM | Juha Tyllinen | 2002/08/21 | |
| 40969 | Re: CDWRIT,CM | John Crawford | 2002/08/21 | |