Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
RuedKamp committed Sep 29, 2015
2 parents c181c4a + ed9ce6f commit 5d714dc
Show file tree
Hide file tree
Showing 92 changed files with 771 additions and 620 deletions.
1 change: 1 addition & 0 deletions Compiler/BackEnd/Initialization.mo
Expand Up @@ -2344,6 +2344,7 @@ algorithm
end match;
end for;
shared.removedEqs := BackendEquation.listEquation(listReverse(removedEqsList));
shared.initialEqs := BackendEquation.emptyEqns();
outDAE.shared := shared;
end removeInitializationStuff;

Expand Down
172 changes: 80 additions & 92 deletions Compiler/Template/CodegenCpp.tpl

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Compiler/Template/CodegenCppCommon.tpl
Expand Up @@ -2715,10 +2715,10 @@ case STMT_TUPLE_ASSIGN(exp=CALL(__)) then
let crefs = (expExpLst |> e => ExpressionDump.printExpStr(e) ;separator=", ")
let marker = '(<%crefs%>) = <%ExpressionDump.printExpStr(exp)%>'
let retStruct = daeExp(exp, context, &preExp /*BUFC*/, &varDecls /*BUFD*/, simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
//previous multi_array let rhsStr = 'boost::get<<%i1%>>(<%retStruct%>.data)'
//previous multi_array let rhsStr = 'get<<%i1%>>(<%retStruct%>.data)'

let lhsCrefs = (expExpLst |> cr hasindex i1 fromindex 0 =>
let rhsStr = 'boost::get<<%i1%>>(<%retStruct%>.data)'
let rhsStr = 'get<<%i1%>>(<%retStruct%>.data)'
writeLhsCref(cr, rhsStr, context, &afterExp, &varDecls, simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
;separator="\n";empty)
<<
Expand Down Expand Up @@ -2919,7 +2919,7 @@ template daeExpTsub(Exp inExp, Context context, Text &preExp,
match inExp
case TSUB(ix=1) then
let tuple_val = daeExp(exp, context, &preExp, &varDecls, simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
'boost::get<0>(<%tuple_val%>.data)'
'get<0>(<%tuple_val%>.data)'
//case TSUB(exp=CALL(attr=CALL_ATTR(ty=T_TUPLE(types=tys)))) then
case TSUB(exp=CALL(path=p,attr=CALL_ATTR(ty=tys as T_TUPLE(__)))) then
//let v = tempDecl(expTypeArrayIf(listGet(tys,ix)), &varDecls)
Expand All @@ -2928,7 +2928,7 @@ template daeExpTsub(Exp inExp, Context context, Text &preExp,
let retVar = tempDecl(retType, &varDecls)
let res = daeExpCallTuple(exp,retVar, context, &preExp, &varDecls, simCode , &extraFuncs , &extraFuncsDecl, extraFuncsNamespace, stateDerVectorName, useFlatArrayNotation)
let &preExp += '<%res%>;<%\n%>'
'boost::get<<%intAdd(-1,ix)%>>(<%retVar%>.data)'
'get<<%intAdd(-1,ix)%>>(<%retVar%>.data)'

case TSUB(__) then
error(sourceInfo(), '<%printExpStr(inExp)%>: TSUB only makes sense if the subscripted expression is a function call of tuple type')
Expand Down
25 changes: 16 additions & 9 deletions Compiler/Template/CodegenCppHpcom.tpl
Expand Up @@ -121,8 +121,6 @@ template additionalHpcomIncludesForParallelCode(SimCode simCode, Text& extraFunc
case ("pthreads")
case ("pthreads_spin") then
<<
#include <boost/thread.hpp>
#include <Core/Utils/extension/busywaiting_barrier.hpp>
>>
case ("tbb") then
<<
Expand Down Expand Up @@ -174,8 +172,17 @@ template additionalHpcomProtectedMemberDeclaration(SimCode simCode, Text& extraF
>>
else
<<
boost::hash<std::string> string_hash;
return (long unsigned int)string_hash(boost::lexical_cast<std::string>(boost::this_thread::get_id()));
#if defined(USE_THREAD)
#if defined(USE_CPP_ELEVEN)
boost::hash<std::string> string_hash;
return (long unsigned int)string_hash(boost::lexical_cast<std::string>(std::this_thread::get_id()));
#else
boost::hash<std::string> string_hash;
return (long unsigned int)string_hash(boost::lexical_cast<std::string>(boost::this_thread::get_id()));
#endif
#else
return 0;
#endif
>>
end match %>
}
Expand Down Expand Up @@ -213,8 +220,8 @@ template generateAdditionalStructHeaders(Schedule odeSchedule)
<<
//Required for Intel TBB
struct VoidFunctionBody {
boost::function<void(void)> void_function;
VoidFunctionBody(boost::function<void(void)> void_function) : void_function(void_function) { }
function<void(void)> void_function;
VoidFunctionBody(function<void(void)> void_function) : void_function(void_function) { }
FORCE_INLINE void operator()( tbb::flow::continue_msg ) const
{
void_function();
Expand Down Expand Up @@ -397,7 +404,7 @@ template generateThreadHeaderDecl(Integer threadIdx, String iType)
>>
else
<<
boost::thread* evaluateThread<%threadIdx%>;
thread* evaluateThread<%threadIdx%>;
>>
end match
end generateThreadHeaderDecl;
Expand Down Expand Up @@ -1377,7 +1384,7 @@ template generateTbbConstructorExtensionNodesAndEdges(tuple<Task,list<Integer>>
let parentEdges = parents |> p => 'tbb::flow::make_edge(*(_tbbNodeList_<%funcSuffix%>.at(<%intSub(p,1)%>)),*(_tbbNodeList_<%funcSuffix%>.at(<%taskIndex%>)));'; separator = "\n"
let startNodeEdge = if intEq(0, listLength(parents)) then 'tbb::flow::make_edge(_tbbStartNode,*(_tbbNodeList_<%funcSuffix%>.at(<%taskIndex%>)));' else ""
<<
tbb_task = new tbb::flow::continue_node<tbb::flow::continue_msg>(_tbbGraph,VoidFunctionBody(boost::bind<void>(&<%modelNamePrefixStr%>::task_func_<%funcSuffix%>_<%task.index%>,this)));
tbb_task = new tbb::flow::continue_node<tbb::flow::continue_msg>(_tbbGraph,VoidFunctionBody(bind<void>(&<%modelNamePrefixStr%>::task_func_<%funcSuffix%>_<%task.index%>,this)));
_tbbNodeList_<%funcSuffix%>.at(<%taskIndex%>) = tbb_task;
<%parentEdges%>
<%startNodeEdge%>
Expand Down Expand Up @@ -1719,7 +1726,7 @@ template generateThread(Integer threadIdx, String iType, String modelNamePrefixS
>>
else
<<
evaluateThread<%threadIdx%> = new boost::thread(boost::bind(&<%modelNamePrefixStr%>::<%funcName%><%threadIdx%>, this));
evaluateThread<%threadIdx%> = new thread(bind(&<%modelNamePrefixStr%>::<%funcName%><%threadIdx%>, this));
>>
end match
end generateThread;
Expand Down
14 changes: 7 additions & 7 deletions Compiler/Template/CodegenFMUCpp.tpl
Expand Up @@ -149,7 +149,7 @@ case SIMCODE(modelInfo=MODELINFO(__),simulationSettingsOpt = SOME(settings as SI
// Dummy code for FMU that writes no output file
class <%lastIdentOfPath(modelInfo.name)%>WriteOutput {
public:
<%lastIdentOfPath(modelInfo.name)%>WriteOutput(IGlobalSettings* globalSettings, boost::shared_ptr<IAlgLoopSolverFactory> nonLinSolverFactory, boost::shared_ptr<ISimData> simData, boost::shared_ptr<ISimVars> simVars) {}
<%lastIdentOfPath(modelInfo.name)%>WriteOutput(IGlobalSettings* globalSettings, shared_ptr<IAlgLoopSolverFactory> nonLinSolverFactory, shared_ptr<ISimData> simData, shared_ptr<ISimVars> simVars) {}
virtual ~<%lastIdentOfPath(modelInfo.name)%>WriteOutput() {}

virtual void writeOutput(const IWriteOutput::OUTPUT command = IWriteOutput::UNDEF_OUTPUT) {}
Expand Down Expand Up @@ -209,9 +209,9 @@ case SIMCODE(modelInfo=MODELINFO(__)) then
// constructor
<%modelShortName%>FMU(IGlobalSettings* globalSettings,
boost::shared_ptr<IAlgLoopSolverFactory> nonLinSolverFactory,
boost::shared_ptr<ISimData> simData,
boost::shared_ptr<ISimVars> simVars);
shared_ptr<IAlgLoopSolverFactory> nonLinSolverFactory,
shared_ptr<ISimData> simData,
shared_ptr<ISimVars> simVars);
// initialization
virtual void initialize();
Expand Down Expand Up @@ -269,9 +269,9 @@ case SIMCODE(modelInfo=MODELINFO(__)) then

// constructor
<%modelShortName%>FMU::<%modelShortName%>FMU(IGlobalSettings* globalSettings,
boost::shared_ptr<IAlgLoopSolverFactory> nonLinSolverFactory,
boost::shared_ptr<ISimData> simData,
boost::shared_ptr<ISimVars> simVars):
shared_ptr<IAlgLoopSolverFactory> nonLinSolverFactory,
shared_ptr<ISimData> simData,
shared_ptr<ISimVars> simVars):
<%modelShortName%>(globalSettings, nonLinSolverFactory, simData, simVars),
<%modelShortName%>Extension(globalSettings, nonLinSolverFactory, simData, simVars) {
}
Expand Down
78 changes: 64 additions & 14 deletions SimulationRuntime/cpp/CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@
#
# The following conditional defines are passed to the c++ compiler:
# if the Boost_log and Boost_setup_log libraries were found -DUSE_BOOST_LOG
# if the Boost_thread library was found -DUSE_BOOST_THREAD
# if the Boost_thread library was found or C++ 11 is available -DUSE_THREAD
# if the UMFPack library of SuiteSparse was found -DUSE_UMFPACK
# if the PAPI library was found -DUSE_PAPI
# if the Sundials libraries were found -DPMC_USE_SUNDIALS
Expand All @@ -16,18 +16,20 @@
# if the logger should be used -DUSE_LOGGER
#
# Some of these options can be controlled by passing arguments to CMAKE
# if write output should be handled in parallel -DUSE_PARALLEL_OUTPUT=ON
# if ScoreP should be used for performance analysis -DUSE_SCOREP=ON
# if the boost libraries should be linked statically -DBOOST_STATIC_LINKING=ON
# if boost libraries should be linked against absolute path libraries -DUSE_BOOST_REALPATHS=ON
# if write output should be handled in parallel -DUSE_PARALLEL_OUTPUT=ON [default: OFF]
# if ScoreP should be used for performance analysis -DUSE_SCOREP=ON [default: OFF]
# if the boost libraries should be linked statically -DBOOST_STATIC_LINKING=ON [default: OFF]
# if boost libraries should be linked against absolute path libraries -DUSE_BOOST_REALPATHS=ON [default: OFF]
# disable c++11, even if the compiler is able to use it -DUSE_CPP_ELEVEN=OFF [default: ON]
# if the equation systems of a FMU should be solved with sundials solvers -DFMU_SUNDIALS=ON [default: OFF]
#
# Example: "cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo" to create statically linked libraries
#
# The used defines are stored in the SYSTEM_CFLAGS variable, which is passed to the ModelicaConfig.inc and written in the PrecompiledHeader.cmake

CMAKE_MINIMUM_REQUIRED (VERSION 2.8.6)
PROJECT(CppSolverInterface)
set(CMAKE_VERBOSE_MAKEFILE ON)
SET(CMAKE_VERBOSE_MAKEFILE ON)
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")

MESSAGE(STATUS "CMake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}")
Expand All @@ -36,9 +38,11 @@ MESSAGE(STATUS "CMake version ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CM
OPTION(USE_PARALLEL_OUTPUT "USE_PARALLEL_OUTPUT" OFF)
OPTION(USE_SCOREP "USE_SCOREP" OFF)
OPTION(BOOST_STATIC_LINKING "BOOST_STATIC_LINKING" OFF)
OPTION(USE_BOOST_REALPATHS "USE_BOOST_REALPATHS" OFF)
OPTION(RUNTIME_PROFILING "RUNTIME_PROFILING" OFF)
OPTION(FMU_SUNDIALS "FMU_SUNDIALS" OFF)
OPTION(SUNDIALS_ROOT "SUNDIALS ROOT" "")
OPTION(USE_CPP_ELEVEN "USE_CPP_ELEVEN" ON)

#Set Variables
SET(MODELICAEXTERNALCDIR "${CMAKE_SOURCE_DIR}/../../3rdParty/ModelicaExternalC/C-Sources")
Expand Down Expand Up @@ -94,6 +98,47 @@ ENDIF(USE_BOOST_REALPATHS)

INCLUDE(${CMAKE_SOURCE_DIR}/PrecompiledHeader.cmake)

# Check C++11
IF(USE_CPP_ELEVEN)
IF(MSVC)
IF(MSVC_VERSION GREATER 1700)
SET(COMPILER_SUPPORTS_CXX11 True)
ELSE(MSVC_VERSION GREATER 1700)
SET(COMPILER_SUPPORTS_CXX11 False)
ENDIF(MSVC_VERSION GREATER 1700)
ELSE(MSVC)
INCLUDE(CheckCXXCompilerFlag)
IF(APPLE)
CHECK_CXX_COMPILER_FLAG("-std=c++11 -stdlib=libc++" COMPILER_SUPPORTS_CXX11)
ELSE(APPLE)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
ENDIF(APPLE)
IF(COMPILER_SUPPORTS_CXX11)
IF(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
SET(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} -std=c++11 -stdlib=libc++")
SET(CMAKE_EXE_LINKER_FLAGS "-stdlib=libc++")
SET(CXX11_FLAGS " -std=c++11 -stdlib=libc++") #used for precompiled header
ELSE(APPLE)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} -std=c++11")
SET(CXX11_FLAGS " -std=c++11") #used for precompiled header
ENDIF(APPLE)
ELSE()
SET(COMPILER_SUPPORTS_CXX11 False)
ENDIF(COMPILER_SUPPORTS_CXX11)
ENDIF(MSVC)
ELSE(USE_CPP_ELEVEN)
SET(COMPILER_SUPPORTS_CXX11 False)
ENDIF(USE_CPP_ELEVEN)

IF(COMPILER_SUPPORTS_CXX11)
MESSAGE(STATUS "C++11 support enabled")
ADD_DEFINITIONS(-DUSE_CPP_ELEVEN)
ELSE(COMPILER_SUPPORTS_CXX11)
MESSAGE(STATUS "C++11 support disabled")
ENDIF(COMPILER_SUPPORTS_CXX11)

#Handle static boost linking
IF(NOT BOOST_STATIC_LINKING)
SET(Boost_USE_STATIC_LIBS OFF)
Expand Down Expand Up @@ -285,14 +330,19 @@ FIND_PACKAGE(Boost COMPONENTS log log_setup)

FIND_PACKAGE(Boost COMPONENTS thread atomic)

SET(Boost_LIBRARIES_TMP ${Boost_LIBRARIES_TMP} ${Boost_LIBRARIES})
FIND_PACKAGE(Threads)
IF(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
ADD_DEFINITIONS(-DUSE_BOOST_THREAD)
MESSAGE(STATUS "Using boost thread")
ELSE(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
MESSAGE(STATUS "Boost thread disabled")
ENDIF(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
IF(NOT(COMPILER_SUPPORTS_CXX11))
SET(Boost_LIBRARIES_TMP ${Boost_LIBRARIES_TMP} ${Boost_LIBRARIES})
FIND_PACKAGE(Threads)
IF(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
ADD_DEFINITIONS(-DUSE_THREAD)
MESSAGE(STATUS "Using boost thread")
ELSE(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
MESSAGE(STATUS "Boost thread disabled")
ENDIF(Boost_THREAD_FOUND AND Boost_ATOMIC_FOUND)
ELSE()
ADD_DEFINITIONS(-DUSE_THREAD)
MESSAGE(STATUS "Boost thread disabled because of available C++11 support")
ENDIF(NOT(COMPILER_SUPPORTS_CXX11))

FIND_PACKAGE(Boost REQUIRED COMPONENTS filesystem system serialization program_options)
SET(Boost_LIBRARIES_TMP ${Boost_LIBRARIES_TMP} ${Boost_LIBRARIES})
Expand Down
8 changes: 3 additions & 5 deletions SimulationRuntime/cpp/Core/DataExchange/FactoryExport.cpp
Expand Up @@ -7,13 +7,11 @@
#elif defined(OMC_BUILD)

#include <Core/DataExchange/FactoryExport.h>
#include <Core/DataExchange/SimData.h>
#include <Core/DataExchange/XmlPropertyReader.h>
/* OMC factory*/
using boost::extensions::factory;
#include <Core/DataExchange/SimData.h>
#include <Core/DataExchange/XmlPropertyReader.h>

BOOST_EXTENSION_TYPE_MAP_FUNCTION {
types.get<std::map<std::string, factory<ISimData > > >()
types.get<map<string, boost::extensions::factory<ISimData > > >()
["SimData"].set<SimData>();
/* used late for factory methode createXMLReader
types.get<std::map<std::string, factory<IPropertyReader,string > > >()
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/Core/DataExchange/SimData.cpp
Expand Up @@ -24,9 +24,9 @@ ISimData* SimData::clone()
return new SimData(*this);
}

void SimData::Add(string key, boost::shared_ptr<ISimVar> var)
void SimData::Add(string key, shared_ptr<ISimVar> var)
{
std::pair<string,boost::shared_ptr<ISimVar> > elem(key,var);
std::pair<string,shared_ptr<ISimVar> > elem(key,var);
std::pair<Objects_type::iterator,bool> p = _sim_vars.insert(elem);
}

Expand All @@ -37,7 +37,7 @@ ISimVar* SimData::Get(string key)
//Prüfen ob das Simobjekt in Liste ist.
if(iter!=_sim_vars.end())
{
boost::shared_ptr<ISimVar> obj = iter->second;
shared_ptr<ISimVar> obj = iter->second;
return obj.get();
}
else
Expand Down
Expand Up @@ -3,8 +3,6 @@
#include <Core/DataExchange/FactoryExport.h>
#include <Core/Utils/extension/logger.hpp>
#include <Core/DataExchange/XmlPropertyReader.h>
#include <boost/property_tree/xml_parser.hpp>
#include <boost/property_tree/ptree.hpp>
#include <fstream>
#include <iostream>

Expand All @@ -17,7 +15,7 @@ XmlPropertyReader::~XmlPropertyReader()

}

void XmlPropertyReader::readInitialValues(IContinuous& system, boost::shared_ptr<ISimVars> sim_vars)
void XmlPropertyReader::readInitialValues(IContinuous& system, shared_ptr<ISimVars> sim_vars)
{
using boost::property_tree::ptree;
std::ifstream file;
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Core/Modelica/ModelicaSystem.cpp
Expand Up @@ -8,7 +8,7 @@
#include <Core/DataExchange/Policies/TextfileWriter.h>
#include <Core/Modelica/ModelicaSystem.h>

Modelica::Modelica(IGlobalSettings* globalSettings, boost::shared_ptr<IAlgLoopSolverFactory> nonlinsolverfactory, boost::shared_ptr<ISimData> sim_data, boost::shared_ptr<ISimVars> sim_vars)
Modelica::Modelica(IGlobalSettings* globalSettings, shared_ptr<IAlgLoopSolverFactory> nonlinsolverfactory, shared_ptr<ISimData> sim_data, shared_ptr<ISimVars> sim_vars)
: SystemDefaultImplementation(globalSettings,sim_data,sim_vars)
{
_dimBoolean = 0;
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Core/SimController/Configuration.cpp
Expand Up @@ -36,11 +36,11 @@ ISolverSettings* Configuration::getSolverSettings()
return _solver_settings.get();
}

boost::shared_ptr<ISolver> Configuration::createSelectedSolver(IMixedSystem* system)
shared_ptr<ISolver> Configuration::createSelectedSolver(IMixedSystem* system)
{
string solver_name = _global_settings->getSelectedSolver();
_solver_settings =_settings_factory->createSelectedSolverSettings();
_simcontroller_settings = boost::shared_ptr<ISimControllerSettings>(new ISimControllerSettings(_global_settings.get()) );
_simcontroller_settings = shared_ptr<ISimControllerSettings>(new ISimControllerSettings(_global_settings.get()) );
_solver = createSolver(system, solver_name, _solver_settings);
return _solver;
}
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Core/SimController/FactoryExport.cpp
Expand Up @@ -45,9 +45,9 @@ BOOST_EXTENSION_TYPE_MAP_FUNCTION {
}

#ifdef RUNTIME_STATIC_LINKING
boost::shared_ptr<ISimController> createSimController(PATH library_path, PATH modelicasystem_path)
shared_ptr<ISimController> createSimController(PATH library_path, PATH modelicasystem_path)
{
return boost::shared_ptr<ISimController>(new SimController(library_path, modelicasystem_path));
return shared_ptr<ISimController>(new SimController(library_path, modelicasystem_path));
}
#endif

Expand Down
8 changes: 4 additions & 4 deletions SimulationRuntime/cpp/Core/SimController/Initialization.cpp
Expand Up @@ -7,7 +7,7 @@
#include <Core/Modelica.h>
#include <Core/SimController/Initialization.h>

Initialization::Initialization(boost::shared_ptr<ISystemInitialization> system_initialization, boost::shared_ptr<ISolver> solver)
Initialization::Initialization(shared_ptr<ISystemInitialization> system_initialization, shared_ptr<ISolver> solver)
: _system(system_initialization)
, _solver(solver)
{
Expand All @@ -19,9 +19,9 @@ Initialization::~Initialization(void)

void Initialization::initializeSystem()
{
boost::shared_ptr<IContinuous> continous_system = boost::dynamic_pointer_cast<IContinuous>(_system);
boost::shared_ptr<IEvent> event_system = boost::dynamic_pointer_cast<IEvent>(_system);
boost::shared_ptr<IMixedSystem> mixed_system = boost::dynamic_pointer_cast<IMixedSystem>(_system);
shared_ptr<IContinuous> continous_system = dynamic_pointer_cast<IContinuous>(_system);
shared_ptr<IEvent> event_system = dynamic_pointer_cast<IEvent>(_system);
shared_ptr<IMixedSystem> mixed_system = dynamic_pointer_cast<IMixedSystem>(_system);
int dim = event_system->getDimZeroFunc();
bool* conditions0 = new bool[dim];
bool* conditions1 = new bool[dim];
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Core/SimController/Main.cpp
Expand Up @@ -114,9 +114,9 @@ int main(int argc, const char* argv[])

//SimController to start simulation
SimSettings settings = {solver,"newton",starttime,stoptime,stepsize,1e-20,0.01,tollerance,results_file_path.string()};
boost::shared_ptr<ISimController> sim_controller = boost::shared_ptr<ISimController>(new SimController(runtime_lib_path,modelica_path));
shared_ptr<ISimController> sim_controller = shared_ptr<ISimController>(new SimController(runtime_lib_path,modelica_path));
//create Modelica system
std::pair<boost::weak_ptr<IMixedSystem>,boost::weak_ptr<ISimData> > system = sim_controller->LoadSystem("ModelicaSystem");
std::pair<weak_ptr<IMixedSystem>,weak_ptr<ISimData> > system = sim_controller->LoadSystem("ModelicaSystem");

sim_controller->Start(system.first,settings);
}
Expand Down

0 comments on commit 5d714dc

Please sign in to comment.