#5835 closed defect (fixed)
Issue with NF and functions with arrays of records
| Reported by: | Francesco Casella | Owned by: | Per Östlund |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.16.0 |
| Component: | New Instantiation | Version: | |
| Keywords: | Cc: | alberto.leva@… |
Description
Please consider the attached MWE. Try to simulate the model Elements with the NF. The following error is reported:
[1] 16:42:16 Translation Error [C:/dev/OM64bit/OMCompiler/Compiler/NFFrontEnd/NFEvalFunction.mo: 389:9-390:53]: Internal error NFEvalFunction.applyReplacementCref could not find replacement for mats[i].x
Attachments (2)
Change History (9)
by , 6 years ago
| Attachment: | TestArrayRecords.mo added |
|---|
comment:1 by , 6 years ago
| Cc: | added |
|---|
by , 6 years ago
| Attachment: | TestArrayRecords.mos added |
|---|
follow-up: 3 comment:2 by , 6 years ago
follow-up: 4 comment:3 by , 6 years ago
Replying to Karim.Abdelhak:
I cannot reproduce the problem simulating attached
.mosscript. It runs fine under the current nightly, am i missing something?
I'm assuming he's using -d=evaluateAllParameters as usual. I will fix it.
comment:4 by , 6 years ago
Replying to perost:
Replying to Karim.Abdelhak:
I cannot reproduce the problem simulating attached
.mosscript. It runs fine under the current nightly, am i missing something?
I'm assuming he's using
-d=evaluateAllParametersas usual. I will fix it.
Yes that seems to be the case. Thanks!
comment:7 by , 6 years ago
For the record, I was using OMEdit v1.16.0-dev-170-g3af6123f8, and indeed I had the "Evaluate all parameters" checkbox checked.
Unless I really want to re-simulate a model with different parameters, it really makes no sense not to do it: the compilation process is faster, and the simulation process is faster and more numerically robust. Debugging could be a bit harder, because literal constants do not reveal their origin, but unless the model fails I don't really care.
Thanks @perost!

I cannot reproduce the problem simulating attached
.mosscript. It runs fine under the current nightly, am i missing something?true "" true "" true "" record SimulationResult resultFile = "/home/kab/Repo/FH/promotion/modelicaLibs/NF/TestArrayRecords.Element_res.mat", simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'TestArrayRecords.Element', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''", messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method. LOG_SUCCESS | info | The simulation finished successfully. ", timeFrontend = 0.06924037000000001, timeBackend = 0.005097715, timeSimCode = 0.001241987, timeTemplates = 0.002963645, timeCompile = 0.473782734, timeSimulation = 0.012207977, timeTotal = 0.564635768 end SimulationResult; ""