Skip to content

Improvements to FieldConvert

Douglas Serson requested to merge feature/FC-refactor into master

This MR introduces several modifications to FieldConvert/FieldUtils. The most important one is defining categories for the modules based on the kind of action they perform (which I called priorities). Each of these categories represents a standardized form of input/output. For example, a module of priority ConvertExpToPts has to assume the input field is stored in m_f->m_exp (instead of m_data, for example), and has to create m_f->m_fieldPts. These categories define a logical sequence in which modules should be executed, which is

CreateGraph -> CreateFieldData -> ModifyFieldData -> CreateExp -> FillExp -> ModifyExp -> 
BndExtraction -> CreatePts  -> ConvertExpToPts -> ModifyPts -> Output

(obviously most of them are optional).

This approach offers several advantages:

  • Since the order of execution is clear (except for modules with the same priority), I was able to implement a simple procedure to run the modules in the correct order. This will automatically correct simple errors, like passing the fld input before the xml.
  • Because the modules' input and output types will be more standardized, I expect different modules will become more compatible with one another, making it easier to use a series of process modules with a single command.
  • It is now possible to check for some errors in the usage of FieldConvert simply by checking the number of modules with each priority. For example, if we have a module of type ModifyExp, we must have a CreateGraph module (InputXml). I wrote a function to perform these checks, with the error message including the module name and what is wrong.

Another important change is to create an OutputFileBase module to encapsulate operations that are common to the vtk, tecplot and fld output modules. The boundary extraction functionality was moved to this class, allowing extraction directly to .vtu/.dat.

Also, the projection to equispacedpoints was moved to this new output class (i.e. instead of defining equispaced points at InputXml, the operations are performed in the usual quadrature points and converted to equispaced only for output). This should fix some bugs related to the points distribution.

Finally we have added a new option to be able to specify the --nparts option which will partition the file into a specified number of partitions and then serially process each partition for large files. If the file_xml:xml option it will instead use the pre-partitioned mesh. This option can also be used with a parallel run since it will process nprocs partitions independently until all partitions are processsed.

This should resolve a few issues:

Closes #11 (closed)

Closes #17 (closed)

Closes #45 (closed)

Edited by Spencer Sherwin

Merge request reports