Skip to content

Add vars and dirs options in the gradient module to specify fields and partial derivative directions

Ankang Gao requested to merge gaoak/nektar:fix/ProcessGrad into master

Issue/feature addressed

The gradient module in the FieldConvert processes all fields and all spatial derivatives, but sometimes we only need the spatial derivatives of some fields at some directions.

Proposed solution

An option "vars" is added to specify the fields to be processed. Both the field numbers and names can also be used, such as "var=0,1,2" or "var=u,v,p". Another option "dirs" is added to specify spatial directions for derivatives. Both number and name can be used, such as "dirs=0,1" or "dirs=x,y".

Implementation

"vars" and "dirs" are set as configures options in m_config in class ProcessGrad

m_config["vars"] =
    ConfigOption(false, "NotSet", "Select variables");
m_config["dirs"] =
    ConfigOption(false, "NotSet", "Select directions");

Tests

Notes

Checklist

  • 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).

Warning

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 #295 (closed)

Edited by Chris Cantwell

Merge request reports