nutofem / nuto

NuTo - yet another finite element library
https://nuto.readthedocs.io
Boost Software License 1.0
17 stars 5 forks source link

Separate solver tolerances for each dof type #241

Open TTitscher opened 6 years ago

TTitscher commented 6 years ago

Problem

In monolithic multi-physics problems, different dof types may correspond to different dimensions. This may result in different magnitudes of the residual function. Imagine, we calculate in SI base units an one residual is in the order of 1e5 [Newton] and another one in 1e-8 [Volt]. Both differ in many orders of magnitude and should not be evaluated with the same tolerance.

Solution

One idea based on the current implementation:

or as in oldNuTo


In the end, I do not care about the details. But I think this is an essential feature.

TTitscher commented 6 years ago

As pointed out by @joergfunger, the evaluation of the residual does not help the solver to actually solve the mixed problem. So the above options are pointless and we need something like a preconditioner. Some quick ideas:

joergfunger commented 6 years ago

The above mentioned procedure (just take the norm of each individual residual) works generally well for the implicit problems with direct solvers, because they are very robust with respect to the condition number of the matrix. For iterative solvers or when using an explicit time integration scheme, we should use a preconditioner. There are many preconditioners available that differ in the complexity of their computation and the benefit with respect to the condition number of the problem, but almost all (apart from the very simple one that applies a constant scaling factor for each dof type) work on the global matrices (or some part of it), thus I would suggest to put this into into the assembler, either at the element matrix level before inserting the matrix into the global matrix or by applying this after the matrix has been assembled.