Skip to content

Commit

Permalink
- fix for partlintornsystem, debug dump for jacobian
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@23177 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Volker Waurich committed Nov 4, 2014
1 parent e5f4fe1 commit b8ab116
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 454 deletions.
31 changes: 31 additions & 0 deletions Compiler/BackEnd/BackendDump.mo
Expand Up @@ -2320,6 +2320,37 @@ algorithm
end match;
end jacobianTypeStr;

public function jacobianString"dumps a string representation of a jacobian.
author: Waurich TUD 2014-10"
input BackendDAE.Jacobian jacIn;
output String sOut;
algorithm
sOut := match(jacIn)
local
BackendDAE.BackendDAE dae;
BackendDAE.FullJacobian fJac;
BackendDAE.SymbolicJacobian sJac;
BackendDAE.SparsePattern sparsePattern;
BackendDAE.SparseColoring coloring;
String s;
case(BackendDAE.FULL_JACOBIAN(jacobian=fJac))
equation
s = "FULL JACOBIAN:\n";
s = s + dumpJacobianStr(fJac);
then s;
case(BackendDAE.GENERIC_JACOBIAN(jacobian=sJac))
equation
((dae,_,_,_,_)) = sJac;
s = "GENERIC JACOBIAN:\n";
dumpBackendDAE(dae,"Jacobian System");
then s;
case(BackendDAE.EMPTY_JACOBIAN())
equation
s = "EMPTY JACOBIAN:\n";
then s;
end match;
end jacobianString;

public function dumpEqnsStr
"Helper function to dump."
input list<BackendDAE.Equation> eqns;
Expand Down
10 changes: 10 additions & 0 deletions Compiler/BackEnd/BackendVariable.mo
Expand Up @@ -4669,5 +4669,15 @@ algorithm
end matchcontinue;
end isRecordVar;

public function varExp
input BackendDAE.Var var;
output DAE.Exp exp;
protected
DAE.ComponentRef cref;
algorithm
BackendDAE.VAR(varName=cref) := var;
exp := Expression.crefExp(cref);
end varExp;

annotation(__OpenModelica_Interface="backend");
end BackendVariable;

0 comments on commit b8ab116

Please sign in to comment.