Skip to content

Commit 37949af

Browse files
cht mdpa write split by domain
1 parent 49ed74b commit 37949af

6 files changed

Lines changed: 25 additions & 4 deletions

File tree

kratos.gid/apps/Buoyancy/write/write.tcl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ proc ::Buoyancy::write::writeModelPartEvent { } {
2020
if {$err ne ""} {error $err}
2121

2222
::Fluid::write::Init
23+
24+
set fluid_base_xpath [spdAux::getRoute Buoyancy_FL]
25+
set fluid_base [[customlib::GetBaseRoot] selectNodes $fluid_base_xpath]
26+
set ::Fluid::write::fluid_base $fluid_base
2327

2428
::Fluid::write::writeModelPartEvent
2529

kratos.gid/apps/ConjugateHeatTransfer/write/write.tcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ proc ::ConjugateHeatTransfer::write::writeModelPartEvent { } {
4747
# Convection diffusion mdpa
4848
ConvectionDiffusion::write::Init
4949
ConvectionDiffusion::write::SetAttribute writeCoordinatesByGroups [GetAttribute coordinates]
50+
51+
set base_root_xpath [spdAux::getRoute CHTCNVDFF]
52+
set base_root [[customlib::GetBaseRoot] selectNodes $base_root_xpath]
53+
set ::ConvectionDiffusion::write::base_root $base_root
54+
5055
write::writeAppMDPA ConvectionDiffusion
5156
write::RenameFileInModel "$filename.mdpa" "${filename}_[GetAttribute solid_mdpa_suffix].mdpa"
5257
}

kratos.gid/apps/ConjugateHeatTransfer/xml/Main.spd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<container n="Buoyancy" pn="Buoyancy" icon="app" prefix="Buoyancy_" tree_state="open" open_window="0">
66

7-
<container n="Fluid" pn="Fluid" icon="units" prefix="FL" tree_state="open" open_window="0">
7+
<container n="Fluid" pn="Fluid" icon="units" un="Buoyancy_FL" prefix="FL" tree_state="open" open_window="0">
88
<include n="AnalysisType" active="1" path="apps/Fluid/xml/AnalysisType.spd"/>
99
<include n="Parts" active="1" un="FLParts" path="apps/Fluid/xml/Parts.spd"/>
1010
<include n="InitialConditions" active="1" path="apps/Fluid/xml/InitialConditions.spd"/>
@@ -27,7 +27,7 @@
2727

2828
</container>
2929

30-
<container n="ConvectionDiffusion" pn="Convection-diffusion" icon="heat" prefix="CNVDFF" tree_state="open" open_window="0">
30+
<container n="ConvectionDiffusion" pn="Convection-diffusion" icon="heat" un="CHTCNVDFF" prefix="CNVDFF" tree_state="open" open_window="0">
3131
<include n="StageInfo" active="1" path="apps/ConvectionDiffusion/xml/StageInfo.spd"/>
3232
<include n="Parts" active="1" path="apps/ConvectionDiffusion/xml/Parts.spd"/>
3333
<include n="Intervals" active="1" path="apps/Common/xml/Intervals.spd"/>

kratos.gid/apps/ConvectionDiffusion/write/write.tcl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace eval ::ConvectionDiffusion::write {
55
variable ConvectionDiffusionConditions
66
variable writeCoordinatesByGroups
77
variable writeAttributes
8+
variable base_root
89
}
910

1011
proc ::ConvectionDiffusion::write::Init { } {
@@ -27,10 +28,14 @@ proc ::ConvectionDiffusion::write::Init { } {
2728
SetAttribute output_model_part_name [::ConvectionDiffusion::GetWriteProperty output_model_part_name]
2829
SetAttribute write_mdpa_mode [::ConvectionDiffusion::GetWriteProperty write_mdpa_mode]
2930

31+
32+
variable base_root
33+
set base_root [customlib::GetBaseRoot]
3034
}
3135

3236
# Events
3337
proc ::ConvectionDiffusion::write::writeModelPartEvent { } {
38+
variable base_root
3439
# Validation
3540
set err [Validate]
3641
if {$err ne ""} {error $err}
@@ -48,7 +53,7 @@ proc ::ConvectionDiffusion::write::writeModelPartEvent { } {
4853
if {[GetAttribute write_mdpa_mode] eq "geometries"} {
4954

5055
# Get the list of groups in the spd
51-
set lista [::spdAux::GetListOfSubModelParts]
56+
set lista [::spdAux::GetListOfSubModelParts $base_root]
5257

5358
# Write the geometries
5459
set ret [::write::writeGeometryConnectivities $lista]

kratos.gid/apps/Fluid/write/write.tcl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace eval ::Fluid::write {
99
# after regular conditions are written, we need this number in order to print the custom submodelpart conditions
1010
# only if are applied over things that are not in the skin
1111
variable last_condition_iterator
12+
variable fluid_base
1213
}
1314

1415
proc ::Fluid::write::Init { } {
@@ -32,10 +33,15 @@ proc ::Fluid::write::Init { } {
3233

3334
variable last_condition_iterator
3435
set last_condition_iterator 0
36+
37+
variable fluid_base
38+
set fluid_base ""
3539
}
3640

3741
# MDPA write event
3842
proc ::Fluid::write::writeModelPartEvent { } {
43+
variable fluid_base
44+
3945
# Validation
4046
set err [Validate]
4147
if {$err ne ""} {error $err}
@@ -55,7 +61,7 @@ proc ::Fluid::write::writeModelPartEvent { } {
5561
if {[GetAttribute write_mdpa_mode] eq "geometries"} {
5662
# Write geometries
5763
# Get the list of groups in the spd
58-
set lista [::Fluid::xml::GetListOfSubModelParts]
64+
set lista [::Fluid::xml::GetListOfSubModelParts $fluid_base]
5965

6066
# Write the geometries
6167
set ret [::write::writeGeometryConnectivities $lista]

kratos.gid/apps/Fluid/write/writeByGiDId.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ proc ::Fluid::write::writeBoundaryConditions { } {
9797
set BCUN [GetAttribute conditions_un]
9898

9999
# Write the conditions
100+
W "Writing conditions on $BCUN"
100101
::write::writeConditionsByGiDId $BCUN
101102

102103
}

0 commit comments

Comments
 (0)