#5476 closed defect (fixed)
BE tries to generate non-existent boolean attributes when disabling tearing
Reported by: | AnHeuermann | Owned by: | Karim.Abdelhak |
---|---|---|---|
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 Changed 5 years ago by Karim.Abdelhak
comment:2 Changed 4 years ago by casella
- Milestone changed from 1.14.0 to 1.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 Changed 4 years ago by AnHeuermann
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 Changed 4 years ago by AnHeuermann
- Resolution set to fixed
- Status changed from new to closed
comment:5 Changed 4 years ago by casella
- Summary changed from BE tries to generate non-existent boolean attributes when disabeling tearing to BE tries to generate non-existent boolean attributes when disabling tearing
Isn't this fixed with the implementation of minimal tearing?