Skip to content
This repository has been archived by the owner on Oct 27, 2021. It is now read-only.

Commit

Permalink
FMUSDK 2.0.6 version
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Tirea committed Jul 30, 2018
1 parent a9ad56e commit 02745c8
Show file tree
Hide file tree
Showing 193 changed files with 30,814 additions and 0 deletions.
73 changes: 73 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
all:
(cd fmu10; $(MAKE))
(cd fmu20; $(MAKE))

clean:
(cd fmu10; $(MAKE) clean)
(cd fmu20; $(MAKE) clean)

distclean: clean
rm -f fmu10/bin/fmusim_cs* fmu10/bin/fmusim_me*
rm -f fmu20/bin/fmusim_cs* fmu20/bin/fmusim_me*
rm -rf fmu10/fmu
rm -rf fmu20/fmu
rm -rf fmuTmp*
rm -f *.csv
find . -name "*~" -exec rm {} \;
find . -name "#*~" -exec rm {} \;

run_all: run_all_fmu10 run_all_fmu20

# Run all the fmu10 fmus. Args are from run_all.bat
run_all_fmu10:
fmu10/bin/fmusim_me fmu10/fmu/me/bouncingBall.fmu 4 0.01 0 c
mv result.csv result_me10_bouncingBall.csv
fmu10/bin/fmusim_cs fmu10/fmu/cs/bouncingBall.fmu 4 0.01 0 c
mv result.csv result_cs10_bouncingBall.csv
#
fmu10/bin/fmusim_me fmu10/fmu/me/vanDerPol.fmu 5 0.1 0 c
mv result.csv result_me10_vanDerPol.csv
fmu10/bin/fmusim_cs fmu10/fmu/cs/vanDerPol.fmu 5 0.1 0 c
mv result.csv result_cs10_vanDerPol.csv
#
fmu10/bin/fmusim_me fmu10/fmu/me/dq.fmu 1 0.1 0 c
mv result.csv result_me10_dq.csv
fmu10/bin/fmusim_cs fmu10/fmu/cs/dq.fmu 1 0.1 0 c
mv result.csv result_cs10_dq.csv
#
fmu10/bin/fmusim_me fmu10/fmu/me/inc.fmu 15 0.1 0 c
mv result.csv result_me10_inc.csv
fmu10/bin/fmusim_cs fmu10/fmu/cs/inc.fmu 15 0.1 0 c
mv result.csv result_cs10_inc.csv
#
fmu10/bin/fmusim_me fmu10/fmu/me/values.fmu 12 0.1 0 c
mv result.csv result_me10_values.csv
fmu10/bin/fmusim_cs fmu10/fmu/cs/values.fmu 12 0.1 0 c
mv result.csv result_cs10_values.csv

# Run all the fmu20 fmus. Args are from run_all.bat
run_all_fmu20:
fmu20/bin/fmusim_me fmu20/fmu/me/bouncingBall.fmu 4 0.01 0 c
mv result.csv result_me20_bouncingBall.csv
fmu20/bin/fmusim_cs fmu20/fmu/cs/bouncingBall.fmu 4 0.01 0 c
mv result.csv result_cs20_bouncingBall.csv
#
fmu20/bin/fmusim_me fmu20/fmu/me/vanDerPol.fmu 5 0.1 0 c
mv result.csv result_me20_vanDerPol.csv
fmu20/bin/fmusim_cs fmu20/fmu/cs/vanDerPol.fmu 5 0.1 0 c
mv result.csv result_cs20_vanDerPol.csv
#
fmu20/bin/fmusim_me fmu20/fmu/me/dq.fmu 1 0.1 0 c
mv result.csv result_me20_dq.csv
fmu20/bin/fmusim_cs fmu20/fmu/cs/dq.fmu 1 0.1 0 c
mv result.csv result_cs20_dq.csv
#
fmu20/bin/fmusim_me fmu20/fmu/me/inc.fmu 15 0.1 0 c
mv result.csv result_me20_inc.csv
fmu20/bin/fmusim_cs fmu20/fmu/cs/inc.fmu 15 0.1 0 c
mv result.csv result_cs20_inc.csv
#
fmu20/bin/fmusim_me fmu20/fmu/me/values.fmu 12 0.1 0 c
mv result.csv result_me20_values.csv
fmu20/bin/fmusim_cs fmu20/fmu/cs/values.fmu 12 0.1 0 c
mv result.csv result_cs20_values.csv
310 changes: 310 additions & 0 deletions doc/FmuSdk_reference.html

Large diffs are not rendered by default.

