Skip to content

Commit 649df67

Browse files
load launch mode by default
1 parent cd9d6f9 commit 649df67

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

kratos.gid/kratos.tcl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@ proc Kratos::Event_InitProblemtype { dir } {
110110
# Load the Kratos problemtype global and user environment (stored preferences)
111111
Kratos::LoadEnvironment
112112

113+
# Load launch modes
114+
Kratos::LoadLaunchModes
115+
113116
# Customize GiD menus to add the Kratos entry
114117
Kratos::UpdateMenus
115118

kratos.gid/scripts/Utils.tcl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,4 +338,24 @@ proc Kratos::pythonVersion {{pythonExecutable "python"}} {
338338
return $version
339339
}
340340
return 0
341+
}
342+
343+
344+
proc Kratos::GetLaunchConfigurationFile { } {
345+
set new_dir [file join $::env(HOME) .kratos_multiphysics]
346+
set file [file join $new_dir launch_configuration.json]
347+
return [list $new_dir $file]
348+
}
349+
350+
proc Kratos::LoadLaunchModes { } {
351+
# Get location of launch config script
352+
lassign [Kratos::GetLaunchConfigurationFile] new_dir file
353+
354+
# If it does not exist, copy it from exec
355+
if {[file exists $new_dir] == 0} {file mkdir $new_dir}
356+
if {[file exists $file] == 0} {
357+
::GidUtils::SetWarnLine "Loading launch mode"
358+
set source [file join $::Kratos::kratos_private(Path) exec launch.json]
359+
file copy -force $source $file
360+
}
341361
}

0 commit comments

Comments
 (0)