Opened 5 years ago

Closed 5 years ago

#5534 closed defect (fixed)

NF fails checkModel on an otherwise sane model

Reported by: Francesco Casella Owned by: Per Östlund
Priority: blocker Milestone: 1.14.0
Component: New Instantiation Version:
Keywords: Cc: Andrea Bartolini, buchner@…

Description

Please load the attached package in OMEdit and open TestFlexiblePipeRCFilling. With -d=newInst the model is correctly instantiated and simulated. However, when checking the model, I get this error:

[1] 10:55:16 Translation Error
Internal error Instantiation of NewFEbug.TestFlexiblePipeRCFilling 
failed with no error message.

Attachments (2)

NewFEbug.mo (9.7 KB ) - added by Francesco Casella 5 years ago.
NewFEbug1.mo (10.9 KB ) - added by Andrea Bartolini 5 years ago.

Download all attachments as: .zip

Change History (12)

by Francesco Casella, 5 years ago

Attachment: NewFEbug.mo added

comment:1 by Francesco Casella, 5 years ago

Component: *unknown*New Instantiation
Owner: changed from somebody to Per Östlund

comment:2 by Per Östlund, 5 years ago

Resolution: fixed
Status: newclosed

Fixed in 98e4980.

The issue was a previous change made to fix issues with the unit checking, by not evaluating as much of the model when doing checkModel. This caused scalarization issues with some start attributes in the given model, so I changed it so that we always evaluate structural parameters in type attributes.

Maybe there's some better way of handling it to avoid such evaluation, but this was just a one line fix so we can easily change it later if needed.

Last edited 5 years ago by Per Östlund (previous) (diff)

comment:3 by Francesco Casella, 5 years ago

Cc: Andrea Bartolini added

Thank you Per!

comment:4 by Andrea Bartolini, 5 years ago

Thanks a lot Per !!

comment:5 by Andrea Bartolini, 5 years ago

Resolution: fixed
Status: closedreopened

The issue is back...

Please load the attached package NewFEbug1.mo in OMEdit (it includes a new version of the previous attached model of flexible pipe) and open again TestFlexiblePipeRCFilling.
With -d=newInst the model is correctly instantiated and simulated. However, when checking the model, I get again this error:

[1] 16:58:49 Translation Error
Internal error Instantiation of NewFEbug1.TestFlexiblePipeRCFilling failed
with no error message.

OMEdit - OpenModelica Connection Editor
Connected to OpenModelica 1.14.0~dev-26610-gea7fc62
Sysop Ubuntu 1604

by Andrea Bartolini, 5 years ago

Attachment: NewFEbug1.mo added

comment:6 by Per Östlund, 5 years ago

The issue with the new model is the same as before, the workaround of not evaluating most structural parameters to make the unit checking work is causing issues since some structural parameters that really need to be evaluated aren't.

I want to fix this properly, which means rewriting the unit checking to use the NF data structures so that we can do unit checking earlier and get rid of these workarounds. It's not that much work really, I've already rewritten about half of it by now. Unfortunately it doesn't look like I'll be able to finish it today though, and I'll be on vacation for the next month.

A possible workaround if you want to check the model right now is to change the parameter FlexiblePipeRC.N to a constant, to make sure it's evaluated even when using checkModel (adding annotation(Evaluate = true) is not enough).

comment:7 by Andrea Bartolini, 5 years ago

Thanks Per,
I'll use the workaround till you complete the new unit checking.
Don't worry about the schedule... have a good vacation :)

comment:8 by Christoph Buchner <buchner@…>, 5 years ago

Cc: buchner@… added

comment:9 by Per Östlund, 5 years ago

The new unit checking has now been implemented in 1b470a5, and the NF now does unit checking before the constant evaluation module is called. There is thus no longer any need for the workaround for checkModel in the constant evaluation, so this issue should no longer occur.

comment:10 by Andrea Bartolini, 5 years ago

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