Splitting CBEAM elements into individual properties

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

Hi,

 

I have a structure that is composed of many CBEAM elements, all of these CBEAM elements are under one property and one material. I need each of the individual CBEAM elements to have its own property and material. Is there a way to automate this. I have ~9000 beams.

 

I could lower the number of beams to something manageable so I could organize them individually but this is not ideal.

 

The end goal is to be able to alter the material properties of individual CBEAM's, E1 for example, simulating progressive damage with progressive lattice failure.

 

Can anyone help?

 

I have attached my .fem and hm for your visualisation.

 

Kind Regards,

 

Laurence 

Unable to find an attachment - read this blog

Tagged:

Answers

  • Merula_20758
    Merula_20758 Altair Community Member
    edited April 2019

    You can solve this with a .tcl script easily. Are you familiar with scripting ?

     

    Best regards

    Merula

  • Merula_20758
    Merula_20758 Altair Community Member
    edited April 2019
     *createmark elements 1 'by config' 'bar' set beamIds [hm_getmark elements 1]  foreach beamID $beamIds { # Create New Component  *createentity comps name=Component_$beamID # create material *createentity mats cardimage=MAT1 name=material_$beamID set materialID [hm_entityinfo id material 'material_$beamID'] *setvalue mats id=$materialID STATUS=1 1=210000 *setvalue mats id=$materialID STATUS=1 3=0.3 *setvalue mats id=$materialID STATUS=1 4=7.85e-009 *setvalue mats id=$materialID STATUS=1 2=80769.2 # Create New Property *createentity props cardimage=PBEAM name=property_$beamID set propertyID [hm_entityinfo id property 'property_$beamID'] *setvalue props id=$propertyID cardimage='PBEAM' *setvalue props id=$propertyID materialid={mats $materialID}  # Assign it to Component ## Assign the property and Material *setvalue comps id=[hm_entityinfo id component 'Component_$beamID'] propertyid={props $propertyID} ## Assign BeamSection To Property *setvalue props id=$propertyID STATUS=2 3186={beamsects 1} *createmark properties 1 $propertyID *syncpropertybeamsectionvalues 1 *mergehistorystate '' '' *setvalue props id=$propertyID STATUS=2 500=1 *setvalue props id=$propertyID STATUS=0 36=0 *setvalue props id=$propertyID STATUS=0 37=0 *setvalue props id=$propertyID STATUS=0 38=0 *setvalue props id=$propertyID STATUS=0 39=0  #Move Element *createmark elements 1 $beamID *movemark elements 1 'Component_$beamID'  } 

    It for sure is not ideal and it will take a while but I am curious what the experts think about it :-D

     

    Best regards

    Merula

     

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

    Hi Merula,

     

    Thank you for the script. I had a go on my model and I get a response that says 'beamIds' can't be read, no variable exists. Do you have any idea why? 

     

    Thanks,

     

    Laurence

  • tinh
    tinh Altair Community Member
    edited April 2019

    I wonder how you alter E1 of 9000 items?

  • Merula_20758
    Merula_20758 Altair Community Member
    edited April 2019

    Hi Merula,

     

    Thank you for the script. I had a go on my model and I get a response that says 'beamIds' can't be read, no variable exists. Do you have any idea why? 

     

    Thanks,

     

    Laurence

    Did you execute the first two lines?

    User Profile Optistruct?

     

    maybe just copy it into the tcl command console (at the bottom of the window)

    Hope this helps

    Merula

  • Merula_20758
    Merula_20758 Altair Community Member
    edited April 2019

    I wonder how you alter E1 of 9000 items?

    Good question... I suggest he wants to do it with a location... so all beams with a distance lower than x ...

     

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

    Did you execute the first two lines?

    User Profile Optistruct?

     

    maybe just copy it into the tcl command console (at the bottom of the window)

    Hope this helps

    Merula

     

    Hi Merula & Tinh

     

    I now get a message saying '*syncpropertybeamsectionvalues' is an invalid command name. 

     

    The basic idea of this is to simulate lattice failure by changing the stiffness, i.e. E1. I've written a basic script that alters the MAT1 material data card for a single  CBEAM property, this uses the allowable range that E1 can be.

     

    I can lower the number of bars if necessary, if ~9000 is too computationally challenging.

     

    Thanks,

     

    Laurence

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

    Danke Merula,

     

    The script works perfectly. It is a good base for what I intend to do.

     

    Kind Regards,

     

    Laurence 

  • Merula_20758
    Merula_20758 Altair Community Member
    edited April 2019

    Perfect. Good luck!