Overview
Comment:Parse switches (-A) before calling def2write_r.
Update $1_def.* instead of removing.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/merging-ode2odes-exe | trunk
Files: files | file ages | folders
SHA3-256: d1ee2bdeb32617def93d3f8bc5ccc32777318cbe3c97b9dab688303d48412c75
User & Date: geraint@users.sourceforge.net on 2001-03-19 00:29:08
Other Links: branch diff | manifest | tags
Context
2001-03-19
01:35:31
Reverted forced update check to main branch form, ready for merge. Leaf check-in: fc72557013 user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk
00:29:08
Parse switches (-A) before calling def2write_r.
Update $1_def.* instead of removing.
check-in: d1ee2bdeb3 user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk
2001-03-17
09:51:07
Implemented Runge-Kutta IV fixed-step method (-i rk4). check-in: 247243a401 user: geraint@users.sourceforge.net tags: origin/merging-ode2odes-exe, trunk
Changes

Modified mttroot/mtt/bin/trans/dae2cse_r from [14e2313fd2] to [8fd15b37a6].

11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$



## Revision 1.13  2000/10/11 08:52:46  peterg
## Creates csex (cse with dxe only) rep.
##
## Revision 1.12  2000/10/10 21:00:58  peterg
## New code genration
##
## Revision 1.11  1998/11/26 09:18:55  peterg







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (c) P.J.Gawthrop 1991, 1992, 1994.

###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.14  2000/12/28 12:24:35  peterg
## *** empty log message ***
##
## Revision 1.13  2000/10/11 08:52:46  peterg
## Creates csex (cse with dxe only) rep.
##
## Revision 1.12  2000/10/10 21:00:58  peterg
## New code genration
##
## Revision 1.11  1998/11/26 09:18:55  peterg
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89





90
91
92
93
94
95
96
## Sorted out bug when MTTNz=0
##
## Revision 1.1  1996/08/15 16:47:02  peter
## Initial revision
##
###############################################################

# Create the reduce output code
def2write_r $1 cse      
def2write_r $1 csex  # Version without E matrix
def2write_r $1 cseo

#Explicit solution option
solve=0
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
        -A )
                solve=1;;
        *)
                echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done






if [ "$solve" = "1" ]; then
    echo "Creating $1_cse.r (with explicit solution of algebraic equations)"
else
    echo "Creating $1_cse.r"
fi








<
<
<
<
<











>
>
>
>
>







70
71
72
73
74
75
76





77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
## Sorted out bug when MTTNz=0
##
## Revision 1.1  1996/08/15 16:47:02  peter
## Initial revision
##
###############################################################






#Explicit solution option
solve=0
while [ -n "`echo $1 | grep '^-'`" ]; do
  case $1 in
        -A )
                solve=1;;
        *)
                echo "$1 is an invalid argument - ignoring" ;;
  esac
  shift
done

# Create the reduce output code
def2write_r $1 cse      
def2write_r $1 csex  # Version without E matrix
def2write_r $1 cseo

if [ "$solve" = "1" ]; then
    echo "Creating $1_cse.r (with explicit solution of algebraic equations)"
else
    echo "Creating $1_cse.r"
fi

375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392






393
394
395
396
397
touch $1_cseo.r1
touch $1_cseo.r2
cat $1_cse.r1 $1_cse.r2  > $1_cse.r
cat $1_csex.r1 $1_csex.r2  > $1_csex.r
cat $1_cseo.r1 $1_cseo.r2  > $1_cseo.r

if [ "$solve" = "1" ]; then
    echo "Setting MTTNyz=0 in $1_def.r and removing other $1_def files"
    awk '{
     if ($1=="MTTNyz") 
       print "MTTNyz := 0;" 
     else print $0
    }' $1_def.r > mtt_junk
  # Make sure it preserves the time stamp!!
  # and remove dependent reps
   touch -r $1_def.r mtt_junk
   rm $1_def.*
   mv mtt_junk $1_def.r






fi


# Now invoke the standard error handling.
mtt_error_r dae2cse_r.log







|








<

>
>
>
>
>
>





378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393

394
395
396
397
398
399
400
401
402
403
404
405
touch $1_cseo.r1
touch $1_cseo.r2
cat $1_cse.r1 $1_cse.r2  > $1_cse.r
cat $1_csex.r1 $1_csex.r2  > $1_csex.r
cat $1_cseo.r1 $1_cseo.r2  > $1_cseo.r

if [ "$solve" = "1" ]; then
    echo "Setting MTTNyz=0 in $1_def.r and updating other $1_def files"
    awk '{
     if ($1=="MTTNyz") 
       print "MTTNyz := 0;" 
     else print $0
    }' $1_def.r > mtt_junk
  # Make sure it preserves the time stamp!!
  # and remove dependent reps
   touch -r $1_def.r mtt_junk

   mv mtt_junk $1_def.r
   for file in `ls $1_def.*`; do
      if [ $file != $1_def.r ]; then
          ext=`echo $file|awk -F\. '{print $2}'`
          mtt -q $1 def $ext
      fi
   done
fi


# Now invoke the standard error handling.
mtt_error_r dae2cse_r.log


MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]