Describe the bug
The values dx/dy/dz are currently accepted unchecked. Passing dx = 0 produces
silent Inf/NaN propagation through the assembled operator (the 1-D
Gradient and Divergence constructors both end with *this /= dx;); passing
a negative spacing yields a sign-flipped operator with no warning.
To Reproduce
There is no input validation for the cell-spacing arguments (dx, dy, dz)
across every C++ operator constructor and AddScalarBC free function.
Expected behavior
Each spacing will now be required to be strictly positive and finite;
violations throw std::invalid_argument with a descriptive message naming
the offending parameter and value.
Screenshots
NA
Desktop (please complete the following information):
- OS: MacOS 26.5
- Browser Safari
- Version: 26.5
Smartphone (please complete the following information):
NA
Additional context
NA
Keep-open request
Reason:
Make MOLE C++ more resilient to input errors
Describe the bug
The values dx/dy/dz are currently accepted unchecked. Passing dx = 0 produces
silent Inf/NaN propagation through the assembled operator (the 1-D
Gradient and Divergence constructors both end with *this /= dx;); passing
a negative spacing yields a sign-flipped operator with no warning.
To Reproduce
There is no input validation for the cell-spacing arguments (dx, dy, dz)
across every C++ operator constructor and AddScalarBC free function.
Expected behavior
Each spacing will now be required to be strictly positive and finite;
violations throw std::invalid_argument with a descriptive message naming
the offending parameter and value.
Screenshots
NA
Desktop (please complete the following information):
Smartphone (please complete the following information):
NA
Additional context
NA
Keep-open request
keep-open.Reason:
Make MOLE C++ more resilient to input errors