TAGGED: ansys-apdl, apdl-command
-
-
June 17, 2025 at 10:05 am
ubsxd
SubscriberDear 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,xlength_x=max_x-min_x
allsel Â
tol=1nsel,s,loc,x,L/2-tol,L/2+tol
nsel,r,loc,z,0-tol,0+tol
cm,X_TOP_NODES,nodesnsel,s,loc,x,-L/2-tol,-L/2+tol
nsel,r,loc,z,0-tol,0+tol
cm,X_BOTTOM_NODES,nodesALLSEL
NSLE
/solunsel,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
-
- You must be logged in to reply to this topic.
-
3266
-
1031
-
1004
-
859
-
798
© 2025 Copyright ANSYS, Inc. All rights reserved.