Skip to content

Commit 32e4fcd

Browse files
hotfix #851
1 parent 59bdb4d commit 32e4fcd

3 files changed

Lines changed: 66 additions & 66 deletions

File tree

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<container n="PfemFluid" pn="PFEM Fluid Data" icon="pfemData" prefix="PFEMFLUID_" tree_state="open" open_window="0">
33
<include n="ModelType" active="1" path="apps/PfemFluid/xml/ModelType.spd"/>
44
<include n="Bodies" active="1" path="apps/PfemFluid/xml/Bodies.spd"/>
55
<include n="BoundaryConditions" active="1" path="apps/PfemFluid/xml/NodalConditions.spd"/>
66
<include n="TimeSettings" active="1" icon="timeParams" path="apps/PfemFluid/xml/TimeSettings.spd"/>
77
<include n="Gravity" active="1" icon="gravityForce" path="apps/PfemFluid/xml/Gravity.spd"/>
8-
<include n="MeshBoxes" active="1" icon="boundingBox" path="apps/PfemFluid/xml/MeshBoxes.spd"/>
9-
<include n="SolutionStrategy" active="1" icon="linear_solver" path="apps/PfemFluid/xml/SolutionStrategy.spd"/>
10-
<include n="Parallelism" active="1" icon="parallel_type" path="apps/Common/xml/Parallelism.spd"/>
8+
<include n="MeshBoxes" active="1" icon="boundingBox" path="apps/PfemFluid/xml/MeshBoxes.spd"/>
9+
<include n="SolutionStrategy" active="1" icon="linear_solver" path="apps/PfemFluid/xml/SolutionStrategy.spd"/>
10+
<include n="Parallelism" active="1" icon="parallel_type" path="apps/Common/xml/Parallelism.spd"/>
1111
<include n="Results" active="1" path="apps/PfemFluid/xml/Results.spd"/>
12-
<include n="Restart" active="1" state='hidden' path="apps/Common/xml/Restart.spd"/>
13-
<include n="materials" active="0" path="apps/PfemFluid/xml/Materials.spd"/>
12+
<include n="materials" active="0" path="apps/PfemFluid/xml/Materials.spd"/>
1413
</container>

kratos.gid/apps/PfemFluid/xml/XmlController.tcl

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
namespace eval ::PfemFluid::xml {
22
namespace path ::PfemFluid
33
Kratos::AddNamespace [namespace current]
4-
4+
55
variable bodyNodalCondition
66
}
77

88
proc PfemFluid::xml::Init { } {
99
variable bodyNodalCondition
10-
10+
1111
set bodyNodalCondition [list ]
12-
12+
1313
Model::InitVariables dir $::PfemFluid::dir
14-
14+
1515
Model::getSolutionStrategies Strategies.xml
1616
Model::getElements Elements.xml
1717
Model::getConstitutiveLaws ConstitutiveLaws.xml
1818
Model::getProcesses "../../Common/xml/Processes.xml"
1919
Model::getProcesses Processes.xml
2020
Model::getNodalConditions NodalConditions.xml
2121
Model::getSolvers Solvers.xml
22-
22+
2323
Model::ForgetNodalCondition "CONTACT"
2424
}
2525

@@ -37,8 +37,8 @@ proc PfemFluid::xml::MultiAppEvent {args} {
3737
proc PfemFluid::xml::CustomTree { args } {
3838
#HOW TO USE THIS FUNCTION:
3939
#spdAux::SetValueOnTreeItem arg1 arg2 arg3 (arg4)
40-
#arg1: attribute_to_modify
41-
#arg2: value_of_the_attribute
40+
#arg1: attribute_to_modify
41+
#arg2: value_of_the_attribute
4242
#arg3: unique_name_of_the_node ('unique name is defined by the attribute un=)
4343
#arg4 (optional): name_of_the_child_we_want_to_modify ('name'is defined by the attribute n=)
4444

@@ -56,45 +56,45 @@ proc PfemFluid::xml::CustomTree { args } {
5656
spdAux::SetValueOnTreeItem icon sheets Intervals
5757
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute Intervals]/blockdata"] {
5858
$node setAttribute icon select
59-
}
60-
59+
}
60+
6161
#conditions
6262
spdAux::SetValueOnTreeItem state \[CheckNodalConditionStatePFEM\] PFEMFLUID_NodalConditions VELOCITY
6363
spdAux::SetValueOnTreeItem state \[CheckNodalConditionStatePFEM\] PFEMFLUID_NodalConditions PRESSURE
6464

