General Mechanical

General Mechanical

Centroid of named selection (face) with APDL

    • ofo
      Subscriber

      Hi,

      How do I get the centroid of a named selection in APDL? It needs to be done in post processing, as is needs to be found for the deformed shape (at least when large deflection is turned on). I tried to use ASUM/GSUM, but they don't seem to be appliable in POST. Is it possible to find the centroid of an arbitrary area with APDL?

      My very simple code:

      cmsel,s,NamedSelection
      asum
      *get,CentroidX,area,0,cent,x
      *get,CentroidY,area,0,cent,y
      *get,CentroidZ,area,0,cent,z

      Unfortunately it doesn't work, as post.out states that: "ASUM is not a recognized POST1 command, abbreviation, or macro..."

      Thanks in advance. Your help is much appreciated.

    • Bill Bulat
      Ansys Employee

      ASUM returns the inertial properties of an area (a "surface body" created with MAPDL). There are no MAPDL "solid model" entities in models created by Mechanical, so if your model was created in Mechanical I would not expect ASUM to work.

       

      This is old code but I think it might still work. 

      finish
      save
      /file,scrap
      /solu
       
      cmsel,s,named_selection
      esln,s,1
       
      irlf,-1
      psolve,elform
      psolve,elprep
      irlist
      *get,mtot,elem,,mtot,x
       
      *get,mcx,elem,,mc,x
      *get,mcy,elem,,mc,y
      *get,mcz,elem,,mc,z
       
      *get,imcx,elem,,imc,x
      *get,imcy,elem,,imc,y
      *get,imcz,elem,,imc,z
       
      *get,ipx,elem,,iprin,x
      *get,ipy,elem,,iprin,y
      *get,ipz,elem,,iprin,z
       
      *get,ang_xy,elem,,iang,xy
      *get,ang_yz,elem,,iang,yz
      *get,ang_zx,elem,,iang,zx
       
      finish
      /file,file
      resume
      /solu 
       
       
      The parameters returned by the *GET command in the code above are described in the MAPDL Help:

      I hope this helps!

      Bill

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