Changeset 5dcfa802 in OpenModelica


Ignore:
Timestamp:
2021-09-21T12:29:39+02:00 (3 years ago)
Author:
phannebohm <phannebohm@…>
Parents:
e64d207a
Message:

[wip] Check if nonlinear system is too sparse

If the density of a strong component is too low (i.e. nnz < size)
then the system can only be singular since there is at leas one
row with only zeros. Either the sparse pattern has errors or the
system doens't make sense.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/SimulationRuntime/c/simulation/solver/nonlinearSystem.c

    r84ff1c7 r5dcfa802  
    397397      if(nnz/(double)(size*size)<=nonlinearSparseSolverMaxDensity || size >= nonlinearSparseSolverMinSize)
    398398      {
     399        if(nnz < size)
     400        {
     401          infoStreamPrint(LOG_STDOUT, 0, "nonlinear system %d has too low density, only %d nnz with size %d", i, nnz, size);
     402          assertStreamPrint(threadData, nnz >= size, "system singular?");
     403        }
    399404        data->simulationInfo->nlsMethod = NLS_KINSOL;
    400405        infoStreamPrint(LOG_STDOUT, 0, "Using sparse solver kinsol for nonlinear system %d,\nbecause density of %.2f remains under threshold of %.2f or size of %d exceeds threshold of %d.\nThe maximum density and the minimal system size for using sparse solvers can be specified\nusing the runtime flags '<-nlsMaxDensity=value>' and '<-nlsMinSize=value>'.", i, nnz/(double)(size*size), nonlinearSparseSolverMaxDensity, size, nonlinearSparseSolverMinSize);
Note: See TracChangeset for help on using the changeset viewer.