Skip to content

Commit

Permalink
[Janitor mode] Fix whitespace
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@22903 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Oct 24, 2014
1 parent 58510d5 commit e2824ca
Show file tree
Hide file tree
Showing 32 changed files with 1,816 additions and 1,816 deletions.
8 changes: 4 additions & 4 deletions SimulationRuntime/cpp/Core/DataExchange/FactoryExport.cpp
@@ -1,14 +1,14 @@
#pragma once

#if defined(__TRICORE__) || defined(__vxworks)

#include <Core/Modelica.h>
#include <Core/DataExchange/SimData.h>
extern "C" ISimData* createSimData()
{
return new SimData();
return new SimData();
}


#elif defined(OMC_BUILD)
#include <Core/Modelica.h>
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Core/DataExchange/SimData.cpp
Expand Up @@ -69,7 +69,7 @@ void SimData::getOutputResults(string name,uBlas::vector<double>& v)
//Prüfen ob die Ergebnisse in Liste ist.
if(iter!=_result_vars.end())
{

v = boost::ref(iter->second);
}
else
Expand Down
22 changes: 11 additions & 11 deletions SimulationRuntime/cpp/Core/SimController/Configuration.cpp
Expand Up @@ -7,11 +7,11 @@
#endif

Configuration::Configuration( PATH libraries_path,PATH config_path,PATH modelicasystem_path)
:ConfigurationPolicy(libraries_path,modelicasystem_path,config_path)
:ConfigurationPolicy(libraries_path,modelicasystem_path,config_path)
{
_settings_factory = createSettingsFactory();
_settings_factory = createSettingsFactory();

_global_settings = _settings_factory->createSolverGlobalSettings();
_global_settings = _settings_factory->createSolverGlobalSettings();
}

Configuration::~Configuration(void)
Expand All @@ -20,24 +20,24 @@ Configuration::~Configuration(void)

IGlobalSettings* Configuration::getGlobalSettings()
{
return _global_settings.get();
return _global_settings.get();
}

ISimControllerSettings* Configuration::getSimControllerSettings()
{
return _simcontroller_settings.get();
return _simcontroller_settings.get();
}

ISolverSettings* Configuration::getSolverSettings()
{
return _solver_settings.get();
return _solver_settings.get();
}

boost::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()) );
_solver = createSolver(system, solver_name, _solver_settings);
return _solver;
string solver_name = _global_settings->getSelectedSolver();
_solver_settings =_settings_factory->createSelectedSolverSettings();
_simcontroller_settings = boost::shared_ptr<ISimControllerSettings>(new ISimControllerSettings(_global_settings.get()) );
_solver = createSolver(system, solver_name, _solver_settings);
return _solver;
}
10 changes: 5 additions & 5 deletions SimulationRuntime/cpp/Core/SimController/FactoryExport.cpp
Expand Up @@ -6,7 +6,7 @@

extern "C" ISimController* createSimController(PATH library_path,PATH modelicasystem_path)
{
return new SimController(library_path,modelicasystem_path);
return new SimController(library_path,modelicasystem_path);
}

#elif defined(SIMSTER_BUILD)
Expand All @@ -18,8 +18,8 @@ extern "C" ISimController* createSimController(PATH library_path,PATH modelicasy
/*Simster factory*/
extern "C" void BOOST_EXTENSION_EXPORT_DECL extension_export_simcontroller(boost::extensions::factory_map & fm)
{
fm.get<ISimController,int,PATH,PATH>()[1].set<SimController>();
// fm.get<ISimData,int>()[1].set<SimData>();
fm.get<ISimController,int,PATH,PATH>()[1].set<SimController>();
// fm.get<ISimData,int>()[1].set<SimData>();
}

#elif defined(OMC_BUILD)
Expand All @@ -33,8 +33,8 @@ extern "C" void BOOST_EXTENSION_EXPORT_DECL extension_export_simcontroller(boost
/*OMC factory*/
using boost::extensions::factory;
BOOST_EXTENSION_TYPE_MAP_FUNCTION {
types.get<std::map<std::string, factory<ISimController,PATH,PATH> > >()
["SimController"].set<SimController>();
types.get<std::map<std::string, factory<ISimController,PATH,PATH> > >()
["SimController"].set<SimController>();

}

Expand Down
76 changes: 38 additions & 38 deletions SimulationRuntime/cpp/Core/SimController/Initialization.cpp
Expand Up @@ -5,8 +5,8 @@


Initialization::Initialization(boost::shared_ptr<ISystemInitialization> system_initialization, boost::shared_ptr<ISolver> solver)
:_system(system_initialization)
,_solver(solver)
:_system(system_initialization)
,_solver(solver)
{
}

Expand All @@ -16,40 +16,40 @@ 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);
int dim = event_system->getDimZeroFunc();
bool* conditions0 = new bool[dim];
bool* conditions1 = new bool[dim];

_system->setInitial(true);
//Initialization of continous equations and bounded parameters

_system->initialize();
_solver->stateSelection();
bool restart = true;
int iter = 0;
bool cond_restart = true;
while((restart /*|| cond_restart*/) && !(iter++ > 15))
{
event_system->getConditions(conditions0);
_system->initEquations(); // vxworksupdate
restart = event_system->checkForDiscreteEvents();
event_system->getConditions(conditions1);
event_system->saveDiscreteVars();
cond_restart = !std::equal (conditions1, conditions1+dim, conditions0);
}

mixed_system->saveAll();
_system->setInitial(false);

if( _solver->stateSelection())
{
_system->initEquations();

/* report a warning about strange start values */
if(_solver->stateSelection())
cout << "Cannot initialize the dynamic state selection in an unique way." << std::endl;
}
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);
int dim = event_system->getDimZeroFunc();
bool* conditions0 = new bool[dim];
bool* conditions1 = new bool[dim];

_system->setInitial(true);
//Initialization of continous equations and bounded parameters

_system->initialize();
_solver->stateSelection();
bool restart = true;
int iter = 0;
bool cond_restart = true;
while((restart /*|| cond_restart*/) && !(iter++ > 15))
{
event_system->getConditions(conditions0);
_system->initEquations(); // vxworksupdate
restart = event_system->checkForDiscreteEvents();
event_system->getConditions(conditions1);
event_system->saveDiscreteVars();
cond_restart = !std::equal (conditions1, conditions1+dim, conditions0);
}

mixed_system->saveAll();
_system->setInitial(false);

if( _solver->stateSelection())
{
_system->initEquations();

/* report a warning about strange start values */
if(_solver->stateSelection())
cout << "Cannot initialize the dynamic state selection in an unique way." << std::endl;
}
}

0 comments on commit e2824ca

Please sign in to comment.