@@ -6,7 +6,12 @@ proc ::CDEM::examples::BulkGroup {args} {
66 if { $retval == " cancel" } { return }
77 }
88
9- CreateAndAssign3DBondedGroups
9+
10+ if {$::Model::SpatialDimension eq " 2D" } {
11+ CreateAndAssign2DBondedGroups
12+ } else {
13+ CreateAndAssign3DBondedGroups
14+ }
1015
1116 GiD_Process 'Redraw
1217 GidUtils::UpdateWindow GROUPS
@@ -16,9 +21,6 @@ proc ::CDEM::examples::BulkGroup {args} {
1621
1722proc ::CDEM::examples::CreateAndAssign3DBondedGroups { } {
1823
19- # This procedure can be called from the command line of GiD, after loading the CDEM problemtype, just by typing:
20- # -np- ::CDEM::CreateAndAssign3DBondedGroups
21-
2224 set volume_list [GiD_Geometry -v2 list volume]
2325
2426 for {set i 0} {$i < [llength $volume_list ]} {incr i} {
@@ -32,3 +34,19 @@ proc ::CDEM::examples::CreateAndAssign3DBondedGroups { } {
3234 set cohesive_group [customlib::AddConditionGroupOnXPath $cohesive_cond Bonded_domain_groups//SG$volume_id ]
3335 }
3436}
37+
38+ proc ::CDEM::examples::CreateAndAssign2DBondedGroups { } {
39+
40+ set surface_list [GiD_Geometry -v2 list surface]
41+
42+ for {set i 0} {$i < [llength $surface_list ]} {incr i} {
43+
44+ set surface_id [lindex $surface_list $i ]
45+ GiD_Groups create Bonded_domain_groups//SG$surface_id
46+ GiD_EntitiesGroups assign Bonded_domain_groups//SG$surface_id surfaces $surface_id
47+
48+ set DEMConditions [spdAux::getRoute " DEMConditions" ]
49+ set cohesive_cond " $DEMConditions /condition\[ @n='DEM-Cohesive2D'\] "
50+ set cohesive_group [customlib::AddConditionGroupOnXPath $cohesive_cond Bonded_domain_groups//SG$surface_id ]
51+ }
52+ }
0 commit comments