11proc CDEM::write::WriteMDPAParts { } {
2- variable last_property_id
3-
4- # Prepare properties
5- write::processMaterials " " $last_property_id ;
6- set last_property_id [expr $last_property_id + [dict size $::write::mat_dict ]]
7-
82 # Headers
93 write::writeModelPartData
104
5+ # Process properties
6+ DEM::write::processPartMaterials
7+
118 # Materials
12- CDEM ::write::writeMaterialsParts
9+ DEM ::write::writeMaterialsParts
1310
1411 # Nodal coordinates (only for DEM Parts <inefficient> )
1512 write::writeNodalCoordinatesOnParts
@@ -22,7 +19,7 @@ proc CDEM::write::WriteMDPAParts { } {
2219 write::writeElementConnectivities
2320
2421 # Begin NodalData RADIUS
25- CDEM ::write::writeSphereRadius
22+ DEM ::write::writeSphereRadius
2623
2724 # Begin NodalData COHESIVE_GROUP
2825 CDEM::write::writeCohesiveGroups
@@ -38,54 +35,6 @@ proc CDEM::write::WriteMDPAParts { } {
3835 CDEM::write::WriteCustomDEMSmp
3936}
4037
41- # # TODO: proc under revision. This works but the proc is different from the DEM::write version.
42- proc CDEM::write::WriteCustomDEMSmp { } {
43- set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-CustomSmp'\] /group"
44- foreach group [[customlib::GetBaseRoot] selectNodes $xp1 ] {
45- set group_id [$group @n]
46- set group_raw [write::GetWriteGroupName $group_id ]
47- set good_name [write::transformGroupName $group_raw ]
48- set destination_mdpa [write::getValueByNode [$group selectNodes " ./value\[ @n='WhatMdpa'\] " ]]
49- if {$destination_mdpa == " DEM" } {
50- write::WriteString " Begin SubModelPart $good_name \/\/ Custom SubModelPart. Group name: $group_id "
51- write::WriteString " Begin SubModelPartData"
52- write::WriteString " End SubModelPartData"
53- write::WriteString " Begin SubModelPartNodes"
54- GiD_WriteCalculationFile nodes -sorted [dict create [write::GetWriteGroupName $group_id ] [subst " %10i\n " ]]
55- write::WriteString " End SubModelPartNodes"
56- write::WriteString " End SubModelPart"
57- write::WriteString " "
58- }
59- }
60- }
61-
62- proc CDEM::write::GetDEMGroupsCustomSubmodelpart { } {
63- set groups [list ]
64- set xp2 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'DEM-CustomSmp'\] /group"
65- foreach group [[customlib::GetBaseRoot] selectNodes $xp2 ] {
66- set destination_mdpa [write::getValueByNode [$group selectNodes " ./value\[ @n='WhatMdpa'\] " ]]
67- if {$destination_mdpa == " DEM" } {
68- set groupid [$group @n]
69- lappend groups [write::GetWriteGroupName $groupid ]
70- }
71- }
72- return $groups
73- }
74-
75- proc CDEM::write::writeSphereRadius { } {
76- set root [customlib::GetBaseRoot]
77- set xp1 " [ spdAux::getRoute [GetAttribute partscont_un] ]/group"
78- foreach group [$root selectNodes $xp1 ] {
79- set groupid [$group @n]
80- set grouppid [write::GetWriteGroupName $groupid ]
81- write::WriteString " Begin NodalData RADIUS // GUI group identifier: $grouppid "
82- GiD_WriteCalculationFile connectivities [dict create $groupid " %.0s %10d 0 %10g\n " ]
83- write::WriteString " End NodalData"
84- write::WriteString " "
85- }
86- }
87-
88-
8938proc CDEM::write::writeCohesiveGroups { } {
9039 set root [customlib::GetBaseRoot]
9140 if {$::Model::SpatialDimension eq " 3D" } {
@@ -97,8 +46,8 @@ proc CDEM::write::writeCohesiveGroups { } {
9746 foreach group [$root selectNodes $xp1 ] {
9847 incr cohesive_group
9948 set groupid [$group @n]
100- set grouppid [write::GetWriteGroupName $groupid ]
101- write::WriteString " Begin NodalData COHESIVE_GROUP // GUI group identifier: $grouppid "
49+ set group_id [write::GetWriteGroupName $groupid ]
50+ write::WriteString " Begin NodalData COHESIVE_GROUP // GUI group identifier: $group_id "
10251 GiD_WriteCalculationFile connectivities [dict create $groupid " %.0s %10d 0 $cohesive_group \n " ]
10352 write::WriteString " End NodalData"
10453 write::WriteString " "
@@ -125,49 +74,3 @@ proc CDEM::write::writeSkinSphereNodes { } {
12574 write::WriteString " End NodalData"
12675 write::WriteString " "
12776}
128-
129-
130- proc CDEM::write::writeMaterialsParts { } {
131- variable partsProperties
132- set xp1 " [ spdAux::getRoute [GetAttribute conditions_un] ]/condition\[ @n = 'PartsCont'\] /group"
133- set partsProperties $::write::mat_dict
134- set printable [list PARTICLE_DENSITY \
135- YOUNG_MODULUS \
136- POISSON_RATIO \
137- FRICTION \
138- COEFFICIENT_OF_RESTITUTION \
139- ROLLING_FRICTION \
140- ROLLING_FRICTION_WITH_WALLS \
141- CONTACT_SIGMA_MIN \
142- CONTACT_TAU_ZERO \
143- CONTACT_INTERNAL_FRICC \
144- ConstitutiveLaw \
145- SHEAR_ENERGY_COEF \
146- LOOSE_MATERIAL_YOUNG_MODULUS \
147- FRACTURE_ENERGY \
148- INTERNAL_FRICTION_ANGLE \
149- ROTATIONAL_MOMENT_COEFFICIENT \
150- PARTICLE_COHESION]
151-
152- foreach group [dict keys $partsProperties ] {
153- write::WriteString " Begin Properties [ dict get $partsProperties $group MID] "
154- foreach {prop val} [dict get $partsProperties $group ] {
155- if {$prop in $printable } {
156- if {$prop eq " ConstitutiveLaw" } {
157- write::WriteString " DEM_CONTINUUM_CONSTITUTIVE_LAW_NAME $val "
158- } elseif {$prop eq " FRICTION" } {
159- set propvalue [expr {tan($val )}]
160- write::WriteString " FRICTION $propvalue "
161- } else {
162- write::WriteString " $prop $val "
163- }
164- }
165- }
166- if {$::Model::SpatialDimension eq " 2D" } {
167- write::WriteString " DEM_DISCONTINUUM_CONSTITUTIVE_LAW_NAME DEM_D_Linear_viscous_Coulomb2D"
168- } else {
169- write::WriteString " DEM_DISCONTINUUM_CONSTITUTIVE_LAW_NAME DEM_D_Linear_viscous_Coulomb" }
170-
171- write::WriteString " End Properties\n "
172- }
173- }
0 commit comments