We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Ansys Products

Ansys Products

Discuss installation & licensing of our Ansys Teaching and Research products.

ANSYS Mechanical APDL Nodal coordinates

    • Todd Kelmar
      Subscriber

      Hello, I have an APDL script to export Node names, nodal coordinates, and some other info from a modal analysis. 

      The issue I'm having in some nodal coordinates with small values (0.003) are exporting as 0. I have verified that the nodes are not actually overlapping, and can export the proper coordinates manually, but can't figure out why APDL isn't able to return the same coordinates. The relevant code is: 

      ! Select lowest node in the subset as the active node
      NODE = currn
      ! LOOP through all nodes in the subset, for each node store the node ID, NODE X< Y< Z Coord in Node_List
      *DO, k,1,NUM_NODES,
      /GOPR
      /PREP7
      ncx = nx(currn)
      Node_List(k,1) = currn
      Node_List(k,2) = nx(currn)
      Node_List(k,3) = ny(currn)
      Node_List(k,4) = nx(currn)
       
      /POST1
      !Loop through all 13 frequencies and extract the modal displacement (vector sum) and store in mode shapes for the current node
      *DO, l,1,13,1
      SET,1,MODES(l),
       *GET, MODE_SHAPES(k,l), NODE, currn,U,SUM
      *ENDDO
      !Increment to next node
      *GET, currn, NODE, currn, nxth,
      !Select next node
      NODE = currn
      *ENDDO
       
    • Chandra Sekaran
      Ansys Employee

      The above script gets the (node id, x, y, z) and then also gets the USUM vs mode shape. All of these values are double precision. BUT I do not see where the data is being exported? You could try using *VWRITE with a proper format. For example you can try like shown in orange highlight below. This should give high precision export.

      *cfopen,output,dat   ! open a file called output.dat

      ! Select lowest node in the subset as the active node
      NODE = currn
      ! LOOP through all nodes in the subset, for each node store the node ID, NODE X< Y< Z Coord in Node_List
      *DO, k,1,NUM_NODES,
      /GOPR
      /PREP7
      ncx = nx(currn)
      Node_List(k,1) = currn
      Node_List(k,2) = nx(currn)
      Node_List(k,3) = ny(currn)
      Node_List(k,4) = nx(currn)
      *vlen,1
      *vwrite,Node_List(k,1),Node_List(k,2),Node_List(k,3),Node_List(k,4)
      node id= %i   x = %e   y= %e   z=%e
       
       
      /POST1
      !Loop through all 13 frequencies and extract the modal displacement (vector sum) and store in mode shapes for the current node
      *DO, l,1,13,1
      SET,1,MODES(l),
       *GET, MODE_SHAPES(k,l), NODE, currn,U,SUM
      *ENDDO
      !Increment to next node
      *GET, currn, NODE, currn, nxth,
      !Select next node
      NODE = currn
      *ENDDO
      *cfclose
    • Todd Kelmar
      Subscriber

      Thanks for the reply. 

       

      I did actually have more in my script that wrote outputs, but my error actually was:

      ncx = nx(currn)
      Node_List(k,1) = currn
      Node_List(k,2) = nx(currn)
      Node_List(k,3) = ny(currn)
      Node_List(k,4) = nx(currn) 
       
      which should have been nz(currn)
       
      Thanks!
Viewing 2 reply threads
  • The topic ‘ANSYS Mechanical APDL Nodal coordinates’ is closed to new replies.