GiD - The personal pre and post processor

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 10 Current »

GiD_Event_SelectGIDBatFile: must be used to switch the default batch file for special cases.
This procedure must return as a value the alternative pathname of the batch file. For example it is used as a trick to select a different analysis from a list of batch calculation files.

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

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

example:

This example maintain the default 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 window)

proc GiD_Event_SelectGIDBatFile { project_name basename } { 
    set problemtype_tail [file tail [GiD_Info Project ProblemType]] 
    set filename_bat $problemtype_tail.win.bat
    if { $::tcl_platform(platform) != "windows" } {
        set filename_bat $problemtype_tail.unix.bat
    }
    set ncpus [GiD_Set GID_OMP_NUM_THREADS]
    return [list $filename_bat $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)

proc GiD_Event_BeforeCalculate { remote } {
    ...body...
    set value ...
    return $value
}


GiD_Event_BeforeRunCalculation: will be called before running the analysis. It receives several arguments:

  • batfilename: the name of the batch file to be run
  • basename: the short name model
  • dir: the full path to the model directory
  • problemtypedir: the full path to the Problem Types directory
  • gidexe: the full path to gid
  • args: an optional list with other arguments

If it returns -cancel- then the calculation is not started.

proc GiD_Event_BeforeRunCalculation { batfilename basename dir problemtypedir gidexe args } {
    ...body...
    set value ...
    return $value
}


GiD_Event_AfterRunCalculation: will be called just after the analysis finishes.
If it returns -cancel-as a value then the window that inform about the finished process will not be opened.
It receives as arguments:
basename: the short name model;
dir: the full path to the model directory;
problemtypedir: the full path to the Problem Types directory;
where: must be local or remote (remote if it was run in a server machine, using ProcServer);
error: returns 1 if an calculation error was detected;
errorfilename: an error filename with some error explanation, or nothing if everything was ok.

proc GiD_Event_AfterRunCalculation { basename dir problemtypedir where error errorfilename } {
    ...body...
    set value ...
    return $value
}
  • No labels