Changeset 13462


Ignore:
Timestamp:
Sep 12, 2019 1:03:22 PM (3 months ago)
Author:
Christian Andersson
Message:

Added a more granular default setting for turning sparse on. Related to ticket:5666

File:
1 edited

Legend:

Unmodified
Added
Removed
  • PyFMI/branches/dev-cw-jcompression/src/pyfmi/fmi_algorithm_drivers.py

    r13428 r13462  
    474474                            self.solver_options["linear_solver"]
    475475                        except KeyError:
    476                             self.solver_options["linear_solver"] = "SPARSE"
     476                            #Need to calculate the nnz.
     477                            [derv_state_dep, derv_input_dep] = self.model.get_derivatives_dependencies()
     478                            nnz = N.sum([len(derv_state_dep[key]) for key in derv_state_dep.keys()])+fnbr
     479                            if nnz/float(fnbr*fnbr) <= 0.15:
     480                                self.solver_options["linear_solver"] = "SPARSE"
    477481                else:
    478482                    self.with_jacobian = False
Note: See TracChangeset for help on using the changeset viewer.