Overview
| Comment: | Fix for [ 547513 ] Re-written to eliminate need for installation. Single C++ file (cxxsim.cc) handles the entire transformation which is automatically compiled on invocation by "mtt sys cxxsim view". |
|---|---|
| Downloads: | Tarball | ZIP archive |
| Timelines: | family | ancestors | descendants | both | origin/master | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
7a95f8d106863fd8fe3873277f301d28 |
| User & Date: | geraint@users.sourceforge.net on 2002-12-12 16:07:13.000 |
| Other Links: | branch diff | manifest | tags |
Context
|
2002-12-12
| ||
| 17:18:43 |
Fixed [ 647664 ] Namespace clash: LANG Prepended MTT_ to SYS, OPTS and LANG environment variables. check-in: 43c2af3a70 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
| 16:07:13 |
Fix for [ 547513 ] Re-written to eliminate need for installation. Single C++ file (cxxsim.cc) handles the entire transformation which is automatically compiled on invocation by "mtt sys cxxsim view". check-in: 7a95f8d106 user: geraint@users.sourceforge.net tags: origin/master, trunk | |
| 16:00:11 | Removed cruft. check-in: 441a80070a user: geraint@users.sourceforge.net tags: origin/master, trunk | |
Changes
Added mttroot/mtt/lib/rep/cxxsim.cc version [b135fb8c74].
Modified mttroot/mtt/lib/rep/cxxsim_rep.make
from [85ea44b9b2]
to [6f40ee19ab].
1 | # -*-makefile-*- | < < < < | < < > | < | > | < < > > > | | > | < < | | | | < < | < | | | | < < < < < > > > | | | | | < > | | < > > < < < < | | < < | < < < < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < < < < < < < < < < | | | < | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# -*-makefile-*-
# usage: mtt <sys> cxxsim view
# example:
# mtt copy MotorGenerator && cd MotorGenerator && mtt MotorGenerator cxxsim view
# cxxsim creates a very simple C++ simulation without using Reduce
# it doesn't use MTT's normal .txt files so the resultant .cc must be edited
# manually to alter parameter, input and logic values
# a more intelligent version would just do ese_r2cc to create <sys>_ese.cc
# this could then be embedded into MTT's normal code like <sys>_ode.cc
# maybe another day ...
CC=g++
INCLUDE=-I. -I${MTT_LIB}/cr/hh
OPTIMISE=-O0
WARNINGS=-Wall -ansi -pedantic
all: $(SYS)_cxxsim.$(LANG)
# view rule copied from gnuplot_rep.make
# need it here to prevent MTT using the default route (via dae)
$(SYS)_cxxsim.view: $(SYS)_gnuplot.wish $(SYS)_cxxsim.exe
./$(SYS)_cxxsim.exe > $(SYS)_odes.dat2
sh $(SYS)_gnuplot.wish |\
tee gnuplot_in.log |\
gnuplot -geometry 400x300 \
> gnuplot_out.log 2> gnuplot_err.log &
$(SYS)_cxxsim.exe: $(SYS)_cxxsim.cc
echo Creating $(SYS)_cxxsim.exe
$(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE)
$(SYS)_cxxsim.cc: $(SYS)_cr.txt $(SYS)_ese.r $(SYS)_struc.txt $(SYS)_sympar.txt cxxsim
./cxxsim $(SYS)
cp $@ ..
cxxsim: ${MTT_LIB}/rep/cxxsim.cc
echo creating $@
echo Compiling $^
$(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE)
# list of constitutive relationships
$(SYS)_cr.txt:
mtt -q $(OPTS) $(SYS) cr txt
# elementary system equations
$(SYS)_ese.r:
mtt -q $(OPTS) $(SYS) ese r
# system structure
$(SYS)_struc.txt:
mtt -q $(OPTS) $(SYS) struc txt
# list of symbolic parameters
$(SYS)_sympar.txt:
mtt -q $(OPTS) $(SYS) sympar txt
# gnuplot script
$(SYS)_gnuplot.wish:
mtt -q $(OPTS) $(SYS) gnuplot wish
|