Open nicholasmalaya opened 9 years ago
Let's default Tmin to numeric_limits
Otherwise, yes, I don't see any better way to do it than an assert in dbg/devel mode.
Other other thought I had was that we could define a different macro that got triggered by a configure time option. E.g. grins_assert_value_less_than()
, etc. This way, we could also enable in opt mode as well.
The more I think about it, the more I like this option.
I don't like that macro name (the "assert" still suggests "not in opt mode" to me) but I do like the idea of potentially-in-opt-mode assertions as long as they're configured off-in-opt-mode by default.
grins_value_less_than()
etc.?
For some simulations I get non-physical quantities, typically, temperatures that are way below the lowest temperature b.c. in the simulation. This is likely due to undestabilization/under-resolution. Would be nice if we could tell the simulation to die if this was detected.
After talking with Paul, it seems that the best course might be to assert T < Tmin with Tmin defaulting to 0. Would only be enabled in dbg and devel that way. The downside is this could be triggered when we're close, due to numerical error, e.g. FD Jacobians so it's like -1.0e-7 or something.
Short term, this can be accomplished by adding a libmesh_assert_less_than( T, min_value ) in HeatTransfer.C::element_time_derivative
However, I wanted to document this here to start a discussion on possible approaches.