65-
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_NodalConditions]/condition" ] {
65+
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_NodalConditions]/condition" ] {
6666
$node setAttribute icon select
6767
$node setAttribute groups_icon groupCreated
6868
}
6969

7070
#loads
7171
if {[spdAux::getRoute PFEMFLUID_Loads] ne ""} {
72-
spdAux::SetValueOnTreeItem icon setLoad PFEMFLUID_Loads
73-
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_Loads]/condition" ] {
72+
spdAux::SetValueOnTreeItem icon setLoad PFEMFLUID_Loads
73+
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_Loads]/condition" ] {
7474
$node setAttribute icon select
7575
$node setAttribute groups_icon groupCreated
7676
}
7777
}
7878

7979
#materials
80-
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_Materials]/blockdata" ] {
80+
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_Materials]/blockdata" ] {
8181
$node setAttribute icon select
8282
}
83-
83+
8484
#solver settings
85-
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_StratSection]/container\[@n = 'linear_solver_settings'\]" ] {
85+
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_StratSection]/container\[@n = 'linear_solver_settings'\]" ] {
8686
$node setAttribute icon select
8787
}
8888

89-
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_StratSection]/container\[@n = 'velocity_linear_solver_settings'\]" ] {
89+
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_StratSection]/container\[@n = 'velocity_linear_solver_settings'\]" ] {
9090
$node setAttribute icon select
91-
}
91+
}
9292

93-
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_StratSection]/container\[@n = 'pressure_linear_solver_settings'\]" ] {
93+
foreach node [[$app_root parent] selectNodes "[spdAux::getRoute PFEMFLUID_StratSection]/container\[@n = 'pressure_linear_solver_settings'\]" ] {
9494
$node setAttribute icon select
95-
}
95+
}
96+
9697

97-
9898
#units
9999
[[$app_root parent] selectNodes "/Kratos_data/blockdata\[@n = 'units'\]"] setAttribute icon setUnits
100100

@@ -104,22 +104,22 @@ proc PfemFluid::xml::CustomTree { args } {
104104
spdAux::SetValueOnTreeItem v No NodalResults DISPLACEMENT
105105
spdAux::SetValueOnTreeItem v No NodalResults VELOCITY_REACTION
106106
spdAux::SetValueOnTreeItem v No NodalResults DISPLACEMENT_REACTION
107-
107+
108108
set inlet_result_node [[$app_root parent] selectNodes "[spdAux::getRoute NodalResults]/value\[@n = 'INLET'\]"]
109109
if {$inlet_result_node ne "" } {$inlet_result_node delete}
110110

111111
#restart
112-
spdAux::SetValueOnTreeItem icon doRestart Restart
113-
spdAux::SetValueOnTreeItem icon select Restart RestartOptions
114-
112+
# spdAux::SetValueOnTreeItem icon doRestart Restart
113+
# spdAux::SetValueOnTreeItem icon select Restart RestartOptions
114+
115115
# 3D gravity
116116
if {$Model::SpatialDimension eq "3D"} {
117117
catch {
118-
spdAux::SetValueOnTreeItem v -9.81 PFEMFLUID_Gravity Cy
119-
spdAux::SetValueOnTreeItem v 0.0 PFEMFLUID_Gravity Cz
118+
spdAux::SetValueOnTreeItem v -9.81 PFEMFLUID_Gravity Cy
119+
spdAux::SetValueOnTreeItem v 0.0 PFEMFLUID_Gravity Cz
120120
}
121121
}
122-
122+
123123
}
124124

