Changeset 885ed59 in OpenModelica


Ignore:
Timestamp:
2021-05-18T09:24:31+02:00 (3 years ago)
Author:
Adrian Pop <adrian.pop@…>
Parents:
fd93c3ac
git-author:
Adrian Pop <adrian.pop@…> (05/17/21 21:38:10)
git-committer:
Adrian Pop <adrian.pop@…> (05/18/21 09:24:31)
Message:

scalarize only parameters arrays with size(array) > 1

  • further changes to support TransiEnt library
  • needed as the backend handles parameter arrays of one badly
  • added test: ParametricInitialArrayEquationBug.mo(s) The problematic equations come from: final parameter SI.SpecificEnergy NCV_H2[:]=TransiEnt.Basics.Functions.GasProperties.getRealGasNCVVector(medium, medium.nc) "Net calorific value of hydrogen at 25 C and 1 bar"; final parameter SI.SpecificEnergy GCV_H2[:]=TransiEnt.Basics.Functions.GasProperties.getRealGasGCVVector(medium, medium.nc) "Gross calorific value of hydrogen at 25 C and 1 bar";
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • OMCompiler/Compiler/NFFrontEnd/NFScalarize.mo

    rfdb1040 r885ed59  
    116116        // if the scalarized binding would result in an indexed call e.g. f()[1] then don't do it!
    117117        // fixes ticket #6267
    118         if ExpressionIterator.isSubscriptedArrayCall(binding_iter) then
     118        // adrpo: do not do this for arrays less than 2: see #7450
     119        //        TODO! FIXME! get rid of this absurdity when the backend
     120        //        can handle arrays of one = function call
     121        if listLength(crefs) > 1 and
     122           ExpressionIterator.isSubscriptedArrayCall(binding_iter)
     123        then
    119124          var.binding := Binding.mapExp(var.binding, expandComplexCref_traverser);
    120125          vars := var :: vars;
  • testsuite/simulation/modelica/arrays/Makefile

    r83d78e81 r885ed59  
    5757bug_2300.mos \
    5858Ticket7455.mos \
     59ParametricInitialArrayEquationBug.mos \
     60
    5961
    6062# Dependency files that are not .mo .mos or Makefile
Note: See TracChangeset for help on using the changeset viewer.