Binary file added doc/bouncingBallCalc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/fmu10-xml-schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/fmus.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions doc/fmusdk_license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

FMU SDK license

Copyright � 2008-2018, QTronic GmbH. All rights reserved.
The FmuSdk is licensed by the copyright holder under the BSD License
(http://www.opensource.org/licenses/bsd-license.html):
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY QTRONIC GMBH "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL QTRONIC GMBH BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
11 changes: 11 additions & 0 deletions fmu10/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
all:
(cd src; $(MAKE))

clean:
(cd src; $(MAKE) clean)

distclean: clean
rm -f bin/fmusim_cs* bin/fmusim_me*
rm -rf fmu
find . -name "*~" -exec rm {} \;
find . -name "#*~" -exec rm {} \;
Binary file added fmu10/bin/7z.dll
Binary file not shown.
Binary file added fmu10/bin/7z.exe
Binary file not shown.
57 changes: 57 additions & 0 deletions fmu10/bin/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
7-Zip
~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

7-Zip Copyright (C) 1999-2007 Igor Pavlov.

Licenses for files are:

1) 7z.dll: GNU LGPL + unRAR restriction
2) All other files: GNU LGPL

The GNU LGPL + unRAR restriction means that you must follow both
GNU LGPL rules and unRAR restriction rules.


Note:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.


GNU LGPL information
--------------------

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA


unRAR restriction
-----------------

The decompression engine for RAR archives was developed using source
code of unRAR program.
All copyrights to original unRAR code are owned by Alexander Roshal.

The license for original unRAR code has the following restriction:

The unRAR sources cannot be used to re-create the RAR compression algorithm,
which is proprietary. Distribution of modified unRAR sources in separate form
or as a part of other software is permitted, provided that it is clearly
stated in the documentation and source comments that the code may
not be used to develop a RAR (WinRAR) compatible archiver.


--
Igor Pavlov
77 changes: 77 additions & 0 deletions fmu10/src/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# fmusim makefile for Mac OS X

EXECS = \
fmusim_cs \
fmusim_me

# Build simulators for co_simulation and model_exchange and then build the .fmu files.
all: $(EXECS)
(cd models; $(MAKE))

