@@ -86,7 +86,8 @@ proc ::GeoMechanics::examples::SecondExample::TreeAssignation {args} {
8686 set root [customlib::GetBaseRoot]
8787
8888 # Stage 1
89- set stage [$root selectNodes " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 1'\] " ]
89+ set stage_id " Stage 1"
90+ set stage [$root selectNodes " .//container\[ @n='stages'\] /blockdata\[ @name = '$stage_id '\] " ]
9091
9192 # Solution type
9293 set xpath [spdAux::getRoute " GEOMSoluType" $stage ]
@@ -102,7 +103,7 @@ proc ::GeoMechanics::examples::SecondExample::TreeAssignation {args} {
102103 spdAux::SetValuesOnBasePath $xpath $parameters
103104
104105 # Parts
105- set parts [spdAux::getRoute " GEOMParts" $stage ]/condition\[ @n='Parts_GeoSteadyState '\]
106+ set parts [spdAux::getRoute " GEOMParts" $stage ]/condition\[ @n='Parts_GeoSmallStrain '\]
106107 set body_node [customlib::AddConditionGroupOnXPath $parts Clay_after_excavation]
107108 set props [list YOUNG_MODULUS 1000 POISSON_RATIO 0.3]
108109 spdAux::SetValuesOnBaseNode $body_node $props
@@ -113,121 +114,78 @@ proc ::GeoMechanics::examples::SecondExample::TreeAssignation {args} {
113114 # Phreatic line
114115 ::GeoMechanics::xml::AddPhreaticPoint $stage 0.0 -1.0 0.0
115116 ::GeoMechanics::xml::AddPhreaticPoint $stage 30.0 -1.0 0.0
117+
118+ # Pressure on bottom line
119+ set pressure [spdAux::getRoute " GEOMNodalConditions" $stage ]/condition\[ @n='WATER_PRESSURE'\]
120+ set pressure_node [customlib::AddConditionGroupOnXPath $pressure " Bottom" ]
121+ $pressure_node setAttribute ov line
122+ set props [list value -137.34]
123+ spdAux::SetValuesOnBaseNode $pressure_node $props
116124
117125 # Fix ground
118- GiD_Groups clone Bottom Total
119- GiD_Groups edit parent Total Bottom
120- spdAux::AddIntervalGroup Bottom " Bottom//Total"
121- GiD_Groups edit state " Bottom//Total" hidden
122126 set displacement [spdAux::getRoute " GEOMNodalConditions" $stage ]/condition\[ @n='DISPLACEMENT'\]
123- set displacement_node [customlib::AddConditionGroupOnXPath $displacement " Bottom//Total " ]
127+ set displacement_node [customlib::AddConditionGroupOnXPath $displacement " Bottom" ]
124128 $displacement_node setAttribute ov line
125- set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y ByValue selector_component_Z Not Interval Total ]
129+ set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y ByValue selector_component_Z Not]
126130 spdAux::SetValuesOnBaseNode $displacement_node $props
127131
128132 # Fix sides only X
129- GiD_Groups clone Side_sliders Total
130- GiD_Groups edit parent Total Side_sliders
131- spdAux::AddIntervalGroup Side_sliders " Side_sliders//Total"
132- GiD_Groups edit state " Side_sliders//Total" hidden
133133 set displacement [spdAux::getRoute " GEOMNodalConditions" $stage ]/condition\[ @n='DISPLACEMENT'\]
134- set displacement_node [customlib::AddConditionGroupOnXPath $displacement " Side_sliders//Total " ]
134+ set displacement_node [customlib::AddConditionGroupOnXPath $displacement " Side_sliders" ]
135135 $displacement_node setAttribute ov line
136- set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y Not selector_component_Z Not Interval Total ]
136+ set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y Not selector_component_Z Not]
137137 spdAux::SetValuesOnBaseNode $displacement_node $props
138138
139139 # Gravity
140- if {![GiD_Groups exists " Clay_after_excavation//Total" ]} {
141- GiD_Groups clone Clay_after_excavation Total
142- GiD_Groups edit parent Total Clay_after_excavation
143- spdAux::AddIntervalGroup Clay_after_excavation " Clay_after_excavation//Total"
144- GiD_Groups edit state " Clay_after_excavation//Total" hidden
145- }
146140 set gravity [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='SelfWeight2D'\]
147- set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Clay_after_excavation//Total " ]
141+ set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Clay_after_excavation" ]
148142 $gravity_node setAttribute ov surface
149- set props [list modulus 9.81 value_direction_Y -1.0 Interval Total ]
143+ set props [list modulus 9.81 value_direction_Y -1.0]
150144 spdAux::SetValuesOnBaseNode $gravity_node $props
151145
152- if {![GiD_Groups exists " Excavated//Total" ]} {
153- GiD_Groups clone Excavated Total
154- GiD_Groups edit parent Total Excavated
155- spdAux::AddIntervalGroup Excavated " Excavated//Total"
156- GiD_Groups edit state " Excavated//Total" hidden
157- }
158146 set gravity [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='SelfWeight2D'\]
159- set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Excavated//Total " ]
147+ set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Excavated" ]
160148 $gravity_node setAttribute ov surface
161- set props [list modulus 9.81 value_direction_Y -1.0 Interval Total ]
149+ set props [list modulus 9.81 value_direction_Y -1.0]
162150 spdAux::SetValuesOnBaseNode $gravity_node $props
163151
164- # Pressure on bottom line
165- set pressure [spdAux::getRoute " STNodalConditions" $stage ]/condition\[ @n='WATER_PRESSURE'\]
166- set pressure_node [customlib::AddConditionGroupOnXPath $pressure " Bottom" ]
167- $pressure_node setAttribute ov line
168- set props [list value -137.34]
169- spdAux::SetValuesOnBaseNode $pressure_node $props
170-
171152
172153 # Stage 2
173- ::GeoMechanics::xml::NewStage " Stage 2"
174- set stage [$root selectNodes " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 2'\] " ]
154+ set stage_id " Stage 2"
155+ ::GeoMechanics::xml::NewStage $stage_id
156+ set stage [$root selectNodes " .//container\[ @n='stages'\] /blockdata\[ @name = '$stage_id '\] " ]
175157
176158 # Top Pressure
177- GiD_Groups clone Load Total
178- GiD_Groups edit parent Total Load
179- spdAux::AddIntervalGroup Load " Load//Total"
180- GiD_Groups edit state " Load//Total" hidden
181159 set pressure [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='LinePressure2D'\]
182- set pressure_node [customlib::AddConditionGroupOnXPath $pressure " Load//Total " ]
160+ set pressure_node [customlib::AddConditionGroupOnXPath $pressure " Load" ]
183161 $pressure_node setAttribute ov line
184- set props [list value 5000 Interval Total ]
162+ set props [list value -5 ]
185163 spdAux::SetValuesOnBaseNode $pressure_node $props
186164
187165 # Stage 3
188166 ::GeoMechanics::xml::NewStage " Stage 3"
189167 set stage [$root selectNodes " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 3'\] " ]
190-
191- # Remove body to split into excavated and clay
192- gid_groups_conds::delete " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 3'\] /container\[ @n = 'Parts']/condition/group"
193- gid_groups_conds::delete " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 3'\] /container\[ @n = 'Loads']/condition\[ @n='SelfWeight2D'\] /group"
194-
195- # Parts
196- set parts [spdAux::getRoute " GEOMParts" $stage ]/condition\[ @n='Parts_GeoSteadyState'\]
197- set body_node [customlib::AddConditionGroupOnXPath $parts Clay_after_excavation]
198- set props [list YOUNG_MODULUS 1000 POISSON_RATIO 0.3]
199- spdAux::SetValuesOnBaseNode $body_node $props
200-
201- set parts [spdAux::getRoute " GEOMParts" $stage ]/condition\[ @n='Parts_GeoSteadyState'\]
202- set body_node [customlib::AddConditionGroupOnXPath $parts Excavated]
203- set props [list YOUNG_MODULUS 1000 POISSON_RATIO 0.3]
204- spdAux::SetValuesOnBaseNode $body_node $props
205168
169+ # Delete the load and create another one here
170+ gid_groups_conds::delete " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 3'\] /container\[ @n = 'Loads']/condition\[ @n='LinePressure2D'\] /group"
171+ set pressure [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='LinePressure2D'\]
172+ set pressure_node [customlib::AddConditionGroupOnXPath $pressure " Load" ]
173+ $pressure_node setAttribute ov line
174+ set props [list value -15]
175+ spdAux::SetValuesOnBaseNode $pressure_node $props
176+
206177
207178 # Gravity
208- if {![GiD_Groups exists " Clay_after_excavation//Total" ]} {
209- GiD_Groups clone Clay_after_excavation Total
210- GiD_Groups edit parent Total Clay_after_excavation
211- spdAux::AddIntervalGroup Clay_after_excavation " Clay_after_excavation//Total"
212- GiD_Groups edit state " Clay_after_excavation//Total" hidden
213- }
214179 set gravity [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='SelfWeight2D'\]
215- set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Clay_after_excavation//Total " ]
180+ set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Clay_after_excavation" ]
216181 $gravity_node setAttribute ov surface
217- set props [list modulus 9.81 value_direction_Y -1.0 Interval Total ]
182+ set props [list modulus 9.81 value_direction_Y -1.0]
218183 spdAux::SetValuesOnBaseNode $gravity_node $props
219184
220-
221- if {![GiD_Groups exists " Excavated//Total" ]} {
222- GiD_Groups clone Excavated Total
223- GiD_Groups edit parent Total Excavated
224- spdAux::AddIntervalGroup Excavated " Excavated//Total"
225- GiD_Groups edit state " Excavated//Total" hidden
226- }
227185 set gravity [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='SelfWeight2D'\]
228- set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Excavated//Total " ]
186+ set gravity_node [customlib::AddConditionGroupOnXPath $gravity " Excavated" ]
229187 $gravity_node setAttribute ov surface
230- set props [list modulus 9.81 value_direction_Y -1.0 Interval Total ]
188+ set props [list modulus 9.81 value_direction_Y -1.0]
231189 spdAux::SetValuesOnBaseNode $gravity_node $props
232190
233191
@@ -237,8 +195,13 @@ proc ::GeoMechanics::examples::SecondExample::TreeAssignation {args} {
237195
238196 # Remove excavated
239197 gid_groups_conds::delete " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 4'\] /container\[ @n = 'Parts']/condition/group\[ @n='Excavated'\] "
240- gid_groups_conds::delete " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 4'\] /container\[ @n = 'Loads']/condition\[ @n='SelfWeight2D'\] /group\[ @n='Excavated//Total '\] "
198+ gid_groups_conds::delete " .//container\[ @n='stages'\] /blockdata\[ @name = 'Stage 4'\] /container\[ @n = 'Loads']/condition\[ @n='SelfWeight2D'\] /group\[ @n='Excavated'\] "
241199
200+ set excavation [spdAux::getRoute " GEOMLoads" $stage ]/condition\[ @n='Excavation'\]
201+ set excavation_node [customlib::AddConditionGroupOnXPath $excavation " Excavated" ]
202+ $excavation_node setAttribute ov surface
203+ set props [list deactivate_soil_part true]
204+ spdAux::SetValuesOnBaseNode $excavation_node $props
242205
243206 spdAux::parseRoutes
244207
@@ -273,18 +236,14 @@ proc ::GeoMechanics::examples::SecondExample::TreeAssignation {args} {
273236 set structPartsNode [customlib::AddConditionGroupOnXPath $structParts Structure]
274237 $structPartsNode setAttribute ov surface
275238 set constLawNameStruc " LinearElasticPlaneStress2DLaw"
276- set props [list Element TotalLagrangianElement $nd ConstitutiveLaw $constLawNameStruc DENSITY 7850 YOUNG_MODULUS 206.9e9 POISSON_RATIO 0.29 THICKNESS 0.1]
239+ set props [list Element TotalLagrangianElement2D ConstitutiveLaw $constLawNameStruc DENSITY 7850 YOUNG_MODULUS 206.9e9 POISSON_RATIO 0.29 THICKNESS 0.1]
277240 spdAux::SetValuesOnBaseNode $structPartsNode $props
278241
279242 # Structural Displacement
280- GiD_Groups clone Ground Total
281- GiD_Groups edit parent Total Ground
282- spdAux::AddIntervalGroup Ground " Ground//Total"
283- GiD_Groups edit state " Ground//Total" hidden
284243 set structDisplacement {container[@n='FSI']/container[@n='Structural']/container[@n='Boundary Conditions']/condition[@n='DISPLACEMENT']}
285244 set structDisplacementNode [customlib::AddConditionGroupOnXPath $structDisplacement Ground]
286245 $structDisplacementNode setAttribute ov line
287- set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 0.0 Interval Total ]
246+ set props [list selector_component_X ByValue value_component_X 0.0 selector_component_Y ByValue value_component_Y 0.0 selector_component_Z ByValue value_component_Z 0.0]
288247 spdAux::SetValuesOnBaseNode $structDisplacementNode $props
289248
290249 # Structure domain time parameters
0 commit comments