This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Basic question: When would the Jacobian sparsity change?

0 votes

It might be a basic question, but when would the Jacobian's sparsity change?

From my understanding (physics background) it implies changing coupling between different degrees of freedom. I'm not sure when this would be the case? Even with coupled physics (e.g.: heat and mass transport) the coupling between unknown would stay the same... no?

Thanks!

asked Feb 6, 2015 by mwelland FEniCS User (8,410 points)

Hi, did you ever figure this out? I'm wondering the same and came across your question. Thanks!

Unfortunately, no...

I think I got confused. What I was interested in, in fact, what the sparsity pattern of an assembled matrix depends on. Skimming through the code I realized that it depends only on the dofs/connectivity, and not on the actual variational formulation..
Were you referring to the underlying sparsity pattern (where there can still be zeros in many places) of the matrix or the "actual" coupling of DOFs in the matrix due to the variational formulation?

It was a while ago that I asked this question, but I think it was in response to
"same_nonzero_pattern"
as a lu_solver item under

info(parameters,True)

My thought was that the sparsity pattern of the Jacobian was determined by the symbolic derivative of the weak formulation by the solution vector, which also takes into account the mesh (for connectivity purposes). As such, all the information about the DOF coupling would be known and fixed throughout the Newtonian iterations.

The other possibility that I could envision would be that the Jacobian was simply evaluated numerically and then non-zero entries identified from the numerical result. This struck me as more computationally intensive, although more robust.

What my colleague pointed out is that conditional statements and other non-linear / non-local phenomena could through a big wrench into the first option, whereas the second would be robust. Therefore it makes sense to have the option and leave it to the user to make the choice.

Hope this helps / isn't too far off!

Ok, thanks :)

...