Skip to content

Commit 27fde6d

Browse files
Merge branch 'master' into pfemFluid_erase_Solid_dependencies
2 parents 8569723 + fbbf8f7 commit 27fde6d

40 files changed

Lines changed: 1498 additions & 1439 deletions

kratos.gid/apps/Buoyancy/start.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ proc ::Buoyancy::LoadMyFiles { } {
4141
variable id
4242
variable dir
4343

44-
uplevel #0 [list source [file join $dir xml GetFromXML.tcl]]
44+
uplevel #0 [list source [file join $dir xml XmlController.tcl]]
4545
uplevel #0 [list source [file join $dir write write.tcl]]
4646
uplevel #0 [list source [file join $dir write writeProjectParameters.tcl]]
4747
if {[apps::getActiveAppId] eq $id} {
File renamed without changes.

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 "Bulk groups" ] 8 PRE [list ::CDEM::xml::BulkGroup] "" "" insertafter =
1213
GiDMenu::UpdateMenus
1314
}
1415

1.48 KB
Loading

kratos.gid/apps/CDEM/start.tcl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ proc ::CDEM::Init { } {
3535
proc ::CDEM::LoadMyFiles { } {
3636
variable dir
3737

38-
uplevel #0 [list source [file join $dir xml GetFromXML.tcl]]
38+
uplevel #0 [list source [file join $dir xml XmlController.tcl]]
39+
uplevel #0 [list source [file join $dir xml BulkGroup.tcl]]
3940
uplevel #0 [list source [file join $dir write write.tcl]]
4041
uplevel #0 [list source [file join $dir write writeMDPA_Parts.tcl]]
4142
uplevel #0 [list source [file join $dir write writeMDPA_Walls.tcl]]
@@ -63,6 +64,7 @@ proc ::CDEM::CustomToolbarItems { } {
6364
if {$::Model::SpatialDimension eq "2D"} {
6465
Kratos::ToolbarAddItem "Example" [file join $dir images drop.png] [list -np- ::CDEM::examples::ContinuumDrop] [= "Example\nRocks fall"]
6566
}
67+
Kratos::ToolbarAddItem "Bulk grouping" [file join $dir images stone.png] [list -np- ::CDEM::xml::BulkGroup] [= "Plugin\nBulk grouping"]
6668
}
6769

6870
::CDEM::Init
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
proc ::CDEM::xml::BulkGroup {args} {
3+
4+
5+
if {![Kratos::IsModelEmpty]} {
6+
set entity surfaces
7+
if {$::Model::SpatialDimension eq "3D"} {
8+
set entity volumes
9+
}
10+
set txt "Bulk grouping of all the current $entity is about to be executed"
11+
set retval [tk_messageBox -default ok -icon question -message $txt -type okcancel]
12+
if { $retval == "cancel" } { return }
13+
}
14+
15+
CreateAndAssignBondedGroups
16+
17+
GiD_Process 'Redraw
18+
GidUtils::UpdateWindow GROUPS
19+
GidUtils::UpdateWindow LAYER
20+
GiD_Process 'Zoom Frame
21+
22+
spdAux::RequestRefresh
23+
}
24+
25+
proc ::CDEM::xml::CreateAndAssignBondedGroups { } {
26+
27+
# Prepare the variables
28+
set entity surface
29+
set condition_id "DEM-Cohesive2D"
30+
if {$::Model::SpatialDimension eq "3D"} {
31+
set entity volume
32+
set condition_id "DEM-Cohesive"
33+
}
34+
set group_base Bonded_domain_groups
35+
# Locate the condition
36+
set DEMConditions [spdAux::getRoute "DEMConditions"]
37+
set cohesive_cond "$DEMConditions/condition\[@n='$condition_id'\]"
38+
39+
# Clear previous assignations
40+
if {[GiD_Groups exists $group_base]} {GiD_Groups delete $group_base}
41+
gid_groups_conds::delete "$cohesive_cond/group"
42+
43+
# Get the list of entities (surfaces/volumes)
44+
set entity_list [GiD_Geometry -v2 list $entity]
45+
# Foreach entity, create subgroup and assign it to the condition
46+
set entity_list_length [objarray length $entity_list]
47+
for {set i 0} {$i < $entity_list_length} {incr i} {
48+
# Get the entity id
49+
set entity_id [objarray get $entity_list $i]
50+
# Create the subgroup
51+
set group_id "$group_base//SG$entity_id"
52+
GiD_Groups create $group_id
53+
# Assign entity to subgroup
54+
GiD_EntitiesGroups assign $group_id $entity $entity_id
55+
# Assign the subgroup to the tree condition
56+
set cohesive_group [customlib::AddConditionGroupOnXPath $cohesive_cond $group_id]
57+
}
58+
}
File renamed without changes.

kratos.gid/apps/ConjugateHeatTransfer/start.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ proc ::ConjugateHeatTransfer::LoadMyFiles { } {
3737
variable id
3838
variable dir
3939

40-
uplevel #0 [list source [file join $dir xml GetFromXML.tcl]]
40+
uplevel #0 [list source [file join $dir xml XmlController.tcl]]
4141
uplevel #0 [list source [file join $dir write write.tcl]]
4242
uplevel #0 [list source [file join $dir write writeProjectParameters.tcl]]
4343
if {[apps::getActiveAppId] eq $id} {

kratos.gid/apps/ConjugateHeatTransfer/xml/GetFromXML.tcl renamed to kratos.gid/apps/ConjugateHeatTransfer/xml/XmlController.tcl

File renamed without changes.

kratos.gid/apps/ConvectionDiffusion/start.tcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ proc ::ConvectionDiffusion::LoadMyFiles { } {
3737
variable dir
3838

3939
#uplevel #0 [list source [file join $dir examples examples.tcl]]
40-
uplevel #0 [list source [file join $dir xml GetFromXML.tcl]]
40+
uplevel #0 [list source [file join $dir xml XmlController.tcl]]
4141
uplevel #0 [list source [file join $dir write write.tcl]]
4242
uplevel #0 [list source [file join $dir write writeProjectParameters.tcl]]
4343
if {[apps::getActiveAppId] eq $id} {

0 commit comments

Comments
 (0)