Index: mttroot/mtt/bin/trans/make_ode2odes ================================================================== --- mttroot/mtt/bin/trans/make_ode2odes +++ mttroot/mtt/bin/trans/make_ode2odes @@ -7,10 +7,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.87 2004/08/29 01:46:56 geraint +## Added rules to create ode2odes for sorted system: sesx and sesy. +## ## Revision 1.86 2004/08/29 00:19:49 geraint ## Defaults to noAlgebraicSolver. ## ## Revision 1.85 2003/06/25 12:46:06 gawthrop ## Input only changed one per print interval @@ -373,20 +376,34 @@ ode=csex odeo=cseo algorithm="mtt_implicit(x,dx,AA,AAx,ddt,$Nx,open_switches)" ;; "dassl") - ode=ode - odeo=odeo + case "$sorted_equations" in + "make") # used by sese generated by make + ae=sae + ode=sesx + odeo=sesy + ;; + "seqn") # shouldn't be here unless mtt has changed + ode=sese + odeo=sese + ;; + "no" | *) + ode=ode + odeo=odeo + ;; + esac algorithm="mtt_dassl(x,u,t,par,dx,ddt,MTTNX,MTTNYZ,open_switches)" ;; "sorted_euler") # used by sese generated from seqn algorithm="mtt_euler(x,dx,ddt,$Nx,open_switches)" ;; "euler" | "rk4" | *) case "$sorted_equations" in "make") # used by sese generated by make + ae=sae ode=sesx odeo=sesy ;; "seqn") # shouldn't be here unless mtt has changed ode=sese @@ -544,11 +561,11 @@ #include "mtt_${algebraic_solver}.hh" #include #if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) -extern ColumnVector ${sys}_ae ( +extern ColumnVector ${sys}_${ae} ( const ColumnVector &x, const ColumnVector &u, const double &t, const ColumnVector &par); @@ -648,18 +665,18 @@ const ColumnVector &u, const double &t, const ColumnVector &par) { #if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) - return ${sys}_ae(x,u,t,par); + return ${sys}_${ae}(x,u,t,par); #elif (CODEGENTARGET == OCTAVEDLD) static octave_value_list args, f; args (0) = octave_value (x); args (1) = octave_value (u); args (2) = octave_value (t); args (3) = octave_value (par); - f = feval ("${sys}_ae", args, 1); + f = feval ("${sys}_${ae}", args, 1); return f(0).${vector_value} (); #endif // ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) } inline ColumnVector @@ -940,15 +957,15 @@ if (MTTNYZ > 0) U.insert (ui,MTTNU); #if ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) dx = ${sys}_${ode} (x,U,t,par); - yz = ${sys}_ae (x,U,t,par); + yz = ${sys}_${ae} (x,U,t,par); #elif (CODEGENTARGET == OCTAVEDLD) new_args(1) = octave_value (U); dx = feval ("${sys}_${ode}", new_args, 1)(0).${vector_value} (); - yz = feval ("${sys}_ae", new_args, 1)(0).${vector_value} (); + yz = feval ("${sys}_${ae}", new_args, 1)(0).${vector_value} (); #endif // ((CODEGENTARGET == STANDALONE) || (CODEGENTARGET == MATLABMEX)) for (register int i = 0; i < MTTNX; i++) residual (i) = dx(i) - DX(i);