TCL for Enforced Displacement based on Node Coordinate

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hello,

 

I would very much appreciate if anyone could please help with the following  image/emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>

 

The structure that I'm working on undergoes bending, thus I'm trying to capture the bending effect by applying enforced displacements (SPCD) in the longitudinal direction of the structure (x-direction). The magnitude of each SPCD is determined by the nodes distance from the neutral axis in z-direction, as follows:


*createmark nodes 1 'on plane' 0 0 0 1 0 0 .1 1 1
foreach nodeid [hm_getmark nodes 1] {

set z_coord [hm_getentityvalue nodes [lindex $nodeid 0] 'z' 0]
set disp_x [ expr double(-$M)/double($I_y)*(double($z_coord)-double($NA))*(double($fr)*double($fr_spacing))/double($E) ]
*createmark nodes 1 $nodeid
*loadcreateonentity_curve nodes 1 3 2 $disp_x -999999 -999999 -999999 -999999 -999999 0 0 0 0 0

}

I'm aware that this approach is rather inefficient for large number of nodes since it is creating the SPCD one by one. Thus, if you do have a more efficient way of doing it, kindly share if you don't mind. 

 

I was thinking if it is possible to apply the constraint (SPCD) in terms of equation (based on Z-coordinate of the node) on the surface, and have it 'evaluated' later on (very much like pressure load being applied onto surface using equation, and then mapped onto the mesh). I have used such function in Femap but for the life of me I could not find its counterpart in Hypermesh.

 

 

 

Many thanks for any help. 

 

 

Cheers

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited June 2015

    Hi,

    Anytime running tcl macros you can speed up them by Preferences>Script Performance

     

    In case you are doing work on big data, tcl is not appropriate. Your above sample can be done by a template. It becomes easy if you know about template, so learn it in HM Help first

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2015

    Many thanks for the script performance tip! 

     

    Unfortunately I need to use TCL for my dissertation, but will certainly keep in mind about template in the future.

     

    If anyone knows any other way to speed up the process, I'll be more than happy to hear you out.

     

     

    Cheers

  • tinh
    tinh Altair Community Member
    edited June 2015

    Many thanks for the script performance tip! 

     

    Unfortunately I need to use TCL for my dissertation, but will certainly keep in mind about template in the future.

     

    If anyone knows any other way to speed up the process, I'll be more than happy to hear you out.

     

     

    Cheers

    Why didn't you think that you would use tcl to generate the template? tcl is not designed to perform complex works but it can link complex works to form a good workflow

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited June 2015

    It was mentioned that TCL is not appropriate for big data, thus I was under the assumption the template would be a new learning curve.

     

    Will look into it. Thank you.