Differences From Artifact [5c2bc1e68e]:

To Artifact [a53cdeeda1]:


10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$



# Revision 1.56  1997/03/05  08:24:09  peterg
# Delete a.out after it has run.
#
# Revision 1.55  1997/02/24  19:31:10  peterg
# Removed numpar.m requirement from .m files
#
## Revision 1.54  1997/02/09 20:33:13  peterg







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
# Revision 1.57  1997/03/10  09:24:58  peterg
# a.out now deleted in the clean operation
#
# Revision 1.56  1997/03/05  08:24:09  peterg
# Delete a.out after it has run.
#
# Revision 1.55  1997/02/24  19:31:10  peterg
# Removed numpar.m requirement from .m files
#
## Revision 1.54  1997/02/09 20:33:13  peterg
292
293
294
295
296
297
298
299

300
301
302
303
304
305
306
307
308
309
310
311
312
313

314
315
316
317
318
319
320
  exit
fi

# Clean up 
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
  echo 'Removing all generated files for all systems'
  rm -f *.log  mtt_info.txt warning.txt
  rm -f *_abg.m *_abg.ps *_args.* *_cr.r *_sympar.r *_sympar.c

  rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* 
  rm -f *_sub.sh *_type.sh
  rm -f *_dae*.* *_cse.* *_ode*.c *_ode*.m *_obs.* *_rfe.* *_ss.*
  rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.*
  rm -f  *_numpar.m *_numpar.c
  rm -f mtt_error.txt mtt_info.txt a.out
  exit
fi

# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
  echo 'Removing all generated files for system ' $1
  rm -f *.log  mtt_info.txt warning.txt
  rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r $1_sympar.r $1_sympar.c

  rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* 
  rm -f $1_sub.sh $1_type.sh
  rm -f $1_dae*.* $1_cse.* $1_ode*.c $1_ode*.m $1_obs.* $1_rfe.* $1_ss.*
  rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.*
  rm -f $1_numpar.m $1_numpar.c
  rm -f mtt_error.txt mtt_info.txt a.out 
  exit







|
>













|
>







295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
  exit
fi

# Clean up 
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
  echo 'Removing all generated files for all systems'
  rm -f *.log  mtt_info.txt warning.txt
  rm -f *_abg.m *_abg.ps *_args.* *_cr.r
  rm -f *_sympar.r *_sympar.c *_sympar.txt
  rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* 
  rm -f *_sub.sh *_type.sh
  rm -f *_dae*.* *_cse.* *_ode*.c *_ode*.m *_obs.* *_rfe.* *_ss.*
  rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.*
  rm -f  *_numpar.m *_numpar.c
  rm -f mtt_error.txt mtt_info.txt a.out
  exit
fi

# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
  echo 'Removing all generated files for system ' $1
  rm -f *.log  mtt_info.txt warning.txt
  rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r 
  rm -f $1_sympar.r $1_sympar.c $1_sympar.txt
  rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* 
  rm -f $1_sub.sh $1_type.sh
  rm -f $1_dae*.* $1_cse.* $1_ode*.c $1_ode*.m $1_obs.* $1_rfe.* $1_ss.*
  rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.*
  rm -f $1_numpar.m $1_numpar.c
  rm -f mtt_error.txt mtt_info.txt a.out 
  exit
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468

469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485







































486
487
488
489
490
491
492
# Create an arg file if it doesn't exist
$1_args.m:
	touch $1_args.m

#Create empty files (with titles) if not already there
#SUMMARY lbl	label file (txt)
$1_lbl.txt:
	echo Creating $1_lbl.txt
	( \
	echo "%SUMMARY $1: <brief description here>"; \
	echo "%DESCRIPTION <Detailed description here>"; \
	echo "%% Label file for system $1 ($1_lbl.txt)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
	echo "%% Each line should be of one of the following forms:"; \
	echo "%	a comment (ie starting with %)"; \
	echo "%	Component-name	CR_name	arg1,arg2,..argn"; \
	echo "%	blank"; \
        )> $1_lbl.txt

#SUMMARY cr	constitutive relationship for each subsystem (r)
$1_cr.r: $1_sub.sh

	lbl2cr_txt2r $1

	if [ "$level" = "0" ]; then \
	  mv $1_cr.r MTT_cr.r; \
	else \
	  echo >>  MTT_cr.r; \
	  echo "%% CRs for subsystem $1" >>  MTT_cr.r; \
	  cat $1_cr.r >> MTT_cr.r; rm -f $1_cr.r; \
	fi

	sh $1_sub.sh "mtt -q -l $level+1 " ' cr r'


	if [ "$level" = "0" ]; then \
	  mv MTT_cr.r $1_cr.r; \
	  echo 'END;' >> $1_cr.r; \
	fi








































