Skip to content

Commit

Permalink
- Added now working simulation test Modelica.Fluid.Examples.DrumBoile…
Browse files Browse the repository at this point in the history
…r.DrumBoiler

  + Note: The correctness of the results has not been verified, but it does produce results


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@13112 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Oct 1, 2012
1 parent 9b1a4ad commit 6d62f67
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Compiler/FrontEnd/Static.mo
Original file line number Diff line number Diff line change
Expand Up @@ -11063,7 +11063,7 @@ algorithm
// print("elabCrefSubs type of: " +& id +& " is " +& Types.printTypeStr(t) +& "\n");
// Debug.traceln(" elabSucscriptsDims " +& id +& " got var");
ty = Types.simplifyType(t);
((_,hasZeroSizeDim)) = Types.traverseType((t,hasZeroSizeDim),Types.isZeroLengthArray);
hasZeroSizeDim = Types.isZeroLengthArray(ty);
sl = Types.getDimensions(t);
// Constant evaluate subscripts on form x[1,p,q] where p,q are constants or parameters
(cache,ss_1,const) = elabSubscriptsDims(cache, crefEnv, ss, sl, impl, crefPrefix, info);
Expand Down
28 changes: 21 additions & 7 deletions Compiler/FrontEnd/Types.mo
Original file line number Diff line number Diff line change
Expand Up @@ -7053,18 +7053,32 @@ algorithm
end replaceIntegerTypeWithReal;

public function isZeroLengthArray
input tuple<Type,Boolean> tpl;
output tuple<Type,Boolean> otpl;
input Type ty;
output Boolean res;
algorithm
otpl := match tpl
res := match ty
local
Type ty;
case ((ty as DAE.T_ARRAY(dims = {DAE.DIM_INTEGER(integer=0)}),_)) then ((ty,true));
case ((ty as DAE.T_ARRAY(dims = {DAE.DIM_ENUM(size=0)}),_)) then ((ty,true));
else tpl;
list<DAE.Dimension> dims;
case DAE.T_ARRAY(dims = dims)
equation
res = List.fold(dims, isZeroDim, false);
then res;
else false;
end match;
end isZeroLengthArray;

protected function isZeroDim "Check dimensions by folding and checking for zeroes"
input DAE.Dimension dim;
input Boolean acc;
output Boolean res;
algorithm
res := match (dim,acc)
case (DAE.DIM_INTEGER(integer=0),_) then true;
case (DAE.DIM_ENUM(size=0),_) then true;
else acc;
end match;
end isZeroDim;

public function variabilityToConst "translates an SCode.Variability to a DAE.Const"
input SCode.Variability variability;
output DAE.Const const;
Expand Down
31 changes: 1 addition & 30 deletions Compiler/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ USE_CORBA = @USE_CORBA@
CORBAHOME = @CORBAHOME@

PROG = omc
PROGD = omcd
PROGP = omcp

SCRIPT_FILES = openmodelica.lefty convert_lines.pl default_profiling.xsl replace-startValue.sh replace-startValue.xsl

Expand All @@ -41,7 +39,7 @@ SUBDIRS = runtime modpar

.SUFFIXES:
.SUFFIXES: .o .mo .h
.PHONY: all subdirs report vctarget debug release depend clean dclean test reallyclean omc_release omc_debug simcode builtin
.PHONY: all subdirs report vctarget debug release depend clean dclean test reallyclean omc_release simcode builtin

#all : debug
all : release
Expand All @@ -56,22 +54,12 @@ $(PROG): omc_release
echo Copying $(PROG)$(EXEEXT) into $(builddir_bin)
cp omc_release/$(PROG)$(EXEEXT) $(builddir_bin)/

$(PROGD): omc_debug
echo Copying $(PROGD)$(EXEEXT) into $(builddir_bin)
cp omc_debug/$(PROGD)$(EXEEXT) $(builddir_bin)/

$(PROGP): omc_profiler
echo Copying $(PROGP)$(EXEEXT) into $(builddir_bin)
cp omc_profiler/$(PROGP)$(EXEEXT) $(builddir_bin)/

install_scripts:
cd scripts; cp $(SCRIPT_FILES) ../$(builddir_scripts)

install: install_scripts $(PROG)
cp OpenModelicaBootstrappingHeader.h $(top_builddir)/build/include/omc/

dinstall: install_scripts $(PROGD)

nodepend:
(cd omc_release && $(MAKE))

