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

Commit da38b3e

Browse files
Willi BraunOpenModelica-Hudson
authored andcommitted
rewrite algebraic system in SimCode
1 parent 29e8121 commit da38b3e

5 files changed

Lines changed: 280 additions & 394 deletions

File tree

Compiler/BackEnd/BackendDump.mo

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,6 +2317,33 @@ algorithm
23172317
end match;
23182318
end jacobianString;
23192319

2320+
public function symJacString "dumps a string representation of a jacobian."
2321+
input tuple<Option<BackendDAE.SymbolicJacobian>, BackendDAE.SparsePattern, BackendDAE.SparseColoring> jacIn;
2322+
output String sOut;
2323+
algorithm
2324+
sOut := match(jacIn)
2325+
local
2326+
BackendDAE.BackendDAE dae;
2327+
BackendDAE.SymbolicJacobian sJac;
2328+
BackendDAE.SparsePattern sparsePattern;
2329+
BackendDAE.SparseColoring coloring;
2330+
String s;
2331+
case((SOME(sJac), sparsePattern, _))
2332+
equation
2333+
((dae,_,_,_,_)) = sJac;
2334+
s = "GENERIC JACOBIAN:\n";
2335+
dumpBackendDAE(dae,"Directional Derivatives System");
2336+
dumpSparsityPattern(sparsePattern,"Sparse Pattern");
2337+
then s;
2338+
case((NONE(), sparsePattern, _))
2339+
equation
2340+
s = "GENERIC JACOBIAN:\n";
2341+
dumpSparsityPattern(sparsePattern,"Sparse Pattern");
2342+
then s;
2343+
2344+
end match;
2345+
end symJacString;
2346+
23202347
public function dumpEqnsStr
23212348
"Helper function to dump."
23222349
input list<BackendDAE.Equation> eqns;

Compiler/SimCode/SimCode.mo

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ uniontype ModelInfo "Container for metadata about a Modelica model."
215215
Integer nClocks;
216216
Integer nSubClocks;
217217
Boolean hasLargeLinearEquationSystems; // True if model has large linear eq. systems that are crucial for performance.
218+
list<SimEqSystem> linearSystems;
219+
list<SimEqSystem> nonLinearSystems;
218220
end MODELINFO;
219221
end ModelInfo;
220222

0 commit comments

Comments
 (0)