Logic around reset_sparsity parameter to assemble_system in python is flawed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
DOLFIN |
Fix Released
|
Critical
|
Anders Logg |
Bug Description
In dolfin/
Assume that the default value for reset_sparsity is used when calling assemble_system:
def assemble_
...
...
It is first used in this line:
(A_tensor, reset_sparsity) = _create_
where it will be replaced with False. Therefore, this call fails:
(b_tensor, reset_sparsity) = _create_
because the logic that sees None and False as different values breaks down in _create_tensor.
Still in assemble_system, just below we find the lines:
# Set default value for reset_sparsity if not specified
if reset_sparsity is None:
but this can probably never be true since reset_sparsity=None will be changed to False by the _create_tensor lines.
The logic in _create_tensor should probably differentiate between matrices and other tensors. I tried to do that, but just got other errors other places so I stopped digging.
Happy hunting from Italy!
Changed in dolfin: | |
importance: | Undecided → Critical |
milestone: | none → 1.0-rc1 |
Changed in dolfin: | |
milestone: | 1.0-rc1 → 1.0-beta2 |
Changed in dolfin: | |
status: | Fix Committed → Fix Released |
I have made an attempt to fix this, but please check that it makes sense. The logic is simplified now (reset_sparsity is just passed along to C++) as I don't see why it must be tied to the use of the cache. One should be able to use the cache and reset the sparsity pattern.