- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » statement: "redeclare function...
statement: "redeclare function extends" not working??
statement: "redeclare function extends" not working??
Hello,
I would like to redeclare and extend a replaceable partial function in my OpenModelica models as it is done for example in the Modelica Library (Fluid.Pipes.BaseClasses.WallFriction).
Should that work in OM or not?
The following code works in Dymola but My OMEdit crahses when entering the redeclare function extends part .
thanks,
Fritz
Code:
within ;
package Shell
partial package PartialPackage
replaceable partial function FunctionToBeExtendet
input Real FunctionInput;
output Real FunctionOutput;
protected
Real Variable;
end FunctionToBeExtendet;
end PartialPackage;
package FinalPackage
extends PartialPackage;
redeclare function extends FunctionToBeExtendet
algorithm
Variable:= FunctionInput*2;
FunctionOutput:= Variable;
end FunctionToBeExtendet;
end FinalPackage;
model FunctionCall
Real Value;
Real Result;
equation
Value = 2;
Result = FinalPackage.FunctionToBeExtendet(Value);
end FunctionCall;
end Shell;
Re: statement: "redeclare function extends" not working??
omc handles the code just fine. OMEdit on the other hand seems to have some issues with editing the package... (Note that I am talking about the trunk version of OMEdit; older versions may have crashed from it, new one only has trouble saving the model)
- sjoelund.se
- 1700 Posts
Re: statement: "redeclare function extends" not working??
Fritz,
I guess you are Windows user. That problem was fixed but you have to wait for the new release/nightly build.
Adeel.
- adeas
- 454 Posts
Re: statement: "redeclare function extends" not working??
No, I am on Ubuntu and wanted to load and simulate the model with the OMEdit trunk version (from Monday). Yeah, looks like there is an editing problem...OMEdit crashes while loading...I should have mentioned that before. What is now the best way to run my models until OMEdit is fixed? OMShell?
Re: statement: "redeclare function extends" not working??
Command-line omc (mos-script) is always best
As for the loading crashes... they should have been fixed in r10111
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » statement: "redeclare function...