clean:
rm -f $(EXECS)
rm -rf *.dSYM
rm -f cosimulation/fmusim_cs/*.o
rm -f model_exchange/fmusim_me/*.o
(cd models; $(MAKE) clean)

# Sources shared between co-simulation and model exchange
SHARED_SRCS = \
shared/sim_support.c \
shared/stack.c \
shared/xml_parser.c \
shared/xmlVersionParser.c

# Dependencies for only fmusim_cs
CO_SIMULATION_DEPS = \
co_simulation/fmusim_cs/main.c \
co_simulation/fmusim_cs/fmi_cs.h \
co_simulation/include/fmiFunctions.h \
co_simulation/include/fmiPlatformTypes.h

# Dependencies for only fmusim_me
MODEL_EXCHANGE_DEPS = \
model_exchange/fmusim_me/main.c \
model_exchange/fmusim_me/fmi_me.h \
model_exchange/include/fmiModelFunctions.h \
model_exchange/include/fmiModelTypes.h

# Dependencies shared between both fmusim_cs and fmusim_me
SHARED_DEPS = \
shared/expat.h \
shared/expat_external.h \
shared/sim_support.c \
shared/sim_support.h \
shared/stack.c \
shared/stack.h \
shared/xml_parser.c \
shared/xml_parser.h \
shared/xmlVersionParser.c \
shared/xmlVersionParser.h

# Set CFLAGS to -m32 to build for linux32
#CFLAGS=-m32
# See also models/build_fmu

# Create the binaries in the current directory because co_simulation already has
# a directory named "fmusim_cs"
fmusim_cs: $(CO_SIMULATION_DEPS) $(SHARED_DEPS) ../bin/
$(CC) $(CFLAGS) -g -Wall -DFMI_COSIMULATION -DSTANDALONE_XML_PARSER \
-Ico_simulation/fmusim_cs -Ico_simulation/include \
-Ishared \
co_simulation/fmusim_cs/main.c $(SHARED_SRCS) \
-o $@ -lexpat -lxml2 -ldl
cp fmusim_cs ../bin/

fmusim_me: $(MODEL_EXCHANGE_DEPS) $(SHARED_DEPS) ../bin/
$(CC) $(CFLAGS) -g -Wall -DSTANDALONE_XML_PARSER \
-Imodel_exchange/fmusim_me -Imodel_exchange/include -Ishared \
model_exchange/fmusim_me/main.c $(SHARED_SRCS) \
-o $@ -lexpat -lxml2 -ldl
cp fmusim_me ../bin/

../bin/:
if [ ! -d ../bin ]; then \
echo "Creating ../bin/"; \
mkdir ../bin/; \
fi
27 changes: 27 additions & 0 deletions fmu10/src/build_all.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@echo off

rem ------------------------------------------------------------
rem This batch builds both simulators and all FMUs of the FmuSDK
rem Copyright QTronic GmbH. All rights reserved
rem ------------------------------------------------------------

rem First argument %1 should be empty for win32, and '-win64' for win64 build.
call build_fmusim_me %1
call build_fmusim_cs %1
echo -----------------------------------------------------------
echo Making the FMUs of the FmuSDK ...
pushd models

call build_fmu me dq %1
call build_fmu me inc %1
call build_fmu me values %1
call build_fmu me vanDerPol %1
call build_fmu me bouncingBall %1

call build_fmu cs dq %1
call build_fmu cs inc %1
call build_fmu cs values %1
call build_fmu cs vanDerPol %1
call build_fmu cs bouncingBall %1

popd
68 changes: 68 additions & 0 deletions fmu10/src/build_fmusim_cs.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
@echo off
rem ------------------------------------------------------------
rem This batch builds the FMU simulator fmusim_cs.exe
rem Copyright QTronic GmbH. All rights reserved
rem ------------------------------------------------------------

setlocal

echo -----------------------------------------------------------
echo building fmusim_cs.exe - FMI for Co-Simulation 1.0
echo -----------------------------------------------------------

rem save env variable settings
set PREV_PATH=%PATH%
if defined INCLUDE set PREV_INCLUDE=%INLUDE%
if defined LIB set PREV_LIB=%LIB%
if defined LIBPATH set PREV_LIBPATH=%LIBPATH%

if "%1"=="-win64" (set x64=x64\) else set x64=

rem setup the compiler
if defined x64 (
if not exist ..\bin\x64 mkdir ..\bin\x64
if defined VS140COMNTOOLS (call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64) else ^
if defined VS120COMNTOOLS (call "%VS120COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64) else ^
if defined VS110COMNTOOLS (call "%VS110COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64) else ^
if defined VS100COMNTOOLS (call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64) else ^
if defined VS90COMNTOOLS (call "%VS90COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64) else ^
if defined VS80COMNTOOLS (call "%VS80COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64) else ^
goto noCompiler
) else (
if defined VS140COMNTOOLS (call "%VS140COMNTOOLS%\vsvars32.bat") else ^
if defined VS120COMNTOOLS (call "%VS120COMNTOOLS%\vsvars32.bat") else ^
if defined VS110COMNTOOLS (call "%VS110COMNTOOLS%\vsvars32.bat") else ^
if defined VS100COMNTOOLS (call "%VS100COMNTOOLS%\vsvars32.bat") else ^
if defined VS90COMNTOOLS (call "%VS90COMNTOOLS%\vsvars32.bat") else ^
if defined VS80COMNTOOLS (call "%VS80COMNTOOLS%\vsvars32.bat") else ^
goto noCompiler
)

set SRC=fmusim_cs\main.c ..\shared\xmlVersionParser.c ..\shared\xml_parser.c ..\shared\stack.c ..\shared\sim_support.c
set INC=/Iinclude /I../shared /Ifmusim_cs
set OPTIONS=/DSTANDALONE_XML_PARSER /nologo /DFMI_COSIMULATION /DLIBXML_STATIC

rem create fmusim_cs.exe in the fmusim_cs dir
pushd co_simulation
cl %SRC% %INC% %OPTIONS% /Fefmusim_cs.exe /link ..\shared\%x64%libexpatMT.lib /LIBPATH:..\shared\%x64%
del *.obj
popd
if not exist co_simulation\fmusim_cs.exe goto compileError
move /Y co_simulation\fmusim_cs.exe ..\bin\%x64%
goto done

:noCompiler
echo No Microsoft Visual C compiler found

:compileError
echo build of fmusim_cs.exe failed

:done
rem undo variable settings performed by vsvars32.bat
set PATH=%PREV_PATH%
if defined PREV_INCLUDE set INCLUDE=%PREV_INLUDE%
if defined PREV_LIB set LIB=%PREV_LIB%
if defined PREV_LIBPATH set LIBPATH=%PREV_LIBPATH%
echo done.

endlocal
Loading

0 comments on commit 02745c8

Please sign in to comment.