Transport FV local operator assertions fail
Summary
There are multiple assertions executed throughout the Transport FV local operator which fail. The operator only works when compiled with the NDEBUG
flag disabling all assert
statements.
Constructor
There are two assertions in the operator constructor which cannot succeed because the corresponding grid functions are supplied via setter methods later on (see local_operator_fv.hh#L127
). Two possibilities for solving this:
-
Add grid functions as parameters of the constructor.
This solution probably reduces the flexibility of the operator. I'm not sure if the grid functions are available in our current model construction order.
-
Move assertions into the methods.
This can become a bit expensive, because the assertions are evaluated for every grid cell. However, they are completely disabled in
Release
builds, and won't cost us any performance there.
Error in the Dirichlet BC code
The assertion inside the operator*
function in this expression throws: local_operator_fv.hh#L397
.
I had a look at the variables and noticed that diff_coeff_i
is the only
vector in this entire expression. I assume there is a scalar product with another vector missing. Looking at local_operator_FV.hh#L233
, this is probably the normal vector. I'm not sure why this code works inside a Release
build. My guess would be that this code should at least produce a wrong result with an anisotropic dispersion tensor inserted.
Proposal
Could you have a look into that, @sospinar? I guess at least the first issue should be easy to solve.