File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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"
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff 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}
You can’t perform that action at this time.
0 commit comments