24.1 Idea and motivation

The primary objective is to allow the user to execute a sequence of commands from a Python script that implement the functionality of FieldConvert, thereby giving freedom to customise the order in which modules are used and which command line options are passed to them. One problem with FieldConvert is when the user wishes to perform the same task on many files; for example converting a number of .chk files to VTK format. To achieve this using FieldConvert, one must run a command like the following n times for each individual file.

1FieldConvert -m session.xml field_n.chk field_n.vtu

These .chk files represent the same fields, only at different moments in time, and so the mesh described in the session file is the same. For each file, an instance of Field is initialised and its member variables populated by the modules InputFld, ProcessCreateExp, and OutputVtk. This is clearly computationally inefficient. In the Python implementation, we are able to initialise instances of these classes only once, and then for each file populate and clear the variables that differ.

24.1.1 Bindings

The bindings are stored within a directory named ’Python’ in the FieldUtils directory.