Skip to content

Commit 12096d9

Browse files
Merge pull request #888 from KratosMultiphysics/hotfix-linear-topologies
Hotfix linear topologies
2 parents 8e01140 + 4443ad7 commit 12096d9

4 files changed

Lines changed: 59 additions & 58 deletions

File tree

kratos.gid/scripts/Model/Condition.tcl

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace eval ::Model {
77
Kratos::AddNamespace [namespace current]
8-
8+
99
catch {Condition destroy}
1010
oo::class create Condition {
1111
superclass Entity
@@ -14,32 +14,32 @@ oo::class create Condition {
1414
variable defaults
1515
variable groupby
1616
variable symbol
17-
17+
1818
constructor {n} {
1919
next $n
2020
variable TopologyFeatures
2121
set TopologyFeatures [list ]
22-
22+
2323
variable defaults
2424
set defaults [dict create ]
25-
25+
2626
variable processName
2727
set processName ""
2828
variable groupby
2929
set groupby ""
3030
set symbol [list]
3131
}
32-
32+
3333
method addTopologyFeature {top} {
3434
variable TopologyFeatures
3535
lappend TopologyFeatures $top
3636
}
37-
37+
3838
method getTopologyFeature {geo nod} {
3939
variable TopologyFeatures
4040
set ret ""
4141
foreach top $TopologyFeatures {
42-
if {[string match [$top getGeometry]* $geo] && [$top getNodes] eq $nod} {set ret $top; break}
42+
if {[$top getGeometry] eq $geo && [$top getNodes] eq $nod} {set ret $top; break}
4343
}
4444
return $ret
4545
}
@@ -59,7 +59,7 @@ oo::class create Condition {
5959
variable TopologyFeatures
6060
return $TopologyFeatures
6161
}
62-
62+
6363
method setProcessName {pn} {
6464
variable processName
6565
set processName $pn
@@ -128,17 +128,17 @@ proc Model::DeleteRepeatedConditions { } {
128128
variable Conditions
129129
set Conditions2 [dict create ]
130130
foreach cnd $Conditions {
131-
set cnd_id [$cnd getName]
131+
set cnd_id [$cnd getName]
132132
dict set Conditions2 $cnd
133133
}
134134
set Conditions $Conditions2
135135
}
136-
proc Model::GetConditions {args} {
136+
proc Model::GetConditions {args} {
137137
variable Conditions
138138
if {$args eq ""} {
139139
return $Conditions
140140
}
141-
141+
142142
set cumplen [list ]
143143
foreach elem $Conditions {
144144
if {[$elem cumple {*}$args]} { lappend cumplen $elem}
@@ -149,7 +149,7 @@ proc Model::GetConditions {args} {
149149

150150
proc Model::ParseConditions { doc } {
151151
variable Conditions
152-
152+
153153
set CondNodeList [$doc getElementsByTagName ConditionItem]
154154
foreach CondNode $CondNodeList {
155155
lappend Conditions [ParseCondNode $CondNode]
@@ -164,7 +164,7 @@ proc Model::ParseCondNode { node } {
164164
if {[$node hasAttribute help]} {$cnd setHelp [$node getAttribute help]}
165165
if {[$node hasAttribute ProcessName]} {$cnd setProcessName [$node getAttribute ProcessName]}
166166
if {[$node hasAttribute GroupBy]} {$cnd setGroupBy [$node getAttribute GroupBy]}
167-
167+
168168
foreach att [$node attributes] {
169169
$cnd setAttribute $att [split [$node getAttribute $att] ","]
170170
#W "$att : [$el getAttribute $att]"
@@ -173,11 +173,11 @@ proc Model::ParseCondNode { node } {
173173
if { [llength $symbol_node]==1 } {
174174
set data [list]
175175
foreach attribute [$symbol_node attributes] {
176-
lappend data $attribute [$symbol_node getAttribute $attribute]
176+
lappend data $attribute [$symbol_node getAttribute $attribute]
177177
}
178178
$cnd setSymbol $data
179179
}
180-
180+
181181
set topology_base [$node getElementsByTagName TopologyFeatures]
182182
if {[llength $topology_base] eq 1} {
183183
foreach top [$topology_base getElementsByTagName item] {
@@ -214,7 +214,7 @@ proc Model::ParseCondNode { node } {
214214
return $cnd
215215
}
216216

217-
proc Model::getCondition {cid} {
217+
proc Model::getCondition {cid} {
218218
variable Conditions
219219

220220
foreach elem $Conditions {
@@ -227,7 +227,7 @@ proc Model::getCondition {cid} {
227227

228228
proc Model::GetAllCondOutputs {} {
229229
variable Conditions
230-
230+
231231
set outputs [dict create]
232232
foreach el $Conditions {
233233
foreach in [dict keys [$el getOutputs]] {
@@ -239,7 +239,7 @@ proc Model::GetAllCondOutputs {} {
239239

240240
proc Model::GetAllCondInputs {} {
241241
variable Conditions
242-
242+
243243
set inputs [dict create]
244244
foreach el $Conditions {
245245
foreach in [dict keys [$el getInputs]] {
@@ -264,7 +264,7 @@ proc Model::CheckConditionState {node args} {
264264
set eldim [split [$cond getAttribute "WorkingSpaceDimension"] ","]
265265
if {$ptdim ni $eldim} {set cumple 0; break}
266266
}
267-
267+
268268
}
269269
}
270270
}

0 commit comments

Comments
 (0)