We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Issue with nodepairing using nearest neighbors

    • ubsxd
      Subscriber

      Dear forum,

      In MAPDL, I am trying to couple nodes periodically. Therefore I select nodes on opposite faces (for example pos-x and neg-x), group and align them and use *moper to create nodepairs based on proximity (nearest neighbors). These nodepairs should then each be coupled. This approach works well with values that are equal between all coordinate systems (in my case the pos-z and neg-z), but there seems to be a mismatch somewhere when using nodes lying on a tilted plane. I will attach an example nlist printout of both groups in x-direction (pos and neg) as an image, as well as a code snippet I think to be relevant. 

      I would greatly appreciate any kind of help! 

      Code snippet:

      clocal,15,0,0,0,0,45,0,0
      csys,15

      *get,max_x,node,0,mxloc,x
      *get,min_x,node,0,mnloc,x

      length_x=max_x-min_x
      allsel  
      tol=1

      nsel,s,loc,x,L/2-tol,L/2+tol
      nsel,r,loc,z,0-tol,0+tol
      cm,X_TOP_NODES,nodes

      nsel,s,loc,x,-L/2-tol,-L/2+tol
      nsel,r,loc,z,0-tol,0+tol
      cm,X_BOTTOM_NODES,nodes

      ALLSEL
      NSLE
      /solu

      nsel,none
      cmsel,s,x_top_nodes,node
      *get,nodnum,node,0,count
      *dim,coord,array,nodnum,3
      *dim,nodepairs,array,nodnum,2

      *vget,nodepairs(1,1),node,,nlist

      *get,ndmx1,node,,num,max
      *dim,ndat1,array,ndmx1,2
      *vget,ndat1(1,1),node,1,nsel

      *vmask,ndat1(1,1)
      *vget,ndat1(1,2),node,1,loc,x
      *vmask,ndat1(1,1)
      *vfun,coord(1,1),comp,ndat1(1,2)

      *vmask,ndat1(1,1)
      *vget,ndat1(1,2),node,1,loc,y
      *vmask,ndat1(1,1)
      *vfun,coord(1,2),comp,ndat1(1,2)

      *vmask,ndat1(1,1)
      *vget,ndat1(1,2),node,1,loc,z
      *vmask,ndat1(1,1)
      *vfun,coord(1,3),comp,ndat1(1,2)

      *voper,coord(1,1),coord(1,1),SUB,length_x

      cmsel,s,x_bottom_nodes
      *moper,nodepairs(1,2),coord(1,1),nnear,tol

Viewing 0 reply threads
  • You must be logged in to reply to this topic.