Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 7a62703

Browse files
Willi BraunOpenModelica-Hudson
authored andcommitted
[BE] fixing handling seed vars of symbolic jacobians
Belonging to [master]: - #2236 - OpenModelica/OpenModelica-testsuite#861
1 parent f570c07 commit 7a62703

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

Compiler/BackEnd/Differentiate.mo

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,6 @@ algorithm
12691269
if debug then print("outCref: " + ComponentReference.printComponentRefStr(outCref) +"\n"); end if;
12701270
end createDifferentiatedCrefName;
12711271

1272-
12731272
public function createSeedCrefName
12741273
input DAE.ComponentRef inCref;
12751274
input String inMatrixName;
@@ -1278,9 +1277,6 @@ protected
12781277
list<DAE.Subscript> subs;
12791278
constant Boolean debug = false;
12801279
algorithm
1281-
/* TODO: check cref generation of seed vars with cosideration of the subscripts
1282-
with the folowing cold removeSimpleEquation eliminates to many equations.
1283-
/*
12841280
if debug then print("inCref: " + ComponentReference.printComponentRefStr(inCref) +"\n"); end if;
12851281
if debug then print("after full type " + Types.printTypeStr(ComponentReference.crefTypeConsiderSubs(inCref)) + "\n"); end if;
12861282
subs := ComponentReference.crefLastSubs(inCref);
@@ -1291,9 +1287,6 @@ algorithm
12911287
outCref := ComponentReference.crefSetLastSubs(outCref, subs);
12921288
outCref := ComponentReference.crefSetLastType(outCref, ComponentReference.crefLastType(inCref));
12931289
if debug then print("outCref: " + ComponentReference.printComponentRefStr(outCref) +"\n"); end if;
1294-
*/
1295-
outCref := ComponentReference.replaceSubsWithString(inCref);
1296-
outCref := ComponentReference.makeCrefIdent(ComponentReference.crefModelicaStr(outCref) + "Seed" + inMatrixName, ComponentReference.crefTypeConsiderSubs(inCref), {});
12971290
end createSeedCrefName;
12981291

12991292
protected function differentiateCalls

Compiler/BackEnd/RemoveSimpleEquations.mo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,11 +1744,11 @@ algorithm
17441744
end timeIndependentExpressionAcausal;
17451745

17461746
protected function toplevelInputOrUnfixed "author: Frenkel TUD 2012-12
1747-
return true is var on topliven and input or is unfixed parameter"
1747+
return true is var on topliven and input or is unfixed parameter or unreplaceable"
17481748
input BackendDAE.Var inVar;
17491749
output Boolean b;
17501750
algorithm
1751-
b := BackendVariable.isVarOnTopLevelAndInput(inVar) or
1751+
b := BackendVariable.isVarOnTopLevelAndInput(inVar) or BackendVariable.varUnreplaceable(inVar) or
17521752
BackendVariable.isParam(inVar) and not BackendVariable.varFixed(inVar);
17531753
end toplevelInputOrUnfixed;
17541754

0 commit comments

Comments
 (0)