Index: mttroot/mtt/bin/trans/mtt_header ================================================================== --- mttroot/mtt/bin/trans/mtt_header +++ mttroot/mtt/bin/trans/mtt_header @@ -10,10 +10,13 @@ ############################################################### ## Version control history ############################################################### ## $Id$ ## $Log$ +## Revision 1.67 2005/11/16 00:43:15 geraint +## rtxi +## ## Revision 1.66 2005/02/17 18:54:23 geraint ## Fixed a bash-sim: replaced let with $(( )) ## ## Revision 1.65 2004/08/29 13:14:29 geraint ## Added rule to make header for sae (sorted algebraic equations). @@ -264,11 +267,11 @@ ## Revision 1.3 2000/10/11 08:59:15 peterg ## Added csex rep ## ## Revision 1.2 2000/10/11 08:01:42 peterg ## Added noglobal fudge -## + ## ## Revision 1.1 2000/10/10 21:02:27 peterg ## Initial revision ## ############################################################### @@ -384,13 +387,13 @@ ;; ode) states=yes; inputs=yes; parameters=yes; - output='mttdx' + output='mttdx,mtty' args=$eqnargs - zeromatrices='dx' + zeromatrices='dx y' ;; odeo) states=yes; inputs=yes; parameters=yes; @@ -914,11 +917,14 @@ } write_cc_header () { - get_arg_specific_stuff ${output} + first_output=`get_field ${output:-""} 1` + get_arg_specific_stuff ${first_output} + # Should multiple vector outputs be returned as a single matrix? + cat < #include "useful-functions.hh" #include "${system}_cr.h" @@ -951,26 +957,39 @@ w=`get_field ${args} ${i}` get_arg_specific_stuff ${w} printf "\tconst ${arg_type}\t&${w}${comma}\n" done fi - get_arg_specific_stuff ${output} cat <"} args=${2:-""} cat < ${OUT} + echo "" >> ${OUT} + echo "#ifndef HAVE_${SYS}_DEF_H" >> ${OUT} + echo "#define HAVE_${SYS}_DEF_H" >> ${OUT} echo "" >> ${OUT} echo "const int MTTNU = `cat ${IN} | get_array_size nu`;" >> ${OUT} echo "const int MTTNX = `cat ${IN} | get_array_size nx`;" >> ${OUT} echo "const int MTTNY = `cat ${IN} | get_array_size ny`;" >> ${OUT} echo "const int MTTNZ = `cat ${IN} | get_array_size nz`;" >> ${OUT} echo "const int MTTNYZ = `cat ${IN} | get_array_size nyz`;" >> ${OUT} echo "const int MTTNPAR = `wc -l ${SYM} | gawk '{ print $1 }'`;" >> ${OUT} echo "" >> ${OUT} - echo "int mttnu, mttnx, mttny, mttnyz, mttnz;" >> ${OUT} + echo "static int mttnu, mttnx, mttny, mttnyz, mttnz;" >> ${OUT} + echo "" >> ${OUT} + echo "#endif" >> ${OUT}