@@ -193,18 +193,22 @@ proc Kratos::LogInitialData { } {
193193
194194 # Get the exec version
195195 Kratos::GetExecVersion
196+ Kratos::GetProblemtypeGitTag
196197
197198 set initial_data [dict create]
198199 dict set initial_data GiD_version [GiD_Info gidversion]
199- dict set initial_data problemtype_git_hash " 68418871cff2b897f7fb9176827871b339fe5f91"
200+ dict set initial_data problemtype_git_hash $Kratos::kratos_private(problemtype_git_hash)
201+ dict set initial_data problemtype_version $Kratos::kratos_private(Version)
200202 dict set initial_data executable_version $Kratos::kratos_private(exec_version)
201203 dict set initial_data current_platform $::tcl_platform(platform)
204+ dict set initial_data gid_version [GiD_Info gidversion]
202205
203206 Kratos::Log [write::tcl2json $initial_data ]
204207}
205208
206209
207210proc Kratos::Duration { int_time } {
211+ if {$int_time == 0} {return " 0 sec" }
208212 set timeList [list ]
209213 foreach div {86400 3600 60 1} mod {0 24 60 60} name {day hr min sec} {
210214 set n [expr {$int_time / $div }]
@@ -237,4 +241,31 @@ proc Kratos::GetExecVersion {} {
237241 }
238242 }
239243 }
244+ }
245+ proc Kratos::GetProblemtypeGitTag {} {
246+ catch {
247+ variable kratos_private
248+ set tmp_filename [GidUtils::GetTmpFilename]
249+ set result [exec git -C $kratos_private(Path) log --format=" %H" -n 1 >> $tmp_filename ]
250+ set fp [open $tmp_filename r]
251+ set file_data [read $fp ]
252+ close $fp
253+ file delete $tmp_filename
254+ set data [split $file_data " \n " ]
255+ set kratos_private(problemtype_git_hash) [string trim [string trim [lindex $data 0]] " \" " ]
256+ }
257+ }
258+
259+ proc Kratos::GetMeshBasicData { } {
260+ set result [dict create]
261+ foreach element_type [GidUtils::GetElementTypes all] {
262+ set ne [GiD_Info Mesh NumElements $element_type ]
263+ if { $ne } {
264+ dict set result $element_type $ne
265+ }
266+ }
267+
268+ dict set result nodes [GiD_Info Mesh NumNodes]
269+ dict set result is_quadratic [expr [GiD_Info Project Quadratic] && ![GiD_Cartesian get iscartesian] ]
270+ return $result
240271}
0 commit comments