Opened 6 years ago

Closed 5 years ago

Last modified 5 years ago

#5476 closed defect (fixed)

BE tries to generate non-existent boolean attributes when disabling tearing

Reported by: Andreas Heuermann Owned by: Karim Adbdelhak
Priority: high Milestone: 1.16.0
Component: Backend Version: v1.14.0-dev-nightly
Keywords: Boolean attributes tearing noTearing Cc:

Description

When tearing is disabled, the backend generates code that assumes boolean variables have attributes like min, max or nominal.

Steps to reproduce:
Disabeling tearing with --tearingMethod=noTearing and simulate a model with booleans, like Modelica.Electrical.Analog.Examples.Rectifier

Error message:

gcc  -Os -falign-functions -fno-ipa-pure-const -mstackrealign -msse2 -mfpmath=sse     -I"d:/workspace/OpenModelica/build/include/omc/c" -I. -DOPENMODELICA_XML_FROM_FILE_AT_RUNTIME -DOMC_MODEL_PREFIX=Modelica_Electrical_Analog_Examples_Rectifier -DOMC_NUM_MIXED_SYSTEMS=0 -DOMC_NUM_LINEAR_SYSTEMS=2 -DOMC_NUM_NONLINEAR_SYSTEMS=6 -DOMC_NDELAY_EXPRESSIONS=0 -DOMC_NVAR_STRING=0  -c -o Modelica.Electrical.Analog.Examples.Rectifier_04set.o Modelica.Electrical.Analog.Examples.Rectifier_04set.c
Modelica.Electrical.Analog.Examples.Rectifier_02nls.c: In function 'initializeStaticDataNLS145':
Modelica.Electrical.Analog.Examples.Rectifier_02nls.c:109:92: error: 'BOOLEAN_ATTRIBUTE {aka struct BOOLEAN_ATTRIBUTE}' has no member named 'nominal'
   sysData->nominal[i] = data->modelData->booleanVarsData[0].attribute /* IdealDiode1.off */.nominal;
                                                                                            ^
Modelica.Electrical.Analog.Examples.Rectifier_02nls.c:110:92: error: 'BOOLEAN_ATTRIBUTE {aka struct BOOLEAN_ATTRIBUTE}' has no member named 'min'
   sysData->min[i]     = data->modelData->booleanVarsData[0].attribute /* IdealDiode1.off */.min;
                                                                                            ^
Modelica.Electrical.Analog.Examples.Rectifier_02nls.c:111:92: error: 'BOOLEAN_ATTRIBUTE {aka struct BOOLEAN_ATTRIBUTE}' has no member named 'max'
   sysData->max[i++]   = data->modelData->booleanVarsData[0].attribute /* IdealDiode1.off */.max;
                                                                                            ^

Change History (5)

comment:1 by Karim Adbdelhak, 5 years ago

Isn't this fixed with the implementation of minimal tearing?

comment:2 by Francesco Casella, 5 years ago

Milestone: 1.14.01.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:3 by Andreas Heuermann, 5 years ago

Yes, when using --tearingMethod=minimalTearing the model will compile and simulate.

We have to add a message to --tearingMethod=noTearing, that it's deprecated.

comment:4 by Andreas Heuermann, 5 years ago

Resolution: fixed
Status: newclosed

comment:5 by Francesco Casella, 5 years ago

Summary: BE tries to generate non-existent boolean attributes when disabeling tearingBE tries to generate non-existent boolean attributes when disabling tearing
Note: See TracTickets for help on using tickets.