An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20110330/7b727f3d/attachment.htm
[GiDlist] How to get the information of mesh edges?
Moderator: GiD Team
[GiDlist] How to get the information of mesh edges?
Edges are not stored splicitly inside GiD, and is not possible to directly get this information (e.g. with .bas template commands)
You must do something to recover this information from the Element-to-node information that GiD store.
at Tcl level, you can use for example an auxilary array to assign an edge_id to all edges, without repetition (na:nb must be considered equal to nb:na)
You can create a problemtype with a problemtype.tcl file with this code (or invoke this Tcl from a macro)
proc GetEdgeKey { n0 n1 } {
if { $n0 $n1 } {
set key "$n0 $n1"
} else {
set key "$n1 $n0"
}
return $key
}
proc GetEdgesInformation { } {
#store all edges witout repetition in the array named Edges
set edges(Tetrahedra) { {0 1} {1 2} 2 0} {0 3} {1 3} {2 3}}
set elementtype Tetrahedra
foreach element [GiD_Info Mesh Elements $elementtype -sublist] {
set nodes [lrange $element 1 end-1]
foreach edge $edges($elementtype) {
set n0 [lindex $nodes [lindex $edge 0]]
set n1 [lindex $nodes [lindex $edge 1]]
set key [GetEdgeKey $n0 $n1]
set Edges($key) 1
}
}
#assign an id to each edge
set count 0
foreach key [array names Edges] {
incr count
set Edges($key) $count
}
#return the information you want
set res "Element-to-edge:\n"
foreach element [GiD_Info Mesh Elements $elementtype -sublist] {
set nodes [lrange $element 1 end-1]
foreach edge $edges($elementtype) {
set n0 [lindex $nodes [lindex $edge 0]]
set n1 [lindex $nodes [lindex $edge 1]]
set key [GetEdgeKey $n0 $n1]
append res "[lindex $element 0] $Edges($key) \n"
}
}
append res "Edge-to-node:\n"
foreach key [array names Edges] {
append res "$Edges($key) $key\n"
}
result $res
}
and then print the information returned by GetEdgesInformation to the calculation file invoking in the problemtype.bas file this tcl procedure
with
*tcl(GetEdgesInformation)
Note that I wrote a procedure considering only linear Tetrahedra, you must modify it to take into account other kind of elements
and I didn't tested it, maybe there is some small error that you must fix.
Tcl is an standard scripting language, and you can find a lot of information of its syntax at Internet.
The GiD_Info is an special GiD-Tcl command to get GiD mesh information, you can see its syntax at the GiD Help - customization - Tcl/Tk extension
Regards
Enrique Escolano
----- Original Message -----
From: Tao Chen 陈涛
To: GID Mail list
Sent: Wednesday, March 30, 2011 2:48 PM
Subject: [GiDlist] How to get the information of mesh edges?
Dear GiD,
How could I get information of mesh edges after meshing the geometry?
The data I need is as follows (Take the Tetrahedra element type of meshing for example).
Element-to-edge:
Element_ID Edge_ID1 Edge_ID2 Edge_ID3 Edge_ID4
Element_ID Edge_ID1 Edge_ID2 Edge_ID3 Edge_ID4
.
.
.
Element_ID Edge_ID1 Edge_ID2 Edge_ID3 Edge_ID4
Edge-to-node:
Edge_ID Node_ID1 Node_ID2
Edge_ID Node_ID1 Node_ID2
.
.
.
Edge_ID Node_ID1 Node_ID2
Thank you for reading my mail!
Best regards!
Yours, Tao Chen.
2011-3-30 20:49:06
--
┌───────────────────────────────────────────────────────
│Tao Chen
│Department of Applied Mathematics
│Department of Communication Engineering
│Communication University of China
│Room 319, Building 33, No.1 Dingfuzhuang East Street,
│Chaoyang District, Beijing, 100024, P.R. China
│Phone:+86-10-65783580
│E-mail: chentao at cuc.edu.cn
│MSN: chentaocuc at hotmail.com
└───────────────────────────────────────────────────────
------------------------------------------------------------------------------
_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20110330/13a5aba4/attachment.htm
You must do something to recover this information from the Element-to-node information that GiD store.
at Tcl level, you can use for example an auxilary array to assign an edge_id to all edges, without repetition (na:nb must be considered equal to nb:na)
You can create a problemtype with a problemtype.tcl file with this code (or invoke this Tcl from a macro)
proc GetEdgeKey { n0 n1 } {
if { $n0 $n1 } {
set key "$n0 $n1"
} else {
set key "$n1 $n0"
}
return $key
}
proc GetEdgesInformation { } {
#store all edges witout repetition in the array named Edges
set edges(Tetrahedra) { {0 1} {1 2} 2 0} {0 3} {1 3} {2 3}}
set elementtype Tetrahedra
foreach element [GiD_Info Mesh Elements $elementtype -sublist] {
set nodes [lrange $element 1 end-1]
foreach edge $edges($elementtype) {
set n0 [lindex $nodes [lindex $edge 0]]
set n1 [lindex $nodes [lindex $edge 1]]
set key [GetEdgeKey $n0 $n1]
set Edges($key) 1
}
}
#assign an id to each edge
set count 0
foreach key [array names Edges] {
incr count
set Edges($key) $count
}
#return the information you want
set res "Element-to-edge:\n"
foreach element [GiD_Info Mesh Elements $elementtype -sublist] {
set nodes [lrange $element 1 end-1]
foreach edge $edges($elementtype) {
set n0 [lindex $nodes [lindex $edge 0]]
set n1 [lindex $nodes [lindex $edge 1]]
set key [GetEdgeKey $n0 $n1]
append res "[lindex $element 0] $Edges($key) \n"
}
}
append res "Edge-to-node:\n"
foreach key [array names Edges] {
append res "$Edges($key) $key\n"
}
result $res
}
and then print the information returned by GetEdgesInformation to the calculation file invoking in the problemtype.bas file this tcl procedure
with
*tcl(GetEdgesInformation)
Note that I wrote a procedure considering only linear Tetrahedra, you must modify it to take into account other kind of elements
and I didn't tested it, maybe there is some small error that you must fix.
Tcl is an standard scripting language, and you can find a lot of information of its syntax at Internet.
The GiD_Info is an special GiD-Tcl command to get GiD mesh information, you can see its syntax at the GiD Help - customization - Tcl/Tk extension
Regards
Enrique Escolano
----- Original Message -----
From: Tao Chen 陈涛
To: GID Mail list
Sent: Wednesday, March 30, 2011 2:48 PM
Subject: [GiDlist] How to get the information of mesh edges?
Dear GiD,
How could I get information of mesh edges after meshing the geometry?
The data I need is as follows (Take the Tetrahedra element type of meshing for example).
Element-to-edge:
Element_ID Edge_ID1 Edge_ID2 Edge_ID3 Edge_ID4
Element_ID Edge_ID1 Edge_ID2 Edge_ID3 Edge_ID4
.
.
.
Element_ID Edge_ID1 Edge_ID2 Edge_ID3 Edge_ID4
Edge-to-node:
Edge_ID Node_ID1 Node_ID2
Edge_ID Node_ID1 Node_ID2
.
.
.
Edge_ID Node_ID1 Node_ID2
Thank you for reading my mail!
Best regards!
Yours, Tao Chen.
2011-3-30 20:49:06
--
┌───────────────────────────────────────────────────────
│Tao Chen
│Department of Applied Mathematics
│Department of Communication Engineering
│Communication University of China
│Room 319, Building 33, No.1 Dingfuzhuang East Street,
│Chaoyang District, Beijing, 100024, P.R. China
│Phone:+86-10-65783580
│E-mail: chentao at cuc.edu.cn
│MSN: chentaocuc at hotmail.com
└───────────────────────────────────────────────────────
------------------------------------------------------------------------------
_______________________________________________
GiDlist mailing list
GiDlist at listas.cimne.upc.edu
http://listas.cimne.upc.edu/cgi-bin/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20110330/13a5aba4/attachment.htm
[GiDlist] 3D meshing problem with inner surface and overlap
That works, thank you! I have now successfully generated a conformal
mesh for my overlapping geometry by setting the tolerance to 0.005.
For the geometry that crashes, I will contact you directly.
Best regards,
Matthias
----------------------------------------------------------------------
Date: Wed, 30 Mar 2011 19:54:07 +0200
From: "Enrique Escolano" escolano at cimne.upc.edu
Subject: Re: [GiDlist] 3D meshing problem with inner surface and
overlap
To: gidlist at listas.cimne.upc.edu
3D meshing problem with inner surface and overlapInitially your x_t
volumes are completelly independent of each other, they don't share any
surface.
if you import with the 'Automatic collapse after import' option
unselected, then do you have this case (it is then recommended to do a
'Utilities-Repair to fix some possible import problems)
If do you want to connect this volumes, by sharing surfaces (e.g. then
heat can pass between bodies) then you must join them manually: e.g.
deleting one of the surfaces (first volume must be deleted) and using
only one for both volumes To aid you in this task, it exists the
'collapse' tool, that join points close than a tolerance.
This tolerance must be set (in Utilities-Preferences-Exchange - Import
tolernace) by the user depending on the model accuracy, but once again,
to aid the user we provide the 'Automatic tolerance' option (that get as
tolernace a percent of the model size)
If this automatic tolerance is not appropiated for your model, you can
set other (and do global or local collapse selecting some part) in your
example Baugruppe1_overlap.x_t, there are points with gap about 0.00035
units (and the automatic tolerance is about 3e-6) then this gap won't be
closed with this tolerance.
If you set a tolerance 0.0005 and collapse again, then all 'required'
surfaces are joined as you want.
You must be carful with the collapse tolerance, only 'small tolerances'
must be used, else the geometry could be corrupted (the curves won't be
on the surfaces with precision, etc) And maybe some case can't be joined
by the collapse, then you must manually modify the geometry to have
exactly what you want to simulate.
About the model that crash, you can send me directly if do you want, to
escolano at cimne.upc.edu to test it.
Regards
Enrique
----------------------------------------------------------------
ERBE Elektromedizin GmbH
Dr.rer.nat. Matthias Zenker
Dipl. Phys.
Grundlagenentwicklung / Fundamental Development
Waldhoernlestrasse 17
72072 Tuebingen
Germany
Phone + 49 (0) 7071 755 - 226
Fax + 49 (0) 7071 755 - 5226
E-Mail: mailto:Matthias.Zenker at erbe-med.com
URL: http://www.ERBE-med.com
----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20110331/26a25481/attachment.htm
mesh for my overlapping geometry by setting the tolerance to 0.005.
For the geometry that crashes, I will contact you directly.
Best regards,
Matthias
----------------------------------------------------------------------
Date: Wed, 30 Mar 2011 19:54:07 +0200
From: "Enrique Escolano" escolano at cimne.upc.edu
Subject: Re: [GiDlist] 3D meshing problem with inner surface and
overlap
To: gidlist at listas.cimne.upc.edu
3D meshing problem with inner surface and overlapInitially your x_t
volumes are completelly independent of each other, they don't share any
surface.
if you import with the 'Automatic collapse after import' option
unselected, then do you have this case (it is then recommended to do a
'Utilities-Repair to fix some possible import problems)
If do you want to connect this volumes, by sharing surfaces (e.g. then
heat can pass between bodies) then you must join them manually: e.g.
deleting one of the surfaces (first volume must be deleted) and using
only one for both volumes To aid you in this task, it exists the
'collapse' tool, that join points close than a tolerance.
This tolerance must be set (in Utilities-Preferences-Exchange - Import
tolernace) by the user depending on the model accuracy, but once again,
to aid the user we provide the 'Automatic tolerance' option (that get as
tolernace a percent of the model size)
If this automatic tolerance is not appropiated for your model, you can
set other (and do global or local collapse selecting some part) in your
example Baugruppe1_overlap.x_t, there are points with gap about 0.00035
units (and the automatic tolerance is about 3e-6) then this gap won't be
closed with this tolerance.
If you set a tolerance 0.0005 and collapse again, then all 'required'
surfaces are joined as you want.
You must be carful with the collapse tolerance, only 'small tolerances'
must be used, else the geometry could be corrupted (the curves won't be
on the surfaces with precision, etc) And maybe some case can't be joined
by the collapse, then you must manually modify the geometry to have
exactly what you want to simulate.
About the model that crash, you can send me directly if do you want, to
escolano at cimne.upc.edu to test it.
Regards
Enrique
----------------------------------------------------------------
ERBE Elektromedizin GmbH
Dr.rer.nat. Matthias Zenker
Dipl. Phys.
Grundlagenentwicklung / Fundamental Development
Waldhoernlestrasse 17
72072 Tuebingen
Germany
Phone + 49 (0) 7071 755 - 226
Fax + 49 (0) 7071 755 - 5226
E-Mail: mailto:Matthias.Zenker at erbe-med.com
URL: http://www.ERBE-med.com
----------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20110331/26a25481/attachment.htm