Can I get the distance between two displaced nodes?
Yes, use the UPCOORD command to update the coordinates to their displaced locations, then use a get function. The Macro shown here can be used to calculate the distance between the nodes before and after deformation. A *ASK command prompts the user to input the node number of the first and second nodes to be queried. The UPCOORD command modifies the coordinates of the nodes based on the current displacements. A get function is used to determine the distance between the nodes. The UPCOORD command is then used again to modify the coordinates of the nodes back to their undeformed position. It is recommended that the user save the database before performing this operation, then revert to the saved database once the distance is determined. Another use for this technique is that a user might want to monitor the deformed distance while in solution to make a decision whether to continue. !************************************************************************* !*** START OF MACRO /solu *ask,node1,Enter node number of first node,1 !Prompts user to input node1 *ask,node2,Enter node number of second node,2 !Prompts user to input node2 distance_before=distnd(node1,node2) !Use get function disnd() to get the distance between two nodes upcoord,1 !Modifies the coordinates based on the current displacements distance_after=distnd(node1,node2) !Again using get function get deformed distance upcoord,-1 !Modifies the coordinates back to the undeformed position /out,myout,out !Redirect output to a file and print parameters /com,********************************************************************* /com,Distance between node %node1% and node %node2% BEFORE defomation = %distance_before% /com,Distance between node %node1% and node %node2% AFTER defomation = %distance_after% /com,********************************************************************* /out *uilist,myout.out !*** END OF MACRO !************************************************************************* An example is also provided below, with the node1 and node2 parameters defined: /prep7 !Creating a simple model mp,ex,1,30e6 mp,nuxy,1,0.3 et,1,plane42 blc4,0,0,20,10 amesh,all nsel,s,loc,x,0 d,all,all alls node1=node(20,10,0) !Assign parameter "node1" as the node number at (20,10,0) node2=node(20,0,0) !Assign parameter "node2" as the node number at (20,0,0) distance_before=distnd(node1,node2) !Use get function distnd() to get the distance between two nodes d,node1,uy,1 !For demonstration, given displacements are used here d,node2,uy,-1 /solu solve upcoord,1 !Modifies the coordinates based on the current displacements distance_after=distnd(node1,node2) !Again using get function get deformed distance upcoord,-1 !Modifies the coordinates back to the undeformed position /out,myout,out !Redirect output to a file and print parameters /com,********************************************************************* /com,Distance between node %node1% and node %node2% BEFORE defomation = %distance_before% /com,Distance between node %node1% and node %node2% AFTER defomation = %distance_after% /com,********************************************************************* /out *uilist,myout.out |
||
|