Changeset 17fb906 in OpenModelica
- Timestamp:
- 2012-11-16T16:27:56+01:00 (11 years ago)
- Branches:
- Added-citation-metadata, maintenance/v1.14, maintenance/v1.15, maintenance/v1.16, maintenance/v1.17, maintenance/v1.18, maintenance/v1.19, maintenance/v1.20, maintenance/v1.21, maintenance/v1.22, maintenance/v1.23, master, omlib-staging
- Children:
- 0bb1572
- Parents:
- f52e7dca
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Compiler/BackEnd/BackendDAEUtil.mo
r945b9890 r17fb906 9151 9151 Env.Env env; 9152 9152 DAE.FunctionTree functionTree; 9153 list<BackendDAE.Equation> eqnslst;9154 9153 array<DAE.Constraint> constraints; 9155 9154 array<DAE.ClassAttributes> classAttrs; … … 9203 9202 9204 9203 // some debug prints 9205 Debug.fcall(Flags.DUMP_INITIAL_SYSTEM, print, " Initial System:\n");9204 Debug.fcall(Flags.DUMP_INITIAL_SYSTEM, print, "initial system\n"); 9206 9205 Debug.fcall(Flags.DUMP_INITIAL_SYSTEM, BackendDump.dump, initdae); 9207 9206 … … 9277 9276 output BackendDAE.EqSystem outSystem; 9278 9277 protected 9279 BackendDAE.EqSystem system;9278 BackendDAE.EqSystem system; 9280 9279 BackendDAE.IncidenceMatrix m, mt; 9281 9280 algorithm … … 9301 9300 BackendDAE.Var var; 9302 9301 DAE.ComponentRef cr, preCR; 9303 Option<DAE.Exp> startValue;9304 9302 BackendDAE.EquationArray orderedEqs "orderedEqs ; ordered Equations" ; 9305 9303 9306 9304 BackendDAE.Equation eqn; 9307 DAE.Exp e, crExp,startExp, preExp;9305 DAE.Exp startExp, preExp; 9308 9306 DAE.Type tp; 9309 9307 String crStr; … … 9335 9333 tp = BackendVariable.varType(var); 9336 9334 9337 e= Expression.crefExp(cr);9338 tp = Expression.typeof( e);9339 startExp = Expression.makeBuiltinCall("$_start", { e}, tp);9335 startExp = Expression.crefExp(cr); 9336 tp = Expression.typeof(startExp); 9337 startExp = Expression.makeBuiltinCall("$_start", {startExp}, tp); 9340 9338 9341 e= Expression.crefExp(preCR);9339 preExp = Expression.crefExp(preCR); 9342 9340 9343 eqn = BackendDAE.EQUATION(e, startExp, DAE.emptyElementSource); 9344 9341 eqn = BackendDAE.EQUATION(preExp, startExp, DAE.emptyElementSource); 9345 9342 orderedEqs = BackendEquation.equationAdd(eqn, orderedEqs); 9346 9343 … … 9376 9373 local 9377 9374 BackendDAE.EqSystem system; 9378 list<tuple<pastoptimiseDAEModule, String, Boolean>> pastOptModules;9379 tuple<StructurallySingularSystemHandlerFunc, String, stateDeselectionFunc, String> daeHandler;9380 tuple<matchingAlgorithmFunc, String> matchingAlgorithm;9381 9375 Integer nVars, nEqns; 9382 9376 BackendDAE.Variables vars; … … 9403 9397 then system; 9404 9398 9405 case (_, _)9399 else 9406 9400 then inSystem; 9407 9401 end matchcontinue; … … 9419 9413 (outSucceed, outVars, outEqns) := matchcontinue(inDAE, inVars, inEqns) 9420 9414 local 9421 BackendDAE.SymbolicJacobian jacG;9422 9415 BackendDAE.SparsePattern sparsityPattern; 9423 9416 BackendDAE.BackendDAE dae; 9424 9425 .DAE.ComponentRef cr, currRes; 9426 list< .DAE.ComponentRef> diffVars, diffedVars, currDependencies, someStates; 9427 String str; 9428 list<BackendDAE.Var> vars; // all vars 9417 list< .DAE.ComponentRef> someStates; 9429 9418 list<BackendDAE.Var> outputs; // $res1 ... $resN (initial equations) 9430 9419 list<BackendDAE.Var> states; … … 9433 9422 Integer nVars, nStates, nEqns; 9434 9423 BackendDAE.EquationArray eqns; 9435 9436 9424 list<tuple< .DAE.ComponentRef, list< .DAE.ComponentRef>>> dep; 9437 9425 … … 9531 9519 BackendDAE.Equation eqn; 9532 9520 BackendDAE.EquationArray eqns; 9533 9534 9521 DAE.Exp e, e1, crefExp, startExp; 9535 9522 DAE.ComponentRef cref; … … 9578 9565 BackendDAE.Equation eqn; 9579 9566 BackendDAE.EquationArray eqns; 9580 9581 9567 DAE.Exp e, e1, crefExp, startExp; 9582 DAE.ComponentRef cref;9583 9568 DAE.Type tp; 9584 9569 String crStr; … … 9633 9618 input BackendDAE.Variables inVars; 9634 9619 output BackendDAE.Variables outVars; 9635 algorithm 9636 outVars := match(isyst, inVars) 9637 local 9638 BackendDAE.Variables vars, ivars; 9639 case (BackendDAE.EQSYSTEM(orderedVars=vars), ivars) equation 9640 // collect vars for initial system 9641 ivars = BackendVariable.traverseBackendDAEVars(vars, collectUnfixedStates, ivars); 9642 then ivars; 9643 end match; 9620 protected 9621 BackendDAE.Variables vars; 9622 algorithm 9623 BackendDAE.EQSYSTEM(orderedVars=vars) := isyst; 9624 outVars := BackendVariable.traverseBackendDAEVars(vars, collectUnfixedStates, inVars); 9644 9625 end collectUnfixedStatesFromSystem; 9645 9626 … … 9650 9631 outTpl := matchcontinue(inTpl) 9651 9632 local 9652 BackendDAE.Var var, preVar, derVar; 9653 BackendDAE.Variables vars, fixvars; 9654 DAE.ComponentRef cr, preCR, derCR; 9655 Boolean isFixed; 9656 DAE.Type ty; 9657 DAE.InstDims arryDim; 9658 Option<DAE.Exp> startValue; 9633 BackendDAE.Var var; 9634 BackendDAE.Variables vars; 9659 9635 9660 9636 // state
Note: See TracChangeset
for help on using the changeset viewer.