1- proc CDEM ::write::WriteMDPAParts { } {
1+ proc DEM ::write::WriteMDPAParts { } {
22 variable last_property_id
33
44 # Prepare properties
@@ -9,25 +9,25 @@ proc CDEM::write::WriteMDPAParts { } {
99 write::writeModelPartData
1010
1111 # Materials
12- writeMaterialsParts
12+ CDEM::write:: writeMaterialsParts
1313
1414 # Nodal coordinates (only for DEM Parts <inefficient> )
1515 write::writeNodalCoordinatesOnParts
1616 write::writeNodalCoordinatesOnGroups [GetDEMGroupsCustomSubmodelpart]
17- write::writeNodalCoordinatesOnGroups [GetDEMGroupsInitialC]
18- write::writeNodalCoordinatesOnGroups [GetDEMGroupsBoundayC]
17+ write::writeNodalCoordinatesOnGroups [DEM::write:: GetDEMGroupsInitialC]
18+ write::writeNodalCoordinatesOnGroups [DEM::write:: GetDEMGroupsBoundayC]
1919
2020 # Element connectivities
2121 write::writeElementConnectivities
2222
2323 # Begin NodalData RADIUS
24- writeSphereRadius
24+ CDEM::write:: writeSphereRadius
2525
2626 # Begin NodalData COHESIVE_GROUP
27- writeCohesiveGroups
27+ CDEM::write:: writeCohesiveGroups
2828
2929 # Begin NodalData SKIN_SPHERE
30- writeSkinSphereNodes
30+ CDEM::write:: writeSkinSphereNodes
3131
3232 # SubmodelParts
3333 write::writePartSubModelPart
@@ -38,6 +38,7 @@ proc CDEM::write::WriteMDPAParts { } {
3838 # WriteWallCustomDEMSmp not required for dem.
3939}
4040
41+ # # TODO: proc under revision. Duplicated code. Unused in some situations
4142proc CDEM::write::WriteWallCustomDEMSmp { } {
4243 set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-CustomSmp'\] /group"
4344 foreach group [[customlib::GetBaseRoot] selectNodes $xp1 ] {
@@ -70,27 +71,6 @@ proc CDEM::write::GetDEMGroupsCustomSubmodelpart { } {
7071 return $groups
7172}
7273
73- proc CDEM::write::GetDEMGroupsInitialC { } {
74- set groups [list ]
75- set xp3 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-VelocityIC'\] /group"
76- foreach group [[customlib::GetBaseRoot] selectNodes $xp3 ] {
77- set groupid [$group @n]
78- lappend groups [write::GetWriteGroupName $groupid ]
79- }
80- return $groups
81- }
82-
83- proc CDEM::write::GetDEMGroupsBoundayC { } {
84- set groups [list ]
85- set xp4 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-VelocityBC'\] /group"
86- foreach group [[customlib::GetBaseRoot] selectNodes $xp4 ] {
87- set groupid [$group @n]
88- lappend groups [write::GetWriteGroupName $groupid ]
89- }
90- return $groups
91- }
92-
93-
9474proc CDEM::write::writeSphereRadius { } {
9575 set root [customlib::GetBaseRoot]
9676 set xp1 " [ spdAux::getRoute [GetAttribute partscont_un] ]/group"
@@ -147,66 +127,68 @@ proc CDEM::write::writeSkinSphereNodes { } {
147127
148128
149129
150- proc CDEM::write::GetNodalConditionsGroups { {include_cond 0} } {
151- set groups [list ]
152- set xp1 " [ spdAux::getRoute [GetAttribute nodal_conditions_un] ]/condition/group"
153- foreach group [[customlib::GetBaseRoot] selectNodes $xp1 ] {
154- set groupid [$group @n]
155- if {$include_cond } {lappend groups [[$group parent] @n]}
156- lappend groups [write::GetWriteGroupName $groupid ]
157- }
158- return $groups
159- }
130+ # proc CDEM::write::GetNodalConditionsGroups { {include_cond 0} } { # TODO UNUSED CODE
131+ # set groups [list ]
132+ # set xp1 "[spdAux::getRoute [GetAttribute nodal_conditions_un]]/condition/group"
133+ # foreach group [[customlib::GetBaseRoot] selectNodes $xp1] {
134+ # set groupid [$group @n]
135+ # if {$include_cond} {lappend groups [[$group parent] @n]}
136+ # lappend groups [write::GetWriteGroupName $groupid]
137+ # }
138+ # return $groups
139+ # }
160140
161141# proc DEM::write::write2VelocityMeshes { } {
162142# foreach {cid groupid} [DEM::write::GetNodalConditionsGroups 1] {
163143# ::write::writeGroupSubModelPart $cid $groupid "nodal"
164144# }
165145# }
166146
167- proc CDEM::write::GetSpheresGroupsListInConditions { } {
168- set conds_groups_dict [dict create ]
169- set groups [list ]
170147
171- # Get all the groups with spheres
172- foreach group [GetSpheresGroups] {
173- foreach surface [GiD_EntitiesGroups get $group elements] {
174- foreach involved_group [GiD_EntitiesGroups entity_groups elements $surface ] {
175- set involved_group_id [write::GetWriteGroupName $involved_group ]
176- if {$involved_group_id ni $groups } {lappend groups $involved_group_id }
177- }
178- }
179- }
148+ # proc CDEM::write::GetSpheresGroupsListInConditions { } { # TODO: DUPLICATED CODE
149+ # set conds_groups_dict [dict create ]
150+ # set groups [list ]
180151
181- # Find the relations condition -> group
182- set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition"
183- foreach cond [[customlib::GetBaseRoot] selectNodes $xp1 ] {
184- set condid [$cond @n]
185- foreach cond_group [$cond selectNodes " group" ] {
186- set group [write::GetWriteGroupName [$cond_group @n]]
187- if {$group in $groups } {dict lappend conds_groups_dict $condid [$cond_group @n]}
188- }
189- }
190- return $conds_groups_dict
191- }
152+ # # Get all the groups with spheres
153+ # foreach group [GetSpheresGroups] {
154+ # foreach surface [GiD_EntitiesGroups get $group elements] {
155+ # foreach involved_group [GiD_EntitiesGroups entity_groups elements $surface] {
156+ # set involved_group_id [write::GetWriteGroupName $involved_group]
157+ # if {$involved_group_id ni $groups} {lappend groups $involved_group_id}
158+ # }
159+ # }
160+ # }
192161
193- proc CDEM::write::GetSpheresGroups { } {
194- set groups [list ]
195- if {$::Model::SpatialDimension eq " 2D" } { set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-VelocityBC2D'\] /group"
196- } else {set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-VelocityBC'\] /group" }
197- foreach group [[customlib::GetBaseRoot] selectNodes $xp1 ] {
198- set groupid [$group @n]
199- lappend groups [write::GetWriteGroupName $groupid ]
200- }
201- if {$::Model::SpatialDimension eq " 2D" } { set xp2 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-VelocityIC2D'\] /group"
202- } else {set xp2 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-VelocityIC'\] /group" }
203- foreach group [[customlib::GetBaseRoot] selectNodes $xp2 ] {
204- set groupid [$group @n]
205- lappend groups [write::GetWriteGroupName $groupid ]
206- }
162+ # # Find the relations condition -> group
163+ # set xp1 "[spdAux::getRoute [GetAttribute conditions_un]]/condition"
164+ # foreach cond [[customlib::GetBaseRoot] selectNodes $xp1] {
165+ # set condid [$cond @n]
166+ # foreach cond_group [$cond selectNodes "group"] {
167+ # set group [write::GetWriteGroupName [$cond_group @n]]
168+ # if {$group in $groups} {dict lappend conds_groups_dict $condid [$cond_group @n]}
169+ # }
170+ # }
171+ # return $conds_groups_dict
172+ # }
207173
208- return $groups
209- }
174+
175+ # proc CDEM::write::GetSpheresGroups { } { # TODO: duplicated code
176+ # set groups [list ]
177+ # if {$::Model::SpatialDimension eq "2D"} { set xp1 "[spdAux::getRoute [GetAttribute conditions_un]]/condition\[@n = 'DEM-VelocityBC2D'\]/group"
178+ # } else {set xp1 "[spdAux::getRoute [GetAttribute conditions_un]]/condition\[@n = 'DEM-VelocityBC'\]/group"}
179+ # foreach group [[customlib::GetBaseRoot] selectNodes $xp1] {
180+ # set groupid [$group @n]
181+ # lappend groups [write::GetWriteGroupName $groupid]
182+ # }
183+ # if {$::Model::SpatialDimension eq "2D"} { set xp2 "[spdAux::getRoute [GetAttribute conditions_un]]/condition\[@n = 'DEM-VelocityIC2D'\]/group"
184+ # } else {set xp2 "[spdAux::getRoute [GetAttribute conditions_un]]/condition\[@n = 'DEM-VelocityIC'\]/group"}
185+ # foreach group [[customlib::GetBaseRoot] selectNodes $xp2] {
186+ # set groupid [$group @n]
187+ # lappend groups [write::GetWriteGroupName $groupid]
188+ # }
189+
190+ # return $groups
191+ # }
210192
211193proc CDEM::write::writeMaterialsParts { } {
212194 variable partsProperties
0 commit comments