Jump to content


  • Content Count

  • Joined

  • Last visited

Posts posted by Bachelor22

  1. Okay, thanks a lot!


    One last question I got:


    I run a topology optimization using a stress constraint of 40,000 MPa.

    I got the message, that all constraints are satisfied but doing a FE-reanalysis the maximum stress is above 40,000 MPa.


    How can this be explained? Did I put the density threshhold too high?

  2. Hey guys,


    I got a question on topology optimization again.

    I want to set a Stress Constraint for my optimization, how can I estimate a reasonable value for this constraint to avoid getting an infeasible design?


    Besides, how do I know which of my constraints is hurt when this error is occurring?


    Kind regards


  3. Hello Rahul,


    thanks for your quick reply and the documents provided.

    I understand how the penalization is working and that the stiffness matrix of the structure is depending of a pseudo element density.


    I still don't get how this density is calculated. What is this variable depending on? And when does the density take a value of 0, for void, and when for 1, for solid material?

    Could you help me out with this question?


    Kind regards and thanks in advance,


  4. Hey guys,


    I have a question on the theory of the SIMP Method used in OptiStruct to perform a Topology Optimization.

    I got that the stiffness matrix of a material is varied depending on its "density" and that using the penalization factor p, we are aiming for design with only 0 and 1 values in the end.


    For me it's still unclear, how OptiStruct is calculating these density values. How does the solver know where I have an element with density 0, 1 or something in between?


    Kind regards and thanks in advance



  5. Thank you, this already helps me a lot!

    But somehow, the  line  *createmark elems 2 "less than value" collector.material.\$E $Grenzwert 0 marks all the elements of the model.

    Is the variable $E the youngs modulus and does it have to be declared before using the command?

    And what's the meaning of the 0 at the end of the line?


    Or in general: What do I have to put in here: collector.material.\$E

    The real collector names or can I leave it as it is?

  6. Hey guys,


    I'm trying to write a script which deletes elements of a model, that have a young's modulus under a certain value ("Grenzwert").

    Running the following Code, this is working as it is supposed to for the first 5 iterations. Afterwards the number of elements deleted stays the same all the time. The problem is, that there are still elements with a youngs modulus lower than 100.

    Do you know what's the problem here?


    Some annotations which may help to understand the code:

    lStressValue_1 = list containing the young's modulus of every element

    delete_id = element id which should be deleted


    # Suchen aller Werte unter Grenzwert
    set delete_id ""
    set delete_index {}
    set Grenzwert 100
    set y -1
    set Element ""
    # y gibt den Index des Felded unter Grenzwert an wird zu einer Liste zusammengefügt
    foreach Element $lStressValue_1 {
            incr y
            if {[expr $Element < $Grenzwert]} {
                lappend delete_index "$y"
    # Die Element-Ids aus der Liste der lIDs mit den Elementen unter Grundwert herauslesen
    foreach Element_C $delete_index {
        append delete_id "[lindex $lID_1 $Element_C] "

    *createmark elements 1 {*}$delete_id
    *deletemark elements 1


    Kind regards,


  7. Hey guys,


    I'm trying to customize the output of a load step. Trying to run again the relevant parts of the command file, an error is occurring in this line.

    *startnotehistorystate {Updated string array}
    *setvalue loadsteps id=1 STATUS=2 4873={        } ROW=0
    *endnotehistorystate {Updated string array}


    I'm pretty sure the empty brackets are the reason for the error, but I don't know how to get around them.

    Could you help me out with this problem?


    Kind regards



    Attached you'll find my code. The relevant part starts after line 254.



  8. Hey guys,


    after I have finished my work on a model, I start a new session in HyperMesh and want to delete the .fem-File from the previous model. This is not working, and a message appears saying that the .fem-file is still open in HyperMesh.


    If the command "file delete" is used, an error is occurring which says "permission denied".

    Do you know how I can solve this problem and delete the .fem-File without closing HyperMesh totally?


    Kind regards


  9. Hey guys,


    I want to create several materials, properties and components automatically.

    The desired IDs of all the materials, properties and components are saved in an external file and then written into a variable. Each of these values should create an own material, an own property and an own component. 

    For creating the first material, everything works fine. But when the second material should be created, an error is occurring.

    Do you have an idea how this problem can be fixed?


    Kind regards



    Attached, you can find the file with the IDs (these are the values in column 1 saved into the variable "field1") and the .tcl-script I'm talking about.





  10. Hey guys,


    I'm trying to implement an algorithm for the Soft Kill Option in HyperMesh.

    An important step is to vary the Young's Modulus of each element depending on the element stress. As a consequence of the different stresses of every element, do I need to create a new material and a new property for every element?

    Or do you have another way to solve this problem?


    Kind regards and thanks in advance


  11. Thanks for your efforts! 


    1. I'm executing a solver at first and load the results afterwards. 
    But sometimes the solver failed because the meshed is too bad, so no result file is
    written. The command *plotnodelist needs the results file and fails if it's not existing.
    --> HyperWorks closes


    2.  meshing problem is non-correctable, because two 2d mesh edges are running into each other 
    during thermal expansion and the mesh overlaps. The solver fails in the next step in a static analysis (--> 1)
    The overlapping is shown in the picture.


    The skript is running for many iteration without problems, but after some iteration the described problem occurs and HyperWorks crashes.
    I want so improve the mesh after it fails and start the programm again.


    There must be a mistake in the code of catching the problem.



    For the sake of completeness the part before the command '*plotnodelist


    # executing the solver


    exec $batch -analysis "$path/${name}.fem"
    hm_answernext yes
    *analysisfileset "$path/${name}.res"


    #make a contour plot

    *setgeomrefinelevel 1
    *setcuttingplanesbase 0 29.3749355 7.5
    *clipboundaryelements 1
    *inputsimulation "SUB1 - Statische Analyse      " "Von Mises Stress"
    *contourplot "" 0 0 0 0 1 0 0 0 "magnitude" 1 0 0


    #select the component nodes and plot the results

    *createmark nodes 1 "by comp name" Randschicht 
    *createlist nodes 1 {*}[hm_getmark nodes 1] 
    set NodeList [hm_getlist nodes 1] 


    if { [catch {*plotnodelist 1}] } {
       puts "analysis failed "

    } else {

    *plotnodelist 1



  12. Hey guys,


    I want to catch a mistake concerning the mesh. when this mistake is occuring, the user should be able to fix the mesh.

    During a while loop i have sometimes an error in the command *plotnodelist, because it needs the inputs "results of a analysis" and "nodes id".

    Sometimes the analysis fails and *plotnodelist leads to a break down of Hyperworks because of the missing results. 

    Here is the relevant part of my code:


    while {} {......


    if { [catch {*plotnodelist 1}] } {
       puts "analysis failed "

    } else {

    *plotnodelist 1





    Kind regards


  13. Hey guys,


    I'm looking for a .tcl-command to completely close a program. The program starts with a messagebox where you can choose yes or no. If you select yes, the program runs as it is planned.

    If you choose no, the whole program should stop. There for I used the exit 2 command.

    But instead of closing the whole program it only closes the message box and tries to run the code afterwards.

    Do you have an idea how to fix that problem?


    This is the relevant part of the code:

    set starting [tk_messageBox -message "Möchten Sie eine vorhandenes Modell verwenden?" -type yesno -icon question -title "Einladen des Modells"]
    switch -- $starting {
    yes {
    set basedir {C:/}
    set filetypes {{{Text} {*.fem}} {{Alle} {*}}}

    set par [tk_getOpenFile \
            -initialdir [pwd]\
            -title "Startdatei wählen..."\
            -filetypes $filetypes
        *feinputwithdata2 "\#optistruct\\optistruct" "$par" 0 0 0 0 0 1 9 1 0
        no {
            exit 2

    *createentity mats cardimage=MAT1 name=material1



    Kind regards,


  • Create New...