Assignsystem and rename generated table

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

Hello,

I am writing a tcl script to create geometry and mesh it.

I would like to associate local coordinate system to the mesh and remesh the table with another name than the default one (DistCordTbl1)

For that, I am using the following code

*assignsystem_option elems 2 0 2 1 10 2 -> What is the difference between assignsystem_option and assignsystem ?

 

I tried to rename the table by 
set Tablename [hm_getvalue tables id=1 dataname=name]
*endnotehistorystate {Renamed Tables from $Tablename to 'test'}

 

or 
*setvalue tables id=1 name='test'

or

*endnotehistorystate {Renamed Tables from 'DistCordTbl1' to 'test'}

 

But none is working.

Can you help me ?

Thank you in advance

Best Regards

Answers

  • tinh
    tinh Altair Community Member
    edited August 2020

    About assignsystem_option and assignsystem: you should read reference help.

     

    If *setvalue tables id=1 name='test' is not working, maybe a table named test is existing, or id 1 not found

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2020

    Thanks Tinh,

    but I think there is a misunderstanding. I don't want to update values in table but to remake the table created by assignsystem.

    Do you have any idea to do that ?

    Thank you in advance

  • tinh
    tinh Altair Community Member
    edited August 2020

    To remake table, delete old one and recreate it.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2020

    Sorry Tinh, 

    I miswrite what I wanted. I would like to rename a table created by assignsystem. Indeed, with the default name, it is not easy to assign the good table to element group.

    Sorry for the mistake.

    Thanks

  • tinh
    tinh Altair Community Member
    edited August 2020

    To rename table, ensure that table id is existing and new table name is not currently existing.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2020

    Thank you Tinh,

    I found my mistake $ after incr in TCL ! So now it works. 

    Unfortunately, I am still stuck due to the following issues :

    - Test with *assignsystem_fromcurves elements 2 lines 1 10 7 1 0 $increment_table 1

        + a table is created but each element id is missing

        + the element orientation is unchanged '-Y direction' instead of 'Z direction' provided by the curve

    - Test with *assignsystem_option elements 2 0 2 1 50 7

        + No table is created

        + the element orientation is unchanged '-Y direction' whatever the axis used except for the X axis where no vector is printed

     

    As I don't use Optistruct for the code, the 'assign' button is not available. I can only have access to the 'project' button when I select elements by 'props'.

    As the props are defined separately from HyperMesh, it is not what I want.

     

    Do you have any clue to solve my issues ?

    Thank you in advance

     

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.6f89ddf98fc6049022320097313f93de.png

     

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.4d54a5481bb5836cac2e301e21b556f1.png

  • tinh
    tinh Altair Community Member
    edited August 2020

    If elem id is missing, reason may be it is not put in mark #2

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2020

    I checked that. I tried to add manually an elem id with the following line :

    *createmark elems 2 200000

    same for the line, I created manually the line mark

    *createmark lines 1 546

     

    But unfortunately, nothing works.

    When I look at the table with missing elem id, the total number of line is consistent with the number of element in the mark. i.e 20

  • tinh
    tinh Altair Community Member
    edited August 2020

    Perhaps elem id in the table is solver id, it is different from 200000 (internal id)

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2020

    I don't understand your last point.

    As you can see, the id 200000 exists.

    In my TCL script, I renumbered elem id before to assign a system with that line :

    *renumbersolverid elems 2 [expr 2*$Noeud_Elem_RD_Id_Start_BaseLine] 1 0 0

     

    Here is an extract of the output file. The id 200000 is defined.

    *ELEMENT,TYPE=S4R,ELSET=ELEM_PEAU_RAIDISSEUR_AMONT_COMP
        200000,    100000,    100001,    100002,    100021
        200001,    100021,    100002,    100003,    100020
        200002,    100020,    100003,    100004,    100019
        200003,    100019,    100004,    100005,    100018
        200004,    100018,    100005,    100006,    100017
        200005,    100017,    100006,    100007,    100016
        200006,    100016,    100007,    100008,    100015
        200007,    100015,    100008,    100009,    100014
        200008,    100014,    100009,    100010,    100013

     

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.d22188aed20954504e1382226ad6f1b6.png

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited August 2020

    I tested my script with OptiStruct. It's working except that no table is created.

    After check, the material orientation is modified within the expected way.

     

    But, I would like to have the Abaqus user preference instead of OptiStruct. 

     

    Do you have any advise ?

    Thank you in advance

  • tinh
    tinh Altair Community Member
    edited August 2020

    Yes id 200000 is existing but the command

    *createmark elems 2 200000

    may not put it in mark #2

     

    If you don't know what is solver id and what is internal id, then read reference help, or search related posts.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2020

    Tinh,

    without renumbering, it doesn't work. I selected the element by surface and not by id. Nothing works.

    Tables remain with empty element id.

    Are you sure, there is no bug with the Abaqus template ?

    Best Regards

  • tinh
    tinh Altair Community Member
    edited September 2020

    I don't understand you. If you can present problem by images, pls draw.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2020

    My code

     

                    set NSET_PEAU_RAIDISSEUR ''
                    set ELSET_PEAU_RAIDISSEUR ''
                    set ELSET_PEAU_RAIDISSEUR_COMP ''
                    set elem_ids []
                    set nodes_ids []
                    set TABLE_NAME ''
                    set Line_Id_ELEM_Orien 0
                    append NSET_PEAU_RAIDISSEUR 'NODES_' $NOM_PEAU_RAIDISSEUR '_AMONT'
                    append ELSET_PEAU_RAIDISSEUR 'ELEM_' $NOM_PEAU_RAIDISSEUR '_AMONT'
                    append ELSET_PEAU_RAIDISSEUR_COMP 'ELEM_' $NOM_PEAU_RAIDISSEUR '_AMONT_COMP'
                    *createentity sets type=nodes name=$NSET_PEAU_RAIDISSEUR id=100
                    *createentity sets type=elems name=$ELSET_PEAU_RAIDISSEUR id=101
                    *createentity comps name=$ELSET_PEAU_RAIDISSEUR_COMP id=102
                    incr increment_table
                    
                    # Recuperation du numero de la lisgne a utiliser
                    *createmark lines 1 'by surface' [lindex $Surf_List_Amont_Raidisseur 0]
                    set lines_ids [hm_getmark lines 1]
                    *clearmark lines 1;
                    # Selection de la ligne de projection
                    set lines_ids [regexp -all -inline {\S+} $lines_ids]
                    set lines_ids [lsort -unique $lines_ids]                
                    foreach Line_Id $lines_ids {
                        *createmark lines 1 $Line_Id
                        lassign [join [hm_getboundingbox lines 1 0 0 0]] x_min y_min z_min x_max y_max z_max
                        # Surface parallele au plan YZ
                        if {[expr $y_max - $y_min] <= 0.1 && [expr $z_max - $z_min] >= 0.1} {
                            set Line_Id_ELEM_Orien $Line_Id
                            break
                        }
                    }
                
                    # Parcours de toutes les sufaces
                    foreach Surf_Id $Surf_List_Amont_Raidisseur {
                        set lines_ids []
                        *createmark surfs 1 $Surf_Id;
                        *interactiveremeshsurf 1 $TailleElement_Raidisseur 4 2 2 1 1
                        #*set_meshfaceparams 0 5 0 0 0 1 0.5 1 1
                        *set_meshfaceparams 0 2 1 0 0 1 0.5 1 1
                        #*automesh 0 5 0
                        *automesh 0 2 4
                        *storemeshtodatabase 1
                        *ameshclearsurface
                        *clearmark surfs 1;
                        
                        *createmark nodes 1 'by surface' $Surf_Id
                        *renumbersolverid nodes 1 $Noeud_Elem_RD_Id_Start_BaseLine 1 0 0
                        *createmark nodes 1 'by surface' $Surf_Id
                        lappend nodes_ids [flatten [hm_getmark nodes 1]]
                        
                        *createmark elems 2 'by surface' $Surf_Id
                        #*renumbersolverid elems 2 [expr 2*$Noeud_Elem_RD_Id_Start_BaseLine] 1 0 0
                        *createmark elems 2 'by surface' $Surf_Id
                        lappend elem_ids [flatten [hm_getmark elems 2]]
                        *clearmark elems 2

                        # Affection de l'orientation materiau aux elements
                        *createmark lines 1 $Line_Id_ELEM_Orien
                        *createmark elems 2 'by surface' $Surf_Id
                        *assignsystem_fromcurves elements 2 lines 1 10 7 1 0 $increment_table 1
                        *clearmark lines 1
                        *clearmark elems 2
                    }
                    set nodes_ids [lsort -unique $nodes_ids]
                    set elem_ids [lsort -unique $elem_ids]
                    eval *createmark nodes 1 [flatten $nodes_ids]
                    eval *createmark elems 2 [flatten $elem_ids]
                    *entitysetupdate $NSET_PEAU_RAIDISSEUR nodes 1
                    *entitysetupdate $ELSET_PEAU_RAIDISSEUR elems 2
                    *movemark elements 2 $ELSET_PEAU_RAIDISSEUR_COMP
                    append TABLE_NAME 'SYS_ORIEN_TABLE_SURF_AMONT'
                    *setvalue tables id=$increment_table name=$TABLE_NAME
                    *clearmark elems 2
                    *clearmark nodes 1
                    *clearmark lines 1

     

    The created table is empty. The element orientation is the default one. I am sure about the line. (see the 1st picture) 

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.fb8187441e0709023a57d6cec98ab632.png

     

     

    With the same code and the Optistruct Template, the orientation element is good. (see the 2nd picture)

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.ffcb90f5e630c0407f734eaf2a81da14.png

     

    As you can see, I also tried to create shell property that is assigned to the same surface. I tried to define material orientation per the Analysis > Systems > material orientation. When I select the 3-local axis, the element orientation remain following the 2 - local axis.

    So my question is, is there any thing I made wrong or is there any bug in the Abaqus template ?

    <?xml version="1.0" encoding="UTF-8"?>image.thumb.png.a083ca2d028fece9727e0514263e555e.png

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

  • tinh
    tinh Altair Community Member
    edited September 2020

    What is 'flatten' proc?

    This cmd is potential bug:

    lappend elem_ids [flatten [hm_getmark elems 2]]

     

    Change it to:

    eval lappend elem_ids [hm_getmark elems 2]

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2020

    The flatten proc is this one :

    proc flatten data {
        concat {*}$data
    }

     

    I have tested your proposal. Unfortunately, it does not work. 

  • tinh
    tinh Altair Community Member
    edited September 2020

    The flatten proc is this one :

    proc flatten data {
        concat {*}$data
    }

     

    I have tested your proposal. Unfortunately, it does not work. 

    It's a useless proc.

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2020

    understood but without effect on my issue

  • tinh
    tinh Altair Community Member
    edited September 2020

    I don't see any command that puts elems into the table. Where is it?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2020

    except if I am wrong, it is here :

    *assignsystem_fromcurves elements 2 lines 1 10 7 1 0 $increment_table 1

     

    This command creates a table with the id $increment_table

    and after for clarity, I rename it by the command: 

    *setvalue tables id=$increment_table name=$TABLE_NAME

  • tinh
    tinh Altair Community Member
    edited September 2020

    That command is repeated by a 'for' loop, but you don't increase table id after each iteration. Do you see that?

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2020

    Yes, that is what I want.

    Indeed, the global surface can be splitter into sub surfaces.

    To have a group per global surface, I use one increment value per global value.

    The doc mentions that if the increment remains the same, the new data are added to the existing table.