Opened 10 years ago

Closed 10 years ago

#2871 closed defect (fixed)

Models that work on command line and OMShell do not work in OMEdit

Reported by: Adrian Pop Owned by: Adrian Pop
Priority: high Milestone: 1.9.1
Component: Interactive Environment Version: trunk
Keywords: Cc:

Description

See:
https://openmodelica.org/forum/default-topic/1391-errors-in-omedit-examples-please-help#p5068
or email on OpenModelica mailing list.

It might be the flags that OMEdit sets or not.

Change History (6)

comment:1 by Adrian Pop, 10 years ago

Owner: changed from Adeel Asghar to Adrian Pop
Status: newaccepted

comment:2 by Adrian Pop, 10 years ago

Component: OMEditInteractive Environment

This doesn't seem to be an OMEdit problem.
As far as I can tell there is a problem with interactive graphical
API evaluation that somehow affects the translateModel command.
Probably some caching issues.

comment:3 by Adrian Pop, 10 years ago

Finally, I can reproduce this from command line after a lot of by hand copying commands from omeditcommands.log (see #2872):

When running this script on command line the compiler produces the same error as from OMEdit.

loadModel(Modelica); getErrorString();

getComponentModifierValue(Modelica.Fluid.Examples.Tanks.ThreeTanks,tank3.Hb_flow);
getParameterValue(Modelica.Fluid.Interfaces.PartialLumpedVolume,Hb_flow);
getComponentModifierValue(Modelica.Fluid.Examples.Tanks.ThreeTanks,tank3.Qb_flow);
getParameterValue(Modelica.Fluid.Interfaces.PartialLumpedVolume,Qb_flow);
getComponentModifierValue(Modelica.Fluid.Examples.Tanks.ThreeTanks,tank3.Wb_flow);
getParameterValue(Modelica.Fluid.Interfaces.PartialLumpedVolume,Wb_flow);
existClass(Modelica.Fluid.Vessels.OpenTank);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
getIconAnnotation(Modelica.Fluid.Pipes.StaticPipe);
getInheritanceCount(Modelica.Fluid.Pipes.StaticPipe);
getNthInheritedClass(Modelica.Fluid.Pipes.StaticPipe, 1);
getClassRestriction(Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe);
getIconAnnotation(Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe);
getInheritanceCount(Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe);
getNthInheritedClass(Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe, 1);
getClassRestriction(Modelica.Fluid.Interfaces.PartialTwoPort);
getIconAnnotation(Modelica.Fluid.Interfaces.PartialTwoPort);
getInheritanceCount(Modelica.Fluid.Interfaces.PartialTwoPort);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getComponents(Modelica.Fluid.Interfaces.PartialTwoPort, useQuotes = true);
getComponentAnnotations(Modelica.Fluid.Interfaces.PartialTwoPort);
isConnector(Modelica.Fluid.Interfaces.FluidPort_a);
getIconAnnotation(Modelica.Fluid.Interfaces.FluidPort_a);
getInheritanceCount(Modelica.Fluid.Interfaces.FluidPort_a);
getNthInheritedClass(Modelica.Fluid.Interfaces.FluidPort_a, 1);
isConnector(Modelica.Fluid.Interfaces.FluidPort_b);
getIconAnnotation(Modelica.Fluid.Interfaces.FluidPort_b);
getInheritanceCount(Modelica.Fluid.Interfaces.FluidPort_b);
getComponents(Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe, useQuotes = true);
getComponentAnnotations(Modelica.Fluid.Pipes.BaseClasses.PartialStraightPipe);
getComponents(Modelica.Fluid.Pipes.StaticPipe, useQuotes = true);
getComponentAnnotations(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getConnectionCount(Modelica.Icons.Example);
getConnectionCount(Modelica.Fluid.Examples.Tanks.ThreeTanks);
getNthConnection(Modelica.Fluid.Examples.Tanks.ThreeTanks, 1);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getNthConnectionAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, 1);
getNthConnection(Modelica.Fluid.Examples.Tanks.ThreeTanks, 2);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getNthConnectionAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, 2);
getNthConnection(Modelica.Fluid.Examples.Tanks.ThreeTanks, 3);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getClassRestriction(Modelica.Fluid.Vessels.OpenTank);
existClass(Modelica.Fluid.Vessels.OpenTank);
getNthConnectionAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, 3);
getNthConnection(Modelica.Fluid.Examples.Tanks.ThreeTanks, 4);
getClassRestriction(Modelica.Fluid.Vessels.OpenTank);
existClass(Modelica.Fluid.Vessels.OpenTank);
getNthConnectionAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, 4);
getNthConnection(Modelica.Fluid.Examples.Tanks.ThreeTanks, 5);
getClassRestriction(Modelica.Fluid.Pipes.StaticPipe);
existClass(Modelica.Fluid.Pipes.StaticPipe);
getClassRestriction(Modelica.Fluid.Vessels.OpenTank);
existClass(Modelica.Fluid.Vessels.OpenTank);
getNthConnectionAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, 5);
getNamedAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, preferredView);
isExperiment(Modelica.Fluid.Examples.Tanks.ThreeTanks);
getSimulationOptions(Modelica.Fluid.Examples.Tanks.ThreeTanks, defaultTolerance=0.0001);
setCommandLineOptions("+profiling=none"); getErrorString();
translateModel(Modelica.Fluid.Examples.Tanks.ThreeTanks,startTime=0, stopTime=200, numberOfIntervals=500, method="dassl", tolerance=0.0001, outputFormat="mat"); getErrorString();

And you get:

"[c:/bin/cygwin/home/adrpo/dev/OpenModelica/build/lib/omlibrary/Modelica 3.2.1/Fluid/Examples/Tanks.mo:23:7-24:16:writable] Error: Failed to elaborate expression: {Modelica.Fluid.Vessels.BaseClasses.VesselPortsData(diameter = 0.1)}.
Error: Error occurred while flattening model Modelica.Fluid.Examples.Tanks.ThreeTanks

comment:4 by Adrian Pop, 10 years ago

Even way smaller script to reproduce the problem:

loadModel(Modelica); getErrorString();
getNthConnectionAnnotation(Modelica.Fluid.Examples.Tanks.ThreeTanks, 5);
translateModel(Modelica.Fluid.Examples.Tanks.ThreeTanks,startTime=0, stopTime=200, numberOfIntervals=500, method="dassl", tolerance=0.0001, outputFormat="mat"); getErrorString();

Now let's actually debug this issue and find out where is the cache or inst cache or the graph not reinitialized correctly.

comment:5 by Adrian Pop, 10 years ago

Fixed in r22663.

comment:6 by Adrian Pop, 10 years ago

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.