🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Creation of lattice members

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

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

Find more posts tagged with

Sort by:
1 - 25 of 251
    User: "tinh"
    Altair Community Member
    Updated by tinh

    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.

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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

    }

     

     

    User: "tinh"
    Altair Community Member
    Updated by tinh

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

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Append this line to the tcl file :

    p_DerivedBars

     

    or input it at cmd window

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi Tinh,

     

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

     

    Kind Regards,

     

    Laurence

    User: "tinh"
    Altair Community Member
    Updated by tinh

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

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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?

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Enter this cmd into command window

    p_DerivedBars

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Really?

    I ran it on hm13.

    I will check hm17...

    User: "tinh"
    Altair Community Member
    Updated by tinh

    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.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi

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

    User: "tinh"
    Altair Community Member
    Updated by tinh

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

    But I think it is not neccessary.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Really?

    Could you change

    'set i 0'

    to

    'set i [hm_entitymaxid nodes]'

     

     

    It will not mess up node ids.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi,

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

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    You must import the temp.fem to your current model

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Please attach your hm file so i can check it,

    i think it is garbage

    User: "tinh"
    Altair Community Member
    Updated by tinh

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

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    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