Expand Down Expand Up @@ -112,15 +100,6 @@ clean:
-$(RM) -f $(builddir_bin)/$(PROG)$(EXEEXT)
-cd $(builddir_bin) && rm -f $(SCRIPT_FILES)

dclean:
@for d in $(SUBDIRS); do \
(cd $$d ; $(MAKE) clean) \
done
(cd omc_debug; $(MAKE) clean)
-$(RM) -f $(SRCH)
-$(RM) -f $(builddir)/$(PROGD)$(EXEEXT)
-cd $(builddir_bin) && rm -f $(SCRIPTS_FILES)

reallyclean:
@for d in $(SUBDIRS); do \
(cd $$d ; $(MAKE) reallyclean) \
Expand All @@ -129,14 +108,6 @@ reallyclean:
-$(RM) -f $(SRCH)
-$(RM) -f $(builddir)/$(PROG)$(EXEEXT)

dreallyclean:
@for d in $(SUBDIRS); do \
(cd $$d ; $(MAKE) reallyclean) \
done
(cd omc_debug; $(MAKE) reallyclean)
-$(RM) -f $(SRCH)
-$(RM) -f $(builddir)/$(PROGD)$(EXEEXT)

report:
@(cd report ; $(MAKE))

Expand Down
2 changes: 2 additions & 0 deletions Compiler/Template/CodegenC.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6501,6 +6501,8 @@ template daeExpCall(Exp call, Context context, Text &preExp /*BUFP*/, Text &varD
'(<%cref(arg.componentRef)%> != $P$PRE<%cref(arg.componentRef)%>)'
case CALL(path=IDENT(name="change"), expLst={exp}) then
error(sourceInfo(), 'Code generation does not support change(<%printExpStr(exp)%>)')
case CALL(path=IDENT(name="cardinality"), expLst={exp}) then
error(sourceInfo(), 'Code generation does not support cardinality(<%printExpStr(exp)%>). It should have been handled somewhere else in the compiler.')

case CALL(path=IDENT(name="print"), expLst={e1}) then
let var1 = daeExp(e1, context, &preExp, &varDecls)
Expand Down
8 changes: 3 additions & 5 deletions Makefile.common
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
inclu.PHONY : all omc omcd debug release mosh clean .testvariables mkbuilddirs all omc omcd debug release mosh clean qtclean qtclean-common difftool modelica3d
inclu.PHONY : all omc release mosh clean .testvariables mkbuilddirs qtclean qtclean-common difftool modelica3d

top_builddir = .
builddir_app=$(top_builddir)/build/Applications/
Expand All @@ -22,7 +22,7 @@ INSTALL_MANDIR = ${DESTDIR}${datadir}/man/
INSTALL_JAVADIR = ${DESTDIR}${datadir}/omc/java
INSTALL_LOCALEDIR = ${DESTDIR}${datadir}/locale

.PHONY : interactive omc omcd release debug qtclient mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall
.PHONY : interactive omc release qtclient mosh all mkbuilddirs fmi test install-dirs susan susan_all susgen sustst install-python install-openturns runtimeCPPinstall

mkbuilddirs:
if [ "$(EXE)" = ".app" ]; then mkdir -p $(builddir_app); fi
Expand All @@ -37,8 +37,6 @@ mkbuilddirs:
mkdir -p $(builddir_doc)/omc/testmodels
mkdir -p $(builddir_man)/man1/

debug: .testvariables mkbuilddirs settings omcd
profiler: .testvariables mkbuilddirs settings omc_profiler
release: omc

install-python:
Expand Down Expand Up @@ -187,7 +185,7 @@ clean: qtclean fmil-clean opencl_rt_clean
$(MAKE) -C 3rdParty/modelica3d/build clean || true
(rm -rf 3rdParty/modelica3d/build)
rm -rf build/share build/lib build/include build/bin/OMShell* build/bin/OMNotebook* \
build/bin/omc build/bin/omc.exe build/bin/omcd build/bin/omcd.exe build/bin/omcp build/bin/omcp.exe build/bin/omc-diff build/bin/omc-diff.exe \
build/bin/omc build/bin/omc.exe build/bin/omc-diff build/bin/omc-diff.exe \
bom-error.log bom-error.sh tab-error.log
install-dirs:
@test ! "${DESTDIR}/${prefix}" -ef "${top_builddir}/build" || (echo Error: Install and build dirs are the same && false)
Expand Down

0 comments on commit 6d62f67

Please sign in to comment.