Skip to content

Commit

Permalink
Remove unused code (#7365)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund committed Apr 8, 2021
1 parent 7d6513e commit 4aaf9a8
Showing 1 changed file with 0 additions and 87 deletions.
87 changes: 0 additions & 87 deletions OMCompiler/Compiler/BackEnd/BackendDAEUtil.mo
Expand Up @@ -1199,93 +1199,6 @@ end setHideResultAttribute;
Functions that deals with BackendDAE as input
********************************************/

public function generateStatePartition "function:generateStatePartition

This function traverses the equations to find out which blocks needs to
be solved by the numerical solver (Dynamic Section) and which blocks only
needs to be solved for output to file ( Accepted Section).
This is done by traversing the graph of strong components, where
equations/variable pairs correspond to nodes of the graph. The edges of
this graph are the dependencies between blocks or components.
The traversal is made in the backward direction of this graph.
The result is a split of the blocks into two lists.
inputs: (blocks: int list list,
daeLow: BackendDAE,
assignments1: int vector,
assignments2: int vector,
adjacencyMatrix: AdjacencyMatrix,
adjacencyMatrixT: AdjacencyMatrixT)
outputs: (dynamicBlocks: int list list, outputBlocks: int list list)
"
input BackendDAE.EqSystem syst;
output BackendDAE.StrongComponents outCompsStates;
output BackendDAE.StrongComponents outCompsNoStates;
algorithm
(outCompsStates,outCompsNoStates):=
matchcontinue syst
local
Integer size;
array<Integer> arr,arr_1;
BackendDAE.StrongComponents comps,blt_states,blt_no_states;
BackendDAE.Variables v;
BackendDAE.EquationArray e,se,ie;
array<Integer> ass1,ass2;
array<list<Integer>> m,mt;
case (BackendDAE.EQSYSTEM(matching=BackendDAE.MATCHING(ass1,_,comps)))
equation
size = arrayLength(ass1) "equation_size(e) => size &";
arr = arrayCreate(size, 0);
arr_1 = markStateEquations(syst, arr, ass1);
(blt_states,blt_no_states) = splitBlocks(comps, arr_1);
then
(blt_states,blt_no_states);
else
equation
print("- BackendDAEUtil.generateStatePartition failed\n");
then
fail();
end matchcontinue;
end generateStatePartition;

protected function splitBlocks "Split the blocks into two parts, one dynamic and one output, depending
on if an equation in the block is marked or not.
inputs: (blocks: int list list, marks: int array)
outputs: (dynamic: int list list, output: int list list)"
input BackendDAE.StrongComponents inComps;
input array<Integer> inIntegerArray;
output BackendDAE.StrongComponents outCompsStates;
output BackendDAE.StrongComponents outCompsNoStates;
algorithm
(outCompsStates,outCompsNoStates) := matchcontinue (inComps,inIntegerArray)
local
BackendDAE.StrongComponents comps,states,output_;
BackendDAE.StrongComponent comp;
list<Integer> eqns;
array<Integer> arr;

case ({},_) then ({},{});

case (comp::comps,arr)
equation
(eqns,_) = BackendDAETransform.getEquationAndSolvedVarIndxes(comp);
true = blockIsDynamic(eqns, arr) "block is dynamic, belong in dynamic section";
(states,output_) = splitBlocks(comps, arr);
then
((comp::states),output_);

case (comp::comps,arr)
equation
(states,output_) = splitBlocks(comps, arr) "block is not dynamic, belong in output section";
then
(states,(comp::output_));
else
equation
print("- BackendDAEUtil.splitBlocks failed\n");
then
fail();
end matchcontinue;
end splitBlocks;

public function blockIsDynamic "Return true if the block contains a variable that is marked"
input list<Integer> lst;
input array<Integer> arr;
Expand Down

0 comments on commit 4aaf9a8

Please sign in to comment.