﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4845	Tearing of linear systems produces singular system out of moderately-sized, well-posed models	Francesco Casella	Andreas Heuermann	"Please consider the {{{ScalableTestSuite.Mechanical.HarmmonicOscillator.ScaledExperiments.HarmonicOscillatorNetwork_N_XX}}} test models. They require solving a linear system of N equations to compute the accelerations of the N point masses involved. For N > 40, the solver fails repeatedly with error messages like:
{{{
Failed to solve linear system of equations (no. 322) at time 0.000000. 
Residual norm is 14.0094302893603.
The default linear solver fails, the fallback solver with total pivoting
is started at time 0.000000. That might raise performance issues, for
more information use -lv LOG_LS
}}}
In fact, the outcome is particularly bad, because the solver does not abort, but keeps on trying forever. Even if the {{{Cancel simulation}}} button is pressed, the .exe file keeps on running in the background unless it is killed with the Process Manager, which is quite bad.

The debugger reveals that the linear system of size N is very effectively torn, ending up with just one tearing variable. Unfortunately, the resulting torn system is ill-conditioned for even moderate values of N.

From what I understand, the problem is that the k+1-th torn variable is given by 3 times the k-th one, plus other terms. As a consequence, the N-th torn variable is ultimately depending on 3^N^ times the tearing variable, which is obviously not going to be numerically well-posed for N much larger than 20.

The system per se is well-posed and solved without problems also for much larger sizes if tearing is switched off, and possibly a sparse solver is used for large values of N. 

Clearly, tearing is not a good idea to solve this class of systems. I think we need some mechanism to identify them and prevent (or limit) the use of tearing in such cases.. The current behaviour, i.e., get an ill-posed system and failing badly, is not acceptable.

BTW, note that I did not build this test cases specifically to cause this outcome."	defect	assigned	high		Backend				Karim Adbdelhak
