Skip to content

Commit 58eb622

Browse files
update. defined as side button
1 parent b04a85f commit 58eb622

4 files changed

Lines changed: 36 additions & 19 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
proc ::CDEM::examples::BulkGroup {args} {
3+
if {![Kratos::IsModelEmpty]} {
4+
set txt "Bulk grouping of all the current volumes is about to be executed"
5+
set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
6+
if { $retval == "cancel" } { return }
7+
}
8+
9+
CreateAndAssign3DBondedGroups
10+
11+
GiD_Process 'Redraw
12+
GidUtils::UpdateWindow GROUPS
13+
GidUtils::UpdateWindow LAYER
14+
GiD_Process 'Zoom Frame
15+
}
16+
17+
proc ::CDEM::examples::CreateAndAssign3DBondedGroups { } {
18+
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+
22+
set volume_list [GiD_Geometry -v2 list volume]
23+
24+
for {set i 0} {$i < [llength $volume_list]} {incr i} {
25+
26+
set volume_id [lindex $volume_list $i]
27+
GiD_Groups create Bonded_domain_groups//SG$volume_id
28+
GiD_EntitiesGroups assign Bonded_domain_groups//SG$volume_id volumes $volume_id
29+
30+
set DEMConditions [spdAux::getRoute "DEMConditions"]
31+
set cohesive_cond "$DEMConditions/condition\[@n='DEM-Cohesive'\]"
32+
set cohesive_group [customlib::AddConditionGroupOnXPath $cohesive_cond Bonded_domain_groups//SG$volume_id]
33+
}
34+
}

kratos.gid/apps/CDEM/examples/examples.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ proc CDEM::examples::Init { } {
99
proc CDEM::examples::UpdateMenus { } {
1010
GiDMenu::InsertOption "Kratos" [list "---"] 8 PRE "" "" "" insertafter =
1111
GiDMenu::InsertOption "Kratos" [list "Stone block and sand" ] 8 PRE [list ::CDEM::examples::ContinuumDrop] "" "" insertafter =
12+
GiDMenu::InsertOption "Kratos" [list "Stone block and sand" ] 8 PRE [list ::CDEM::examples::BulkGroup] "" "" insertafter =
1213
GiDMenu::UpdateMenus
1314
}
1415

1.48 KB
Loading

kratos.gid/apps/CDEM/start.tcl

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -63,25 +63,7 @@ proc ::CDEM::CustomToolbarItems { } {
6363
if {$::Model::SpatialDimension eq "2D"} {
6464
Kratos::ToolbarAddItem "Example" [file join $dir images drop.png] [list -np- ::CDEM::examples::ContinuumDrop] [= "Example\nRocks fall"]
6565
}
66-
}
67-
68-
proc ::CDEM::CreateAndAssign3DBondedGroups { } {
69-
70-
# This procedure can be called from the command line of GiD, after loading the CDEM problemtype, just by typing:
71-
# -np- ::CDEM::CreateAndAssign3DBondedGroups
72-
73-
set volume_list [GiD_Geometry -v2 list volume]
74-
75-
for {set i 0} {$i < [llength $volume_list]} {incr i} {
76-
77-
set volume_id [lindex $volume_list $i]
78-
GiD_Groups create Bonded_domain_groups//SG$volume_id
79-
GiD_EntitiesGroups assign Bonded_domain_groups//SG$volume_id volumes $volume_id
80-
81-
set DEMConditions [spdAux::getRoute "DEMConditions"]
82-
set cohesive_cond "$DEMConditions/condition\[@n='DEM-Cohesive'\]"
83-
set cohesive_group [customlib::AddConditionGroupOnXPath $cohesive_cond Bonded_domain_groups//SG$volume_id]
84-
}
66+
Kratos::ToolbarAddItem "Bulk grouping" [file join $dir images stone.png] [list -np- ::CDEM::examples::BulkGroup] [= "Plugin\nBulk grouping"]
8567
}
8668

8769
::CDEM::Init

0 commit comments

Comments
 (0)