Skip to content

Commit 700e542

Browse files
Launch global pip
1 parent 8e048a6 commit 700e542

3 files changed

Lines changed: 39 additions & 5 deletions

File tree

kratos.gid/exec/global_pip.win.bat

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
REM @ECHO OFF
2+
REM Identification for arguments
3+
REM basename = %1
4+
REM Project directory = %2
5+
REM Problem directory = %3
6+
7+
REM OutputFile: "%2\%1.info"
8+
REM ErrorFile: "%2\%1.err"
9+
10+
REM Remove previous calculation files and results
11+
DEL "%2\%1.info"
12+
DEL "%2\%1.err"
13+
DEL "%2\%1*.post.bin"
14+
DEL "%2\%1*.post.res"
15+
DEL "%2\%1*.post.msh"
16+
17+
REM Install dependencies if needed
18+
pip install numpy
19+
pip install KratosFluidDynamicsApplication
20+
21+
@REM Calculate!
22+
python MainKratos.py > "%2\\%1.info" 2> "%2\\%1.err"

kratos.gid/exec/launch.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22
"configurations": [
33
{
44
"name": "Launch via pip",
5-
"runtimeExecutable": "python.exe"
5+
"script": "global_pip"
66
},
77
{
88
"name": "Launch via pip with local packages",
9-
"runtimeExecutable": "python.exe"
9+
"script": "local_pip"
1010
},
1111
{
1212
"name": "Launch local compiled version",
13-
"kratos_path": "E:/Deploy_Kratos",
14-
"runtimeExecutable": "python.exe"
13+
"script": "compiled"
1514
},
1615
{
1716
"name": "Docker",
18-
"image": ""
17+
"script": ""
1918
}
2019
]
2120
}

kratos.gid/scripts/Utils.tcl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,4 +379,17 @@ proc Kratos::SetDefaultLaunchMode { } {
379379
if {$first eq ""} {set first $mode_name}
380380
}
381381
if {$curr_mode ni $modes} {set Kratos::kratos_private(launch_configuration) $first}
382+
}
383+
384+
proc Kratos::ExecuteLaunchByMode {launch_mode} {
385+
set bat_file ""
386+
if { $::tcl_platform(platform) == "windows" } { set os win } {set os unix}
387+
foreach mode $::Kratos::kratos_private(configurations) {
388+
set mode_name [dict get $mode name]
389+
if {$mode_name eq $launch_mode} {
390+
set bat [dict get $mode script]
391+
set bat_file [file join exec $bat.$os.bat]
392+
}
393+
}
394+
return $bat_file
382395
}

0 commit comments

Comments
 (0)