125125
proc PfemFluid::xml::ProcCheckNodalConditionStatePFEM {domNode args} {
@@ -154,7 +154,7 @@ proc PfemFluid::xml::ProcGetElementsDict {domNode args} {
154154
set pnames ""
155155
foreach elem $elems {
156156
if {[$elem cumple $argums]} {
157-
lappend pnames [$elem getName]
157+
lappend pnames [$elem getName]
158158
lappend pnames [$elem getPublicName]
159159
}
160160
}
@@ -166,7 +166,7 @@ proc PfemFluid::xml::ProcGetElementsValues {domNode args} {
166166
set names [list ]
167167
set blockNode [PfemFluid::xml::FindMyBlocknode $domNode]
168168
set BodyType [get_domnode_attribute [$blockNode selectNodes "value\[@n='BodyType'\]"] v]
169-
169+
170170
set argums [list ElementType $BodyType]
171171
set elems [PfemFluid::xml::GetElements $domNode $args]
172172
foreach elem $elems {
@@ -175,17 +175,17 @@ proc PfemFluid::xml::ProcGetElementsValues {domNode args} {
175175
}
176176
}
177177
set values [join $names ","]
178-
178+
179179
if {[get_domnode_attribute $domNode v] eq ""} {$domNode setAttribute v [lindex $names 0]}
180180
if {[get_domnode_attribute $domNode v] ni $names} {$domNode setAttribute v [lindex $names 0]}
181-
181+
182182
return $values
183183
}
184184

185185
proc PfemFluid::xml::ProcGetConstitutiveLaws {domNode args} {
186186
set Elementname [$domNode selectNodes {string(../value[@n='Element']/@v)}]
187187
set Claws [::Model::GetAvailableConstitutiveLaws $Elementname]
188-
188+
189189
if {[llength $Claws] == 0} {
190190
set names [list "None"]
191191
} {
@@ -194,27 +194,27 @@ proc PfemFluid::xml::ProcGetConstitutiveLaws {domNode args} {
194194
lappend names [$cl getName]
195195
}
196196
}
197-
197+
198198
set values [join $names ","]
199-
199+
200200
if {[get_domnode_attribute $domNode v] eq "" || [get_domnode_attribute $domNode v] ni $names} {$domNode setAttribute v [lindex $names 0]; spdAux::RequestRefresh}
201-
201+
202202
return $values
203203
}
204204

205205
proc PfemFluid::xml::GetElements {domNode args} {
206-
206+
207207
set nodeApp [spdAux::GetAppIdFromNode $domNode]
208208
set sol_stratUN [apps::getAppUniqueName $nodeApp SolStrat]
209209
set schemeUN [apps::getAppUniqueName $nodeApp Scheme]
210-
210+
211211
get_domnode_attribute [$domNode selectNodes [spdAux::getRoute $sol_stratUN]] dict
212212
get_domnode_attribute [$domNode selectNodes [spdAux::getRoute $schemeUN]] dict
213-
213+
214214
set solStratName [::write::getValue $sol_stratUN]
215215
set schemeName [write::getValue $schemeUN]
216216
set elems [::Model::GetAvailableElements $solStratName $schemeName]
217-
217+
218218
return $elems
219219
}
220220

@@ -226,7 +226,7 @@ proc PfemFluid::xml::FindMyBlocknode {domNode} {
226226
set ret $domNode
227227
break
228228
} else {
229-
set domNode [$domNode parent]
229+
set domNode [$domNode parent]
230230
}
231231
}
232232
return $ret
@@ -250,7 +250,7 @@ proc PfemFluid::xml::ProcGetContactDomains {domNode args} {
250250
foreach contact_domain [[$domNode selectNodes $basepath] childNodes] {
251251
lappend values [get_domnode_attribute $contact_domain name]
252252
}
253-
253+
254254
if {[get_domnode_attribute $domNode v] eq "" || [get_domnode_attribute $domNode v] ni $values} {
255255
$domNode setAttribute v [lindex $values 0]
256256
}
@@ -264,11 +264,11 @@ proc PfemFluid::xml::ProcSolutionTypeState {domNode args} {
264264
if {$domain_type_route ne ""} {
265265
set domain_type_node [$domNode selectNodes $domain_type_route]
266266
set domain_type_value [get_domnode_attribute $domain_type_node v]
267-
268-
$domNode setAttribute values Dynamic
267+
268+
$domNode setAttribute values Dynamic
269269
$domNode setAttribute v Dynamic
270270
set state disabled
271-
271+
272272
}
273273
return $state
274274
}
@@ -280,7 +280,7 @@ proc PfemFluid::xml::ProcGetBodyTypeValues {domNode args} {
280280
if {$domain_type_route ne ""} {
281281
set domain_type_node [$domNode selectNodes $domain_type_route]
282282
set domain_type_value [get_domnode_attribute $domain_type_node v]
283-
283+
284284
if {$domain_type_value eq "Fluids"} {
285285
set values "Fluid,Rigid"
286286
}
@@ -305,21 +305,21 @@ proc PfemFluid::xml::ProcGetSolutionStrategiesPFEM {domNode args} {
305305
if {$domainType eq "Solids"} {set filter "Solid"}
306306
if {$domainType eq "Fluids"} {set filter "Pfem"}
307307
if {$domainType eq "FSI"} {set filter "Pfem"}
308-
308+
309309
foreach ss $Sols {
310310
if {[$ss getAttribute "App"] in $filter} {
311311
lappend names [$ss getName]
312312
lappend pnames [$ss getName]
313313
lappend pnames [$ss getPublicName]
314314
}
315315
}
316-
316+
317317
$domNode setAttribute values [join $names ","]
318318
set dv [lindex $names 0]
319319
#W "dv $dv"
320320
if {[$domNode getAttribute v] eq ""} {$domNode setAttribute v $dv; spdAux::RequestRefresh}
321321
if {[$domNode getAttribute v] ni $names} {$domNode setAttribute v $dv; spdAux::RequestRefresh}
322-
322+
323323
return [join $pnames ","]
324324
}
325325

@@ -394,11 +394,11 @@ proc PfemFluid::xml::ProcGetRigidBodiesValues {domNode args} {
394394
set bodies [list ]
395395
foreach body_node [$root selectNodes $xp1] {
396396
foreach subnode [$body_node childNodes] {
397-
if { [$subnode getAttribute n] eq "BodyType" } {
397+
if { [$subnode getAttribute n] eq "BodyType" } {
398398
if { [$subnode getAttribute v] eq "Rigid" || [$subnode getAttribute v] eq "Interface"} {
399399
lappend bodies [$body_node @name]
400400
break
401-
}
401+
}
402402
}
403403
}
404404
}
@@ -440,7 +440,7 @@ proc PfemFluid::xml::GetConditionsAndGroups { cnd_UN } {
440440

441441
proc PfemFluid::xml::getBodyNodalConditionById { id } {
442442
variable bodyNodalCondition
443-
443+
444444
foreach cnd $bodyNodalCondition {
445445
if {[$cnd getName] eq $id} {
446446
return $cnd
@@ -451,7 +451,7 @@ proc PfemFluid::xml::getBodyNodalConditionById { id } {
451451
proc PfemFluid::xml::getBodyNodalConditions { filename } {
452452
variable bodyNodalCondition
453453
dom parse [tDOM::xmlReadFile [file join $PfemFluid::dir xml $filename]] doc
454-
454+
455455
set NCList [$doc getElementsByTagName NodalConditionItem]
456456
foreach Node $NCList {
457457
lappend bodyNodalCondition [::Model::ParseNodalConditionsNode $Node]
@@ -468,7 +468,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
468468
set conds [$basenode parent]
469469
set AppUsesIntervals [::PfemFluid::GetAttribute UseIntervals]
470470
if {$AppUsesIntervals eq ""} {set AppUsesIntervals 0}
471-
471+
472472
foreach cnd $cond_list {
473473
set n [$cnd getName]
474474
set pn [$cnd getPublicName]
@@ -486,7 +486,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
486486
set contNode [gid_groups_conds::addF [$conds toXPath] container [list n $n pn ${pn}s help $help]]
487487
set blockNode [gid_groups_conds::addF [$contNode toXPath] blockdata [list n $n pn $pn help $help icon shells16 update_proc $check name "$pn 1" sequence 1 editable_name unique sequence_type non_void_disabled]]
488488
set block_path [$blockNode toXPath]
489-
set inputs [$process getInputs]
489+
set inputs [$process getInputs]
490490
foreach {inName in} $inputs {
491491
set pn [$in getPublicName]
492492
set type [$in getType]
@@ -497,7 +497,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
497497
foreach key [$cnd getDefaults $inName] {
498498
set $key [$cnd getDefault $inName $key]
499499
}
500-
500+
501501
set has_units [$in getAttribute "has_units"]
502502
if {$has_units ne ""} { set has_units "units='$units' unit_magnitude='$um'"}
503503
if {$type eq "vector"} {
@@ -516,7 +516,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
516516
set val [expr [$in getAttribute "enabled"] ? "Yes" : "No"]
517517
if {$i eq "Z"} { set val "No" }
518518
set valNode [gid_groups_conds::addF $block_path value [list n Enabled_$i pn "$i component" v No values "Yes,No" help "Enables the $i ${inName}" actualize_tree 1 {*}$zstate]]
519-
519+
520520
gid_groups_conds::addF [$valNode toXPath] dependencies [list value No node $nodev att1 state v1 hidden]
521521
gid_groups_conds::addF [$valNode toXPath] dependencies [list value Yes node $nodev att1 state v1 normal]
522522
if {[$in getAttribute "function"] eq "1"} {
@@ -540,7 +540,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
540540
gid_groups_conds::addF $block_path value [list n ${inName}$i wn [concat $n "_$i"] pn "$i ${pn}" v $v1 state hidden]
541541
}
542542
}
543-
543+
544544
} elseif { $type eq "combo" } {
545545
set values [join [$in getValues] ","]
546546
gid_groups_conds::addF $block_path value [list n $inName pn $pn v $v1 values $values state $state help $help]
@@ -554,7 +554,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
554554
set fname "function_$inName"
555555
set nodev "../value\[@n='$inName'\]"
556556
set nodef "../value\[@n='$fname'\]"
557-
557+
558558
set valNode [gid_groups_conds::addF $block_path value [list n ByFunction pn "by function -> f(x,y,z,t)" v No values "Yes,No" actualize_tree 1]]
559559
gid_groups_conds::addF [$valNode toXPath] dependencies [list value No node $nodev att1 state v1 normal]
560560
gid_groups_conds::addF [$valNode toXPath] dependencies [list value Yes node $nodev att1 state v1 hidden]
@@ -566,7 +566,7 @@ proc PfemFluid::xml::_injectCondsToTree {basenode cond_list {cond_type "normal"}
566566
gid_groups_conds::addF $block_path value [list n $inName pn $pn v $v units $units unit_magnitude $um help $help]
567567
}
568568
}
569-
569+
570570
set CondUsesIntervals [$cnd getAttribute "Interval"]
571571
if {$AppUsesIntervals && $CondUsesIntervals ne "False"} {
572572
gid_groups_conds::addF $block_path value [list n Interval pn "Time interval" v $CondUsesIntervals values {[getIntervals]} help $help]
@@ -583,7 +583,7 @@ proc PfemFluid::xml::ProcCheckStateBoundingBox3Dimension {domNode args} {
583583
set checkvalue [split [lindex $arglist 1] ","]
584584
set pst [$domNode selectNodes $xpath]
585585
#W "xpath $xpath checkvalue $checkvalue pst $pst"
586-
if {$pst in $checkvalue} { set state 1}
586+
if {$pst in $checkvalue} { set state 1}
587587
if {$state} {
588588

589589
set checkdim "3D"

0 commit comments

Comments
 (0)