Skip to content

Commit

Permalink
rewrite algebraic system in SimCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Willi Braun authored and OpenModelica-Hudson committed Oct 4, 2017
1 parent 29e8121 commit da38b3e
Show file tree
Hide file tree
Showing 5 changed files with 280 additions and 394 deletions.
27 changes: 27 additions & 0 deletions Compiler/BackEnd/BackendDump.mo
Expand Up @@ -2317,6 +2317,33 @@ algorithm
end match;
end jacobianString;

public function symJacString "dumps a string representation of a jacobian."
input tuple<Option<BackendDAE.SymbolicJacobian>, BackendDAE.SparsePattern, BackendDAE.SparseColoring> jacIn;
output String sOut;
algorithm
sOut := match(jacIn)
local
BackendDAE.BackendDAE dae;
BackendDAE.SymbolicJacobian sJac;
BackendDAE.SparsePattern sparsePattern;
BackendDAE.SparseColoring coloring;
String s;
case((SOME(sJac), sparsePattern, _))
equation
((dae,_,_,_,_)) = sJac;
s = "GENERIC JACOBIAN:\n";
dumpBackendDAE(dae,"Directional Derivatives System");
dumpSparsityPattern(sparsePattern,"Sparse Pattern");
then s;
case((NONE(), sparsePattern, _))
equation
s = "GENERIC JACOBIAN:\n";
dumpSparsityPattern(sparsePattern,"Sparse Pattern");
then s;

end match;
end symJacString;

public function dumpEqnsStr
"Helper function to dump."
input list<BackendDAE.Equation> eqns;
Expand Down
2 changes: 2 additions & 0 deletions Compiler/SimCode/SimCode.mo
Expand Up @@ -215,6 +215,8 @@ uniontype ModelInfo "Container for metadata about a Modelica model."
Integer nClocks;
Integer nSubClocks;
Boolean hasLargeLinearEquationSystems; // True if model has large linear eq. systems that are crucial for performance.
list<SimEqSystem> linearSystems;
list<SimEqSystem> nonLinearSystems;
end MODELINFO;
end ModelInfo;

Expand Down

0 comments on commit da38b3e

Please sign in to comment.