General Mechanical

General Mechanical

Speeding up APDL Scripts

    • Todd Kelmar
      Subscriber

      Hello, 

      I have the following APDL script that I'm using to extract data from a transient analysis for postprocessing. 

      The script seems to run very slow, taking far longer than the analysis  to complete. Is there a guide of best practices for handling large data sets in APDL or a more efficient way to get the info from ANSYS? 

      /POST1
      NSEL,S,LOC,Y, 0.0061

      *GET, NUM_NODES, NODE, 0, COUNT,
      *GET, NUM_STEPS, ACTIVE, 0, SOLU, NCMSS
      filename = 'CHIRP_TEST'

      *CFOPEN, filename, csv
      *VWRITE, 'T', 'NODE', 'X','Y', 'Z', 'AY'
      %C, %C, %C, %C, %C, %C
      *CFCLOS
      *CFOPEN, filename, csv, , append

      *DO, i, 1, NUM_STEPS, 1

      /PREP7
      NSEL,S,LOC,Y, 0.0061
      *GET, currn, NODE, 0, NUM, MIN
      NODE = currn

      *DO, j, 1, NUM_NODES, 1

      NODE_NUM = currn
      NODE_X = nx(currn)
      NODE_Y = ny(currn)
      NODE_Z = nz(currn)

      /POST1
      SET, 1, i
      *GET, NODE_TIME, ACTIVE, 0, SET, TIME
      *GET, NODE_AY, NODE, currn, A, Y

      *VWRITE, NODE_TIME, NODE_NUM, NODE_X, NODE_Y, NODE_Z, NODE_AY
      %e, %i, %e, %e, %e, %e

      /PREP7
      !Increment to next node
      *GET, currn, NODE, currn, nxth,
      !Select next node
      NODE = currn

      *ENDDO

      *ENDDO

      *CFCLOS

      FINISH

      Thanks!

    • Aliaksei Trukhnou
      Subscriber

      Hi. Sometimes if you run it in batch mode (from Mapdl launcher) it will be faster:) you need only before you text in your macros add "Resume" if you have db and rst files)

Viewing 1 reply thread
  • You must be logged in to reply to this topic.