FieldConvert
utility in Python was designed to provide the user with an easy workflow.
Hence, a minimum effort is required to set up the conversion and the majority of work is done
behind the scenes.
This section will discuss the design of the utility, including the description of work yet to be done, as well as the user workflow required to execute the basic conversions.
FieldConverter
classThe entire procedure outlined in the original FieldConvert
utility is managed by the
FieldConverter
class located in utilities/FieldConvert/Python/FieldConvert.py. The
class has the following attributes:
fieldSharedPtr
: a shared pointer to the field, necessary to initialise a module;
FieldSharedPtr
type remains to be wrapped.
FieldSharedPtr
is needed for each module
initialisation needs to be discussed.moduleFactory
: would be equivalent to GetModuleFactory()
in the original
utility;
NekFactory
and
initialise a module factory this way.availableModuleList
: holds a list of available modules in order to assert that the
modules requested by the user are available;
PrintAvailableClasses
method needs to be wrapped.
sessionFile
, inputFile
, outputFile
: hold the necessary filenames;
moduleList
: holds a list of Module
objects, created as requested by the user;
variableMap
: equivalent of vm
variable from the original utility.
Process
method of Module
class.
The currently suggested user workflow is as follows:
FieldConverter
class.
vorticity
.
addProcessModule
is a string containing
the module name.
Module
class object.The code showcasing the suggested workflow can be found in the main function of the
FieldConvert.py
file.