Jump to content

Targo

Members
  • Content Count

    18
  • Joined

  • Last visited

About Targo

  • Rank
    Beginner

Profile Information

  • Are you University user?
    No
  1. That's it! Q.NGUYEN-DAI. for 1,100,000 tets the time decreased from 3 mins 22 seconds to 54 secconds. I imagine that for HEX elements the difference would be much greater., thank you!
  2. Hi again, Detected another slow process in the grid point lookup for each element: example for tetras append elem_info "[format %8i $elemid] , 1 , [hm_getentityvalue elems_list $elemid node3 0 -byid] , [hm_getentityvalue elems_list $elemid node1 0 -byid] , [hm_getentityvalue elems_list $elemid node2 0 -byid] , [hm_getentityvalue elems_list $elemid node4 0 -byid] " For each node I do the hm_getentityvalue elems_list $elemid lookup. Is it possible to do the lookup only 1 time and then ask for the nodes instead of doing it 4 times for tetras an even 8 times for hexas?
  3. Thank you! This is far better. I used your code to develop the script. it is writing all the info in a file the execution time for 118,000 tet elements is 9 seconds total, which is very good. however on a model with 1,100,000 tets it is giving still errors I will debug and test it again on a big model Update: the execution time is 92 seconds, which is good for me.
  4. A test with 300000 elements took 39 minutes
  5. I did some benchmarking: set cname [hm_entityinfo name components $i] set elemnodes [list] set elems [hm_elemlist id $cname] # took 0 seconds set num_elem [llength $elems] foreach curele $elems { ; set elemnodes [concat $elemnodes [hm_nodelist $curele]] } # took28 seconds set elemnodes [lsort -integer -unique $elemnodes] set num_nods [llength $elemnodes] foreach nodeid $elemnodes { foreach {x y z} [expr [hm_nodevalue $nodeid]] {break} } # took 1 second foreach elemid $elems { set elemconfig [hm_getentityvalue elems $elemid config 0 -byid] # puts $elemconfig switch $elemconfig { 204 { set elem_info "TETRA ," append elem_info "[format %8i $elemid] , 1 , [hm_getentityvalue elems $elemid node3 0 -byid] , [hm_getentityvalue elems $elemid node1 0 -byid] , [hm_getentityvalue elems $elemid node2 0 -byid] , [hm_getentityvalue elems $elemid node4 0 -byid] " } } append elem_info ", " append content "\n $elem_info" } # took 11 seconds # the groupingtook only1 So the bottleneck is the generation of the nodelist of each element with the concat operation and the getentity operation for each element Do you see some optimisation?
  6. I sorted it out, it is working now. thank you! However it is taking ages, like tinh told me. is there a way to combine TPL (node and element list) with TCL ( for counting the lements and nodes) ? call the tpl from a tcl file and then attach the MESHSET INFO?
  7. Thank you both for the hints and tipps. I guess in order to count and get nodes and elements of the collector I have to use arrays and loops. Hence the tcl scripts are the way to go. The templates are straightforward in terms of nodes and elements. However the grouping mixed it up. Do you have any basic examples about querying the mesh, where I can build upon?
  8. Thank you, is there any good documentation or tutorials? Where can the scripts be executed? found at http://www.tcl.tk/man/tcl8.5/tutorial/tcltutorial.html TCL is maybe the solution. I will post the result.
  9. Thanks a lot this is working fine. however I have to write a following line: ELEMENT, ComponentID, NumberOfElementsInTHISCOMPONENT, ElementID1, Element ID2, .... Element IDXX ELEMENT, 2, 28, 13, 14, 11, 15, 10, 8, 12, ... 1 So the problem is I have to know the numbers of the nodes in each component BEFORE writing it down. I tried to construct a String while counting the elements/Nodes however no such thing is possible. Another important issue: Is it possible to know the collector a node is connected? a node can have several connectors, but I need it for the nodes in a similar matter like for elements *text() *uservariableset(#MYVARIABLE,22) *output() *elements(,,) *before() *string("COLLECTORS") *treataslocal(counter8) *counterset(counter8,0) *end() *format() *if([counter8==0]) *end() *string("MESH , ") *field(int,collector.id,10) *string(", ") *if([collector.$Use_Quotes==1]) *quote() *endif() *fieldleft(string,collector.name,0) *if([collector.$Use_Quotes==1]) *quote() *endif() *end() # *uservariableset(#ElementString, "") // THis does not work, no STRINGS possible? *endif() *counterinc(counter8) # //*uservariableset(#ElementString,#ElementString+ ", "+id) // THis does not work *string(",") *uservariableset(#MYVARIABLE,counter8) *after() *end() *string("ELEMENTS , ") *field(int,collector.id,10) *string(" , ")*field(integer,#MYVARIABLE,0) #WAS TRYING to construct a string containing all NODEIDs # *field(string,#ElementString,0) // THis does not work *end() *output()
  10. Thank you, I will give it a try. Is there a method to get the size of an array ( elements and nodes)?
  11. Hi, I wonder if we can use variables in a custom template for FE out, beneath a small example. How does one set the variable properly? set $Variable = 22, in the output the last column is 0. second issue: I want to write the element and node amount to the file, I know that the "elements" and "nodes" returns a array: how to get theirs size and write it down? *components("","") *before() *string("#components") *end() set $Variable = 22 *format() *fieldright(integer,id,8) *string(" ") *fieldright(integer,elements,8) *string(" ") *fieldright(integer,nodes,8) *string(" ") *fieldright(integer,$Variable,8) *end() *output()
  12. Thank You tinh, With your aid I figured out, that even in split operations, solids and surfaces have to be eliminated to avoid any influence on the splitting. I tried it with the one tetra, but I had the solids still in the file, later I uploaded the file without solids, so it was working fine, I should have double checked that. problem solved, thank You!
  13. Ah yes. The solver is a in house fdm code we are actually doing some tests with it. Only using the nodes and elements for it. However IMHO, the type of solver does not clarify or find the answer to the issue, that the tets are not splitted correctly. Any proposals?
  14. Thank you for the hint. I tried it. However the failed split even occurs with only one tet element in the workspace( file attached) Have you tried splitting? With the same result?
  15. Thanks for the info. I can only use hex8 or tet4 elements. I would prefer as well rich elements. U can believe me. have you tried the spkitting on the file I attached?
×
×
  • Create New...