#SUMMARY simp	simplification information (r)
$1_simp.r:
	echo Creating $1_simp.r
	( \
	echo "%% Reduce comands to simplify output for system $1 ($1_simp.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \







<
<
<
<
<
<
<
<
<
<
|



>

|







|

|
|




>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







453
454
455
456
457
458
459










460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
# Create an arg file if it doesn't exist
$1_args.m:
	touch $1_args.m

#Create empty files (with titles) if not already there
#SUMMARY lbl	label file (txt)
$1_lbl.txt:










	abg2lbl_fig2txt $1

#SUMMARY cr	constitutive relationship for each subsystem (r)
$1_cr.r: $1_sub.sh
	echo Creating $1_cr.r
	lbl2cr_txt2r $1
 
	if [ "$level" = "0" ]; then \
	  mv $1_cr.r MTT_cr.r; \
	else \
	  echo >>  MTT_cr.r; \
	  echo "%% CRs for subsystem $1" >>  MTT_cr.r; \
	  cat $1_cr.r >> MTT_cr.r; rm -f $1_cr.r; \
	fi
 
	sh $1_sub.sh "mtt -q -l $level+1 " ' cr r'
 
 
	if [ "$level" = "0" ]; then \
	  mv MTT_cr.r $1_cr.r; \
	  echo 'END;' >> $1_cr.r; \
	fi

# Temporary fix - just copy everything here
# ## $1_cr.r: $1_sub.sh
# ## 	echo Creating $1_cr.r
# ## 	cat $MTTPATH/lib/cr/r/*.cr > $1_cr.r

#SUMMARY sympar	symbolic parameters (txt)
# Lbl to sympar conversion
$1_sympar.txt: $1_sub.sh
	lbl2sympar_txt2txt $1
 
	if [ "$level" = "0" ]; then \
	  mv $1_sympar.txt MTT_sympar.txt; \
	else \
	  cat $1_sympar.txt >> MTT_sympar.txt; \
	fi
 
	sh $1_sub.sh "mtt -q -l $level+1 " ' sympar txt'
 
 
	if [ "$level" = "0" ]; then \
	  sort -u MTT_sympar.txt> $1_sympar.txt; \
	fi

# ## Old version -- just looks on top level
# ## $1_sympar.r: $1_lbl.txt $1_params.r
# ## 	lbl2sympar_txt2r $1
# ## 	echo "IN \"$1_params.r\";" >> $1_sympar.r
# ## 	echo 'END;' >> $1_sympar.r

#SUMMARY sympar	symbolic parameters (r)
$1_sympar.r: $1_sympar.txt
	sympar_txt2r $1

#SUMMARY sympar	symbolic parameters (c)
# r to c sympar conversion -- its part of the ode_r2c tool
$1_sympar.c: $1_sympar.r
	sympar_r2c $1


#SUMMARY simp	simplification information (r)
$1_simp.r:
	echo Creating $1_simp.r
	( \
	echo "%% Reduce comands to simplify output for system $1 ($1_simp.r)"; \
	cat $MTTPATH/trans/m/rcs_header.txt; \
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
$1_cmp.m: $1_rbg.m
$1_fig.fig: $1_rbg.m

#Subsystem creation commands
$1_sub.sh: $1_cmp.m
	cmp2sub_m2sh $1

#SUMMARY sympar	symbolic parameters (r)
# Lbl to sympar conversion
$1_sympar.r: $1_lbl.txt $1_params.r
	lbl2sympar_txt2r $1
	echo "IN \"$1_params.r\";" >> $1_sympar.r
	echo 'END;' >> $1_sympar.r

#SUMMARY sympar	symbolic parameters (c)
# r to c sympar conversion -- its part of the ode_r2c tool
$1_sympar.c: $1_sympar.r
	sympar_r2c $1

#SUMMARY abg	acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
	sh $1_sub.sh "mtt -q -l $level+1 " ' abg m'
	rbg2abg_m $1









<
<
<
<
<
<
<
<
<
<
<
<







646
647
648
649
650
651
652












653
654
655
656
657
658
659
$1_cmp.m: $1_rbg.m
$1_fig.fig: $1_rbg.m

#Subsystem creation commands
$1_sub.sh: $1_cmp.m
	cmp2sub_m2sh $1













#SUMMARY abg	acausal bond graph (m)
#Raw bond graph to acausal bond graph: mfile
$1_abg.m: $1_rbg.m $1_sub.sh
	sh $1_sub.sh "mtt -q -l $level+1 " ' abg m'
	rbg2abg_m $1



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