﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5308	The NF wrongly computes cardinality when translating MultiBody model	Francesco Casella	Per Östlund	"The code to simulate [https://libraries.openmodelica.org/branches/newInst/Modelica_trunk/files/Modelica_trunk_Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel.err Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel] is generated successfully when the model is tested by Hudson, which I assume calls the {{{simulate}}} API function.

However, if I try to simulate it in OMEdit with {{{-d=newInst}}}, the following error is obtained:
{{{
[1] 14:15:49 Symbolic Error
[Modelica.Mechanics.MultiBody.Interfaces: 732:5-733:65]: Assertion triggered during translation: ""Connector frame_a of visualizer object is not connected"".
}}}
which is wrong, since the port is definitely connected to a fixed component, see [https://github.com/modelica/ModelicaStandardLibrary/blob/2da48301b8c3071158aa5ada8693767e6717ca47/Modelica/Mechanics/MultiBody/Visualizers.mo#L826 the source code].
This is the transcript of the OMEdit log:
{{{
cd(""C:/Users/Francesco Casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel"") 14:19:18:915
""C:/Users/Francesco Casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel"" 14:19:18:915
#s#; 0.001; 69.063; 'cd(""C:/Users/Francesco Casella/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel"")'

clearCommandLineOptions() 14:19:18:918
true 14:19:18:918
#s#; 0; 69.063; 'clearCommandLineOptions()'

setMatchingAlgorithm(""PFPlusExt"") 14:19:18:920
true 14:19:18:921
#s#; 0.003; 69.066; 'setMatchingAlgorithm(""PFPlusExt"")'

setIndexReductionMethod(""dynamicStateSelection"") 14:19:18:921
true 14:19:18:931
#s#; 0.01; 69.076; 'setIndexReductionMethod(""dynamicStateSelection"")'

setCommandLineOptions(""+simCodeTarget=C"") 14:19:18:931
true 14:19:18:931
#s#; 0; 69.076; 'setCommandLineOptions(""+simCodeTarget=C"")'

setCommandLineOptions(""+target=gcc"") 14:19:18:931
true 14:19:18:931
#s#; 0; 69.076; 'setCommandLineOptions(""+target=gcc"")'

setCommandLineOptions(""-d=initialization,newInst"") 14:19:18:931
true 14:19:18:931
#s#; 0; 69.076; 'setCommandLineOptions(""-d=initialization,newInst"")'

setCommandLineOptions(""+ignoreCommandLineOptionsAnnotation=false"") 14:19:18:931
true 14:19:18:931
#s#; 0; 69.076; 'setCommandLineOptions(""+ignoreCommandLineOptionsAnnotation=false"")'

setCommandLineOptions(""+ignoreSimulationFlagsAnnotation=false"") 14:19:18:931
true 14:19:18:931
#s#; 0; 69.076; 'setCommandLineOptions(""+ignoreSimulationFlagsAnnotation=false"")'

setCommandLineOptions(""+profiling=none"") 14:19:18:931
true 14:19:18:931
#s#; 0.004; 69.08; 'setCommandLineOptions(""+profiling=none"")'

setCommandLineOptions(""-d=infoXmlOperations"") 14:19:18:935
true 14:19:18:935
#s#; 0; 69.08; 'setCommandLineOptions(""-d=infoXmlOperations"")'

translateModel(Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel,startTime=0, stopTime=4, numberOfIntervals=500, method=""dassl"", tolerance=1e-06, outputFormat=""mat"", variableFilter="".*"") 14:19:18:935
false 14:19:19:166
#s#; 0.231; 69.311; 'translateModel(Modelica.Mechanics.MultiBody.Examples.Elementary.RollingWheel,startTime=0, stopTime=4, numberOfIntervals=500, method=""dassl"", tolerance=1e-06, outputFormat=""mat"", variableFilter="".*"")'

errors:=getMessagesStringInternal() 14:19:19:166
{record OpenModelica.Scripting.ErrorMessage
    info = record OpenModelica.Scripting.SourceInfo
    filename = ""C:/OpenModelica1.14.0-dev-64bit/lib/omlibrary/Modelica 3.2.2/Mechanics/MultiBody/Interfaces.mo"",
    readonly = false,
    lineStart = 732,
    columnStart = 5,
    lineEnd = 733,
    columnEnd = 65
end OpenModelica.Scripting.SourceInfo;,
    message = ""Assertion triggered during translation: \""Connector frame_a of visualizer object is not connected\""."",
    kind = .OpenModelica.Scripting.ErrorKind.symbolic,
    level = .OpenModelica.Scripting.ErrorLevel.error,
    id = 98
end OpenModelica.Scripting.ErrorMessage;} 14:19:19:173
#s#; 0.007; 69.318; 'errors:=getMessagesStringInternal()'
}}}
showing that the {{{translate}}} API is used instead. 

It seems that something goes wrong there with this cardinality-based assert."	defect	new	high	2.0.0	New Instantiation	v1.14.0-dev-nightly			Adeel Asghar
