Creation of lattice members

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

Hi, 

 

 

I am attempting to create lattice members using a 3D geometry, I have come across a paper (see attached, pages 3 and 4) that uses the mesh to create derivative bars and nodes, I'm wondering if anyone knows how this could be achieved within Hypermesh and would be willing to talk me through the process. 

 

Kind Regards,

 

Laurence

Unable to find an attachment - read this blog

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited March 2019

    It looks easy, need a loop through each elem and bind its centroid to nodes by 1d beams.

    It's very slow if create them directly for big model, we can write it to a deck and let hm input reader creates them.

     

    I will check if split panel could help, with full hexas i think ok.

  • tinh
    tinh Altair Community Member
    edited March 2019

    With 2d mesh it is trivial, so I will guide you with 3d mesh:

     

    For boundary bars:

    - use panel tools>edges, switch 'find' to 'T-connection', you will get inner bars

    - use panel tools>faces to create face elems

    - use panel tools>features with angle 0deg to create bars on face elems

     

     

    For derived bars: run this proc will output them to a file named temp.fem

    Then you can import it as optistruct input deck.

     

    proc p_DerivedBars args {

         *createmarkpanel elems 1 'Select 3d elems'

         set buff1 ''

         set buff2 ''

         set i 0; set j 0

         foreach NodeList [hm_getvalue elems mark=1 dataname=nodes] cx [hm_getvalue elems mark=1 dataname=centerx] cy [hm_getvalue elems mark=1 dataname=centery] cz [hm_getvalue elems mark=1 dataname=centerz] {

             append buff1 'GRID,[incr i],,$cx,$cy,$cz\n'

              foreach NodeId $NodeList {

                   append buff2 'PLOTEL,[incr j],$i,$NodeId\n'

              }

         }

     

         set fpt [open temp.fem w]

         puts $fpt $buff1

         puts $fpt $buff2

         close $fpt

    }

     

     

  • tinh
    tinh Altair Community Member
    edited March 2019

    Above guide just create plotel elements, switch them to bar2 by panel 3d>config edit

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2019

    Hi Tinh,

     

    Apologies but I am still relatively new to Hypermesh. How do I run this script? I copied it and saved it as a .tcl and ran it using run tcl script toolbar but nothing happens.

     

    Kind Regards,

     

    Laurence

  • tinh
    tinh Altair Community Member
    edited March 2019

    Append this line to the tcl file :

    p_DerivedBars

     

    or input it at cmd window

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2019

    Hi Tinh,

     

    I get an error message saying 'Error: extra characters after close-brace'

     

    Kind Regards,

     

    Laurence

  • tinh
    tinh Altair Community Member
    edited March 2019

    That is simply due to you copying my code and paste. Do type it again your self. Be not lazy

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2019

    Hi Tinh, I wrote the code out and saved it as a .tcl file, when I execute it within Hypermesh, nothing happens. No messages or errors. I am using a solid map mesh with hexas. Any idea why it wouldn't be running?

  • tinh
    tinh Altair Community Member
    edited March 2019

    Enter this cmd into command window

    p_DerivedBars

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2019

    Hi Tinh, the script is now running, but I get an error saying: 'hm_getvalue: centerx is not a valid data name' I had a look at the data names for 2017 installation and could not find centerx. Any suggestions?

     

    Kind Regards,

     

    Laurence

  • tinh
    tinh Altair Community Member
    edited March 2019

    Really?

    I ran it on hm13.

    I will check hm17...

  • tinh
    tinh Altair Community Member
    edited April 2019

    Hm17 has centerx y z for elems.

    I think you typed something wrong.

    I tested and it worked. So please make it run on your hm.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Hi Tinh,

     

    I apologise, I made a mistake with writing the script. I'm English so I wrote 'centre' instead of 'center'. I now have the script running but I have hit another issue, when I build up a model and run it I get a message saying the following:

     

     'GRID           1        9.91212213.45212-16.6676'

      *** ERROR # 1020 *** in the input data:
      Missing BEGIN BULK or line before BEGIN BULK has trailing comma.
     

    I have attached the .out file, my  and fem file for your review. I had a look at the .out file and there are indeed many decimal places in the grid, why would this be happening and how can I repair this issue?

     

    Laurence

     

    Unable to find an attachment - read this blog

  • tinh
    tinh Altair Community Member
    edited April 2019

    Hi

    Open temp.fem by notepad and add BEGIN BULK before 1st GRID line

  • tinh
    tinh Altair Community Member
    edited April 2019

    About decimal dot, when you export, click 'export option' and uncheck 'remove E from real value'

    But I think it is not neccessary.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Hi Tinh,

     

    When I run the script, I get an output, but it is not what I desire. I require the lines to be connected to a central node in each quad element. This script produces many lines that are randomly connected to nodes all over the geometry, how can I alter the script so that the body centred cubic is created for each quad element?

     

    Thanks,

     

    Laurence 

     

    P.S. I have attached the input and output files for your reference.

    Unable to find an attachment - read this blog

  • tinh
    tinh Altair Community Member
    edited April 2019

    Really?

    Could you change

    'set i 0'

    to

    'set i [hm_entitymaxid nodes]'

     

     

    It will not mess up node ids.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Hi Tinh,

     

    I made the change as you suggested but now nodes are not being found in the model (see attached). So the entities are being skipped.

     

    Kind Regards,

     

    Laurence

    Unable to find an attachment - read this blog

  • tinh
    tinh Altair Community Member
    edited April 2019

    Hi,

    I just use a phone and i don't have hypermesh. So please describe problem by images

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Hi Tinh,

     

    I run the script, open the fem file and get the error shown in the image. Nothing is imported when I import the solver deck. There are 1380 errors.

     

    I've also attached an image of the script I am currently using.

     

    Kind Regards,

     

    Laurence

    <?xml version="1.0" encoding="UTF-8"?>error2.PNG

    <?xml version="1.0" encoding="UTF-8"?>script.PNG

  • tinh
    tinh Altair Community Member
    edited April 2019

    You must import the temp.fem to your current model

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Hi Tinh,

     

    I made the change you suggested. I've attached two screenshots. 1 is the output from the script when i is set to [hm_entitymaxid nodes] and 2 when i is set to 0.

     

    It seems that the script is successfully creating lines with nodes, but they are not bonded to a central node.

     

    Kind Regards,

     

    Laurence

    <?xml version="1.0" encoding="UTF-8"?>2.png

    <?xml version="1.0" encoding="UTF-8"?>1.png

  • tinh
    tinh Altair Community Member
    edited April 2019

    Please attach your hm file so i can check it,

    i think it is garbage

  • tinh
    tinh Altair Community Member
    edited April 2019

    And, try Imoto's script. I think small model is no problem.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited April 2019

    Hi Tinh,

     

    I used Imoto's script and I now have the desired result. Thank you for your assistance, I learnt a great deal through your replies.

     

    Kind Regards,

     

    Laurence