If the geometrical lines of the hole are marked with a GiD condition and do you generate a mesh of quadrilaterals from the surface, without explicitly force to generate also the mesh of lines, then the condition will mark the faces of the squares that are created from the line.
The colection of face elements of GiD is not ordered in any way.
In fact, if the case were 3D there is no definition of an 'ordered collection of faces' that enclose a volume or hole
(In the 2D case is is possible to define an ordenation of the faces by the single connectivity of two boundary edges by node)
probably is not a good idea to require this ordenation as input and use an unordered list of edges.
I think that should be enougth that each face element locally is well oriented.
In GiD the face of the quadrilateral element (e.g the *globalnodes .bas command) returns nA->nB, that walks around the element counter-clockwise.
To follow the adjacent hole in counter-clockwise direction, like your picture, you must write the face nodes just in opposite direction
*globalnodes(2) *globalnodes(1)
If it is not possible to modify the input format of Safir_Thermal (that I think that couldn't be genealized to 3D ) then to achieve an ordered collection of edges of a loop (e.g. a hole) then you must invoke from the .bas a *tcl command that do this re-ordenation of the edges (finding nnode-connected edges, starting by an arbitrary initial edge)
e.g. if you condition was defined like this
Code: Select all
CONDITION: hole
CONDTYPE: over lines
CONDMESHTYPE: over face elements
QUESTION: hole_id
Help: some id to identify the hole in case of more than one
VALUE: 0
END CONDITION
and unordered (but well oriented) edges could be
Code: Select all
VOID
*Set cond hole *elems
*loop elems *onlyincond
ELEM *elemsnum *condelemface
*end elems
END_VOID
and to have the list of elements ordered do something like this
Code: Select all
VOID
*tcl(get_hole_edges_ordered)
END_VOID
and in the .tcl command define the procedure
Code: Select all
proc get_hole_edges_ordered { } {
set result ""
foreach item [GiD_Info conditions hole mesh] {
set element_id [lindex $item 0]
set face_id [lindex $item 1]
set question_values [lrange $item 3 end]
set face_nodes [GiD_Mesh get element $element_id face_linear $face_id]
lassign $face_nodes n0 n1
set data_by_n1($n1) [list $element_id $face_id $n0]
}
set start_node [lindex [array names data_by_n1] 0]
set data $data_by_n1($start_node)
lassign $data element_id face_id connect_node
append result "ELEM $element_id $face_id\n"
while { $connect_node != $start_node } {
set data $data_by_n1($connect_node)
lassign $data element_id face_id connect_node
append result "ELEM $element_id $face_id\n"
}
return $result
}