Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

in fact can return a list with the batch_name and some extra parameters that will arguments to be added to the arguments of the call to run the calculationbat call

Note: The batch_name must be relative to the problemtypes folder, not absolute, and the extra arguments will be added to the four default arguments 

Code Block
proc GiD_Event_SelectGIDBatFile { dir basename } {
    ...body...
    set value ...
    return $value
}

example:

The This example maintain the default GiD bat arguments are the 4 provided, but are not compulsory, can provide others
here add a 5th extra argument bat filename to be called, but add the the four default arguments a 5th extra argument (with the number of threads, specified by the user in the preferences windowswindow)

Code Block
languagexml
proc GiD_Event_SelectGIDBatFile { project_name basename } { 
     set problemtype_tail [file tail [GiD_Info Project ProblemType]
    set problemtype_directory [GidUtils::GiveProblemTypeFullname $problemtype].gid 
     set filename_bat [file join $problem_directory $problemtype$problemtype_tail.win.bat]
      if { $::tcl_platform(platform) != "windows" } {
             set filename_bat [file join $problem_directory $problemtype$problemtype_tail.unix.bat]
      }
   
       set gid_exe [info nameofexecutable]
    set result [list $filename_bat $basename $project_name $problemtype_directory $gid_exe]
    set cpus [ncpus [GiD_Set GID_OMP_NUM_THREADS]
    return [list lappend$filename_bat $result $ncpus
    return $result$ncpus]
}


GiD_Event_BeforeCalculate: will be called a little earlier than GiD_Event_BeforeRunCalculation, e.g. to allow renumber the mesh before write the calculation file and calculate
remote is 0 in case of local calculation, 1 in case or remote (sending to procserverd)

...