Skip to content

Commit f0d4f62

Browse files
committed
- Some fixes to equation index of distributed systems
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@10117 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 6598124 commit f0d4f62

File tree

3 files changed

+103
-75
lines changed

3 files changed

+103
-75
lines changed

Compiler/BackEnd/BackendDAEUtil.mo

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6538,7 +6538,7 @@ algorithm
65386538
BackendDAE.DAE(systs,shared) := dae;
65396539
(systs,shared) := List.map1Fold(systs,func,a,shared);
65406540
// Filter out empty systems
6541-
// systs := List.select(systs,nonEmptySystem);
6541+
systs := filterEmptySystems(systs);
65426542
odae := BackendDAE.DAE(systs,shared);
65436543
end mapEqSystem1;
65446544

@@ -6566,7 +6566,7 @@ algorithm
65666566
BackendDAE.DAE(systs,shared) := dae;
65676567
(systs,(shared,extra)) := List.map1Fold(systs,func,a,(shared,initialExtra));
65686568
// Filter out empty systems
6569-
// systs := List.select(systs,nonEmptySystem);
6569+
systs := filterEmptySystems(systs);
65706570
odae := BackendDAE.DAE(systs,shared);
65716571
end mapEqSystemAndFold1;
65726572

@@ -6591,7 +6591,7 @@ algorithm
65916591
BackendDAE.DAE(systs,shared) := dae;
65926592
(systs,(shared,extra)) := List.mapFold(systs,func,(shared,initialExtra));
65936593
// Filter out empty systems
6594-
// systs := List.select(systs,nonEmptySystem);
6594+
systs := filterEmptySystems(systs);
65956595
odae := BackendDAE.DAE(systs,shared);
65966596
end mapEqSystemAndFold;
65976597

@@ -6615,7 +6615,7 @@ algorithm
66156615
BackendDAE.DAE(systs,shared) := dae;
66166616
extra := List.fold1(systs,func,shared,initialExtra);
66176617
// Filter out empty systems
6618-
// systs := List.select(systs,nonEmptySystem);
6618+
systs := filterEmptySystems(systs);
66196619
end foldEqSystem;
66206620

66216621
public function mapEqSystem
@@ -6636,7 +6636,7 @@ algorithm
66366636
BackendDAE.DAE(systs,shared) := dae;
66376637
(systs,shared) := List.mapFold(systs,func,shared);
66386638
// Filter out empty systems
6639-
// systs := List.select(systs,nonEmptySystem);
6639+
systs := filterEmptySystems(systs);
66406640
odae := BackendDAE.DAE(systs,shared);
66416641
end mapEqSystem;
66426642

@@ -6664,4 +6664,26 @@ algorithm
66646664
end match;
66656665
end setEqSystemMatching;
66666666

6667+
public function filterEmptySystems
6668+
"Filter out equation systems leaving at least one behind"
6669+
input BackendDAE.EqSystems systs;
6670+
output BackendDAE.EqSystems osysts;
6671+
algorithm
6672+
osysts := filterEmptySystems2(List.select(systs,nonEmptySystem),systs);
6673+
end filterEmptySystems;
6674+
6675+
protected function filterEmptySystems2
6676+
"Filter out equation systems leaving at least one behind"
6677+
input BackendDAE.EqSystems systs;
6678+
input BackendDAE.EqSystems full;
6679+
output BackendDAE.EqSystems olst;
6680+
algorithm
6681+
olst := match (systs,full)
6682+
local
6683+
BackendDAE.EqSystem syst;
6684+
case ({},syst::_) then {syst};
6685+
else systs;
6686+
end match;
6687+
end filterEmptySystems2;
6688+
66676689
end BackendDAEUtil;

Compiler/BackEnd/BackendQSS.mo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3177,7 +3177,7 @@ protected
31773177
BackendDAE.Shared shared;
31783178
algorithm
31793179
BackendDAE.DAE({syst},shared) := dlow;
3180-
out := SimCode.createEquations(false, false, false, false, false, syst, shared, comps, {});
3180+
out := SimCode.createEquations(false, false, false, false, false, syst, shared, 0, comps, {});
31813181
end generateEqFromBlt;
31823182

31833183
protected function isPositive

0 commit comments

Comments
 (0)