Skip to content

Commit d59a332

Browse files
write giving a rodeo
1 parent f8a9e3d commit d59a332

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

kratos.gid/scripts/Mesh.tcl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,12 @@ proc Mesh::AddPointElementsIfNeeded {} {
7272
if {$cond eq ""} {
7373
continue
7474
}
75+
76+
# if group element is point and has topology for points
7577
set topology [$cond getTopologyFeature "Point" 1]
7678
if {$topology eq ""} {
7779
continue
7880
}
79-
W " Groups assigned to condition $condid will be meshed with Point elements."
8081

8182
set group_nodes [dict get $condition_groups $condid]
8283
foreach node_tdom $group_nodes {
@@ -95,7 +96,4 @@ proc Mesh::AddPointElementsIfNeeded {} {
9596
}
9697
}
9798

98-
# if group element is point and has topology for points
99-
100-
# foreach nodeid [GiD_Mesh] GiD_Mesh create element append Point 1 [list $nodeid]
10199
}

kratos.gid/scripts/Writing/WriteGeometries.tcl

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,33 @@ proc write::printGeometryConnectivities {group etype nnodes} {
6363
if {$etype == "Sphere" || $etype == "Circle"} {
6464
write::writeSphereRadiusOnGroup $group
6565
}
66+
} else {
67+
# Trick: GiD < 17.3.x return 0 if elements are of type Point
68+
set elems [GiD_EntitiesGroups get $group elements -element_type point]
69+
set num_elems [objarray length $elems]
70+
if {$num_elems > 0} {
71+
# Write header
72+
set geometry_name ${etype}${nDim}
73+
WriteString "${s}Begin Geometries $geometry_name // GUI group identifier: $group"
74+
# increase indent (allows folding in text editor)
75+
incr ::write::current_mdpa_indent_level
76+
# Write the connectivities
77+
set s1 [mdpaIndent]
78+
objarray foreach elem $elems {
79+
set node_id [GiD_Mesh get element $elem connectivities]
80+
GiD_WriteCalculationFile puts "${s1}$elem $node_id"
81+
}
82+
# decrease indent
83+
incr ::write::current_mdpa_indent_level -1
84+
# Write footer
85+
WriteString "${s}End Geometries"
86+
WriteString ""
87+
88+
# Write the radius if it is a sphere or a circle
89+
if {$etype == "Sphere" || $etype == "Circle"} {
90+
write::writeSphereRadiusOnGroup $group
91+
}
92+
}
6693
}
6794
if {[GetConfigurationAttribute time_monitor]} {set endtime [clock seconds]; set ttime [expr {$endtime-$inittime}]; W "printGeometryConnectivities $geometry_name time: [Kratos::Duration $ttime]"}
6895
}

0 commit comments

Comments
 (0)