Skip to content

Commit

Permalink
- added graph coloring algorithms to utilize the sparse pattern
Browse files Browse the repository at this point in the history
   for a faster evaluation of the analytical jacobians
   - usage by solver method="dassljac"


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10958 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
Willi Braun committed Jan 25, 2012
1 parent 4189431 commit b000ddb
Show file tree
Hide file tree
Showing 18 changed files with 1,400 additions and 611 deletions.
2 changes: 2 additions & 0 deletions Compiler/BackEnd/BackendDAE.mo
Expand Up @@ -48,6 +48,8 @@ public import HashTableCG;

public constant String partialDerivativeNamePrefix="$pDER";
public constant Integer RT_CLOCK_EXECSTAT_BACKEND_MODULES=12;
public constant Integer RT_CLOCK_EXECSTAT_JACOBIANS=13;
public constant Integer RT_CLOCK_EXECSTAT_JACOBIANS_MODULES=14;

public type Type = .DAE.Type
"Once we are in BackendDAE, the Type can be only basic types or enumeration.
Expand Down
649 changes: 381 additions & 268 deletions Compiler/BackEnd/BackendDAEOptimize.mo

Large diffs are not rendered by default.

33 changes: 26 additions & 7 deletions Compiler/BackEnd/BackendDump.mo
Expand Up @@ -850,17 +850,36 @@ end dumpAlgorithms;
public function dumpSparsePattern
"function: dumpSparsePattern
author: wbraun
description: fucntion dumps sparse pattern of Jacobain System."
input list<list<Integer>> inSparsePatter;
protected
list<String> sparsepatternStr;
description: function dumps sparse pattern of a Jacobain System."
input list<list<Integer>> inSparsePatter;
algorithm
print("Print sparse pattern: \n");
sparsepatternStr := List.map6(inSparsePatter,List.toString,intString,"Sparse pattern","\n"," ","\n",false);
List.map_0(sparsepatternStr,print);
print("Print sparse pattern: " +& intString(listLength(inSparsePatter)) +& "\n");
dumpSparsePattern2(inSparsePatter, 1);
print("\n");
end dumpSparsePattern;

public function dumpSparsePattern2
"function: dumpSparsePattern
author: wbraun
description: help function to dumpSparsePattern."
input list<list<Integer>> inSparsePatter;
input Integer inInteger;
algorithm
_ := match(inSparsePatter, inInteger)
local
list<list<Integer>> rest;
list<Integer> elem;
String sparsepatternStr;
case({},inInteger) then ();
case(elem::rest,inInteger)
equation
sparsepatternStr = List.toString(elem, intString,"Row[" +& intString(inInteger) +& "] = ","{",";","}",true);
print(sparsepatternStr +& "\n");
dumpSparsePattern2(rest,inInteger+1);
then ();
end match;
end dumpSparsePattern2;

public function dumpJacobianStr
"function: dumpJacobianStr
Dumps the sparse jacobian.
Expand Down
260 changes: 133 additions & 127 deletions Compiler/BackEnd/SimCode.mo

Large diffs are not rendered by default.

0 comments on commit b000ddb

Please sign in to comment.