This branch adds VTK support to the Python bindings, which necessitates adjustment of
FieldUtils modules. A
Filter wrapper is also added as a method to demonstrate and test the additions.
Following from !1343 (merged), a function
GetVtkGrid has been added to the Python wrapper for
Module. This then allows the VTK grid to be returned when the module object is a
OutputVtk module. An exception is thrown if either not compiled for VTK or the module is not an instance of
For the VTK output:
prohibitWriteoption has been added to the OutputModule class. This indicates that files should not be written out, but that any processing up to the point of writing should be done. This is done so that Python modules can control when output occurs when calling the
Runfunction after a module.
ConvertCommandLinefunction, used in several places in the Python wrappers, has been refactored into a helper
CppCommandLineclass. This also ensures memory cleanup is done from the C pointers for
VTK_PYTHON_CONVERSIONmacro has been adapted from the VTK documentation to enable the wrapping of vtk objects within boost.python. This is defined in the
Fieldclass has a new function
SetupFromExpListwhich facilitates easier construction of Field objects programatically from both Python and C++.
- Filter wrapper has been added in a way such that filters can be defined in Python as a subclass, and registered with the C++ factory. This follows the same approach used in
- Minimal wrappers have been added for
EquationSystem, since this is passed as a
- To get
weak_ptrto work with boost.python, a block of code has been added in
NekPyConfig.hpp: this adjusts the mechanism which uses
shared_ptr<void>with customer deleter, since this doesn't then allow for conversion from
FilterPythonhas been added which serves as a way to usefully use the Filter wrappers. This is documented in the user guide.
- Unit tests have been added for the new
FilterPythontest has been added to ADRSolver, which uses the
FieldUtilswrapper and the
Filterwrapper to write VTK files as checkpoints.
- A demo for reading a mesh and creating an image using the VTK Python bindings has been included.
Functions and classes, or changes to them, are documented.
User guide/documentation is updated.
Changelog is updated.
Suitable tests added for new functionality.
Contributed code is correctly formatted. (See the contributing guidelines).
License added to any new files.
No extraneous files have been added (e.g. compiler output or test data files).
On the 19.07 the code formatting (code style) was standardised using clang-format, over the whole Nektar++ code. This means changes in your branch will conflict with formatting changes on the
master branch. To resolve these conflicts , see