Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions kratos.gid/apps/Dam/write/writeProjectParameters.tcl
Original file line number Diff line number Diff line change
Expand Up @@ -1019,10 +1019,15 @@ proc ::Dam::write::GetImportInitialStateEntries { } {
foreach node [$root selectNodes $xp] {
set policy [Dam::write::GetBlockValue $node ReferenceTemperaturePolicy]
if {$policy eq ""} {set policy "preserve"}
# Projects created before the spatial-mapping option have no
# TransferMethod node; keep their historical matching-mesh behaviour.
set transferMethod [Dam::write::GetBlockValue $node TransferMethod]
if {$transferMethod eq ""} {set transferMethod "matching_mesh"}
lappend entries [dict create \
name [$node @name] \
group [Dam::write::GetBlockValue $node Part] \
input [string trim [Dam::write::GetBlockValue $node InputFile]] \
transfer_method $transferMethod \
stresses [write::isBooleanTrue [Dam::write::GetBlockValue $node ImportStresses]] \
temperature [write::isBooleanTrue [Dam::write::GetBlockValue $node ImportTemperature]] \
reference [write::isBooleanTrue [Dam::write::GetBlockValue $node ImportReferenceTemperature]] \
Expand Down Expand Up @@ -1054,6 +1059,7 @@ proc ::Dam::write::GetImportInitialStateProcessDictFor { entry } {
dict set parametersDict import_temperature [expr {[dict get $entry temperature] ? "true" : "false"}]
dict set parametersDict import_reference_temperature [expr {[dict get $entry reference] ? "true" : "false"}]
dict set parametersDict reference_temperature_policy [dict get $entry policy]
dict set parametersDict transfer_method [dict get $entry transfer_method]

set processDict [dict create]
dict set processDict python_module "import_dam_initial_state_process"
Expand Down Expand Up @@ -1181,6 +1187,7 @@ proc ::Dam::write::writeValidateEvent { } {
set importTemperature [dict get $entry temperature]
set importReferenceTemperature [dict get $entry reference]
set referencePolicy [dict get $entry policy]
set transferMethod [dict get $entry transfer_method]
set inputFile [string trim [dict get $entry input]]

if {$group eq ""} {
Expand Down Expand Up @@ -1225,6 +1232,10 @@ proc ::Dam::write::writeValidateEvent { } {
incr problem
lappend messages "Import initial state ($entryName): unsupported reference temperature policy '$referencePolicy'."
}
if {$transferMethod ni [list "matching_mesh" "spatial_mapping"]} {
incr problem
lappend messages "Import initial state ($entryName): unsupported transfer method '$transferMethod'."
}
if {$referencePolicy eq "initial_temperature"} {
if {!$importTemperature} {
incr problem
Expand Down
1 change: 1 addition & 0 deletions kratos.gid/apps/Dam/xml/Utilities.spd
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
<blockdata n="ImportPart" pn="Part" name="Part 1" sequence="1" editable_name="unique" can_delete_last_item="1">
<value n="Part" pn="Structural part" values="[GetParts]" v=""/>
<value n="InputFile" pn="Input file" type="file" v="- No file - (add files using File handler toolbar)" values="[GetTransferFileValues]" update_proc="AddFile" help="Final-state file for this part. Select an existing .json or .json.gz file, or type an absolute/relative path."/>
<value n="TransferMethod" pn="Transfer method" v="matching_mesh" values="matching_mesh,spatial_mapping" dict="matching_mesh,Matching mesh,spatial_mapping,Spatial mapping" help="Matching mesh: transfer the initial state between identical meshes.\nSpatial mapping: transfer the initial state between different 2D or 3D meshes representing the same physical domain."/>
<value n="ImportStresses" pn="Import initial stresses" v="Yes" values="Yes,No" actualize_tree="1"/>
<value n="ImportTemperature" pn="Import temperature" v="Yes" values="Yes,No" actualize_tree="1"/>
<value n="ImportReferenceTemperature" pn="Import reference temperature" v="Yes" values="Yes,No" actualize_tree="1"/>
Expand Down