Skip to content

Add Conduction_Methods to Div_par_K_Grad_par_mod - #3452

Open
dschwoerer wants to merge 4 commits into
nextfrom
move-conduction-method
Open

Add Conduction_Methods to Div_par_K_Grad_par_mod#3452
dschwoerer wants to merge 4 commits into
nextfrom
move-conduction-method

Conversation

@dschwoerer

Copy link
Copy Markdown
Contributor

Copied from Hermes-3: boutproject/hermes-3#578

This makes it a runtime choice, using a templated function. It has currently has no options based control mechanism, so it needs to be selected by the API user, requiring changes in Hermes-3.

Copied from Hermes-3

Co-authored-by: Ben Dudson <dudson2@llnl.gov>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

Comment thread src/mesh/difops.cxx Outdated
Field3D Div_par_K_Grad_par_mod(const Field3D& Kin, const Field3D& fin, Field3D& flow_ylow,
bool bndry_flux) {
namespace bout {
enum ConductionMethod : uint8_t { Original, ProductJK, Harmonic };

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: enum 'ConductionMethod' is unscoped, use 'enum class' instead [cppcoreguidelines-use-enum-class]

enum ConductionMethod : uint8_t { Original, ProductJK, Harmonic };
     ^

Comment thread src/mesh/difops.cxx Outdated
Comment thread src/mesh/difops.cxx
Comment thread src/mesh/difops.cxx
Comment thread src/mesh/difops.cxx
} // namespace

Field3D Div_par_K_Grad_par_mod(const Field3D& Kin, const Field3D& fin, Field3D& flow_ylow,
bool bndry_flux, const std::string& method) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would prefer an enum runtime argument here, rather than passing a string and having to match strings each time. Options can do the conversion of input strings to BOUT++ enums. Remembering to omit the i in "orginal" is one reason :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants