Skip to content

New PR closes #284 regarding adding scalar boundary conditions#298

Open
Jiya-Rathi wants to merge 11 commits intomainfrom
feat/CPPaddScalarBC
Open

New PR closes #284 regarding adding scalar boundary conditions#298
Jiya-Rathi wants to merge 11 commits intomainfrom
feat/CPPaddScalarBC

Conversation

@Jiya-Rathi
Copy link
Collaborator

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Example
  • Documentation

Description

Is your feature request related to a problem? Please describe.
Closing the implementation gap of MOLE functionality between MATLAB/Octave and C++

Describe the solution you'd like
Building on @jbrzensk proposed AddScalar function C++ implementations (for multiple dimensions), we will complete the implementation using C++ functional overloading + reducing the duplication of code by creating addition functions used in the set up of non-periodic boundary conditions. In addition, extra tests have been added.

Describe alternatives you've considered
We explored the @jbrzensk original implementation and reduced code redundancy and use C++ function overloading. We are testing @jbrzensk original tests + additional functional tests. Remove some special characters from the comments that were causing issues

Additional context
For compatibility with existing tests, we will provide 3 header functions that call AddScalarBC (overloading) for the 1D, 2D, 3D cases. The tests call these header functions (i.e., AddScalarBC1D, AddScalarBC2D and AddScalarBC3D)

Related Issues & Documents

QA Instructions, Screenshots, Recordings

Build using the instructions in the README.md and then run the executable called test_addscalarbc

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Read Contributing Guide and Code of Conduct

jbrzensk and others added 9 commits January 26, 2026 16:10
…nditions

This commit pushes 3 files:  src/cpp/addscalarbc.h implementing functional overloading, src/cpp/addscalarbc.cpp added helper functions and overloading for reducing code repeatation, tests/cpp/test_addscalarbc.cpp added more tests to this to make testing more comprehensive.
@Tony-Drummond
Copy link
Collaborator

Tony-Drummond commented Mar 5, 2026

I have reviewed this work. It can be merged to main as it is but Jiya and I would like to suggest to clean the implementation further and replace the calls to addScalarBC1D, addScalarBC2D and addScalarBC3D from the examples and tests with calls to addScalarBC (C++ overloading) directly.
The current implementation of addScalarBC is called inside the functions addScalarBC1D, addScalarBC2D, and addScalarBC3D. Removing these functions, will require updating the tests and examples files.
What do others think?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Non-periodic Scalar Boundary Conditions

3 participants