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@25427 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Apr 7, 2015
1 parent 9a24136 commit db703eb
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 62 deletions.
4 changes: 2 additions & 2 deletions Compiler/BackEnd/BackendEquation.mo
Expand Up @@ -2321,7 +2321,7 @@ protected
Boolean b;

algorithm

(y, _) := ExpressionSimplify.simplify(iExp);
b := Expression.isCref(y) or Expression.isConst(y);
if not b then
Expand All @@ -2341,7 +2341,7 @@ algorithm
case({cr1}) then ComponentReference.crefEqualNoStringCompare(cr,cr1);
else false;
end match;

if b then
tmpvar := BackendVariable.setBindExp(tmpvar, SOME(y));
tmpvar := BackendVariable.setVarKind(tmpvar, BackendDAE.CONST());
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Include/Solver/RTEuler/FactoryExport.h
Expand Up @@ -2,8 +2,8 @@

#if defined(__vxworks)

#define BOOST_EXTENSION_SOLVER_DECL
#define BOOST_EXTENSION_SOLVERSETTINGS_DECL
#define BOOST_EXTENSION_SOLVER_DECL
#define BOOST_EXTENSION_SOLVERSETTINGS_DECL

#elif defined(RUNTIME_STATIC_LINKING) && (defined(OMC_BUILD) || defined(SIMSTER_BUILD))

Expand Down
28 changes: 14 additions & 14 deletions SimulationRuntime/cpp/Include/Solver/RTEuler/RTEuler.h
Expand Up @@ -8,16 +8,16 @@ class IEulerSettings;
/*****************************************************************************/
/**
Euler method for the solution of a non-stiff initial value problem of a system
of ordinary differantial equations of the form
Euler method for the solution of a non-stiff initial value problem of a system
of ordinary differantial equations of the form
z' = f(t,z).
z' = f(t,z).
Dense output may be used. Zero crossing are detected by bisection or linear
interpolation.
\date 01.09.2008
\author
\author
*/
Expand All @@ -27,7 +27,7 @@ Copyright (c) 2008, OSMC
class RTEuler : public ISolver, public SolverDefaultImplementation
{
public:
RTEuler(IMixedSystem* system, ISolverSettings* settings);
RTEuler(IMixedSystem* system, ISolverSettings* settings);
virtual ~RTEuler();

/// Set start time for numerical solution
Expand Down Expand Up @@ -64,23 +64,23 @@ class RTEuler : public ISolver, public SolverDefaultImplementation
void calcFunction(const double& t, const double* z, double* zDot);

void doRK1();

// Member variables
//---------------------------------------------------------------
ISolverSettings
*_eulerSettings; ///< Settings for the solver
*_eulerSettings; ///< Settings for the solver

long int
_dimSys; ///< Temp - (total) Dimension of systems (=number of ODE)
_dimSys; ///< Temp - (total) Dimension of systems (=number of ODE)



double _tHelp;
double
*_z, ///< Temp - State vector
*_zInit, ///< Temp - Initial state vector
*_f; ///< Temp - function evaluation ///< Temp - yhelp and fhelp only provided in order to avoid multiple generation of save
ISystemProperties* _properties;
*_z, ///< Temp - State vector
*_zInit, ///< Temp - Initial state vector
*_f; ///< Temp - function evaluation ///< Temp - yhelp and fhelp only provided in order to avoid multiple generation of save

ISystemProperties* _properties;
IContinuous* _continuous_system;
IEvent* _event_system;
IMixedSystem* _mixed_system;
Expand Down
Expand Up @@ -9,7 +9,7 @@
Encapsulation of settings for euler solver
\date October, 1st, 2008
\author
\author
*/
Expand All @@ -21,9 +21,9 @@ class RTEulerSettings : public SolverSettings

public:
RTEulerSettings(IGlobalSettings* globalSettings);

virtual void load(std::string xml_file);
private:


};
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Solver/RTEuler/FactoryExport.cpp
Expand Up @@ -65,4 +65,4 @@ error "operating system not supported"




74 changes: 37 additions & 37 deletions SimulationRuntime/cpp/Solver/RTEuler/RTEuler.cpp
Expand Up @@ -4,21 +4,21 @@

RTEuler::RTEuler(IMixedSystem* system, ISolverSettings* settings)
: SolverDefaultImplementation(system, settings)
, _eulerSettings (dynamic_cast<ISolverSettings*>(_settings))
, _z (NULL)
, _dimSys (0)
, _f (NULL)
, _eulerSettings (dynamic_cast<ISolverSettings*>(_settings))
, _z (NULL)
, _dimSys (0)
, _f (NULL)
{
}

RTEuler::~RTEuler()
{
{
if(_z)
delete [] _z;
if(_f)
delete [] _f;
if(_zInit)
delete [] _zInit;
delete [] _zInit;
}


Expand All @@ -34,7 +34,7 @@ void RTEuler::initialize()
SolverDefaultImplementation::initialize();

// Dimension of the system (number of variables)
_dimSys = _continuous_system->getDimContinuousStates();
_dimSys = _continuous_system->getDimContinuousStates();

// Check system dimension
if(_dimSys <= 0 || !(_properties->isODE()))
Expand All @@ -43,38 +43,38 @@ void RTEuler::initialize()
}
else
{

// Allocate state vectors, stages and temporary arrays
if(_z) delete [] _z;
if(_f) delete [] _f;

_z = new double[_dimSys];
_f = new double[_dimSys];
_zInit = new double[_dimSys];
if(_z) delete [] _z;
if(_f) delete [] _f;



_z = new double[_dimSys];
_f = new double[_dimSys];
_zInit = new double[_dimSys];







memset(_z,0,_dimSys*sizeof(double)); //hier!!!
memset(_zInit,0,_dimSys*sizeof(double));

memset(_f,0,_dimSys*sizeof(double));



_continuous_system->evaluateAll(IContinuous::CONTINUOUS);
_continuous_system->getContinuousStates(_zInit);

// Ensures that solver is started with right sign of zero function
_zeroStatus = UNCHANGED_SIGN;

memcpy(_z,_zInit,_dimSys*sizeof(double));

IGlobalSettings* globalsettings = _eulerSettings->getGlobalSettings();
_h = globalsettings->gethOutput();
}
Expand All @@ -93,7 +93,7 @@ void RTEuler::setEndTime(const double& t)
};

/// Set the initial step size (needed for reinitialization after external zero search)
void RTEuler::setInitStepSize(const double& h)
void RTEuler::setInitStepSize(const double& h)
{
SolverDefaultImplementation::setInitStepSize(h);
};
Expand All @@ -113,13 +113,13 @@ bool RTEuler::stateSelection()
void RTEuler::solve(const SOLVERCALL command)
{

_continuous_system->stepStarted(_tCurrent);
_continuous_system->getContinuousStates(_z);
doRK1();
_continuous_system->stepStarted(_tCurrent);
_continuous_system->getContinuousStates(_z);
doRK1();
//_totStps++;
//_accStps++;
//_tCurrent += _h; //time not required

_continuous_system->setContinuousStates(_z);
_continuous_system->evaluateAll();
_continuous_system->stepCompleted(_tCurrent);
Expand All @@ -140,7 +140,7 @@ void RTEuler::writeSimulationInfo()
}

const int RTEuler::reportErrorMessage(ostream& messageStream)
{
{
return 1;
}

Expand All @@ -149,10 +149,10 @@ const int RTEuler::reportErrorMessage(ostream& messageStream)
void RTEuler::doRK1()
{

calcFunction(_tCurrent, _z, _f);
calcFunction(_tCurrent, _z, _f);

for(int i = 0; i < _dimSys; ++i)
_z[i] += _h * _f[i];
for(int i = 0; i < _dimSys; ++i)
_z[i] += _h * _f[i];
}

void RTEuler::setTimeOut(unsigned int time_out)
Expand Down
4 changes: 2 additions & 2 deletions SimulationRuntime/cpp/Solver/RTEuler/RTEulerSettings.cpp
Expand Up @@ -3,7 +3,7 @@
#include <Solver/RTEuler/RTEulerSettings.h>

RTEulerSettings::RTEulerSettings(IGlobalSettings* globalSettings)
: SolverSettings (globalSettings)
: SolverSettings (globalSettings)
{
}

Expand All @@ -19,5 +19,5 @@ void RTEulerSettings::load(std::string xml_file)
/* std::fstream ofs;
ofs.open("C:\\Temp\\EulerSettings.xml", ios::out);
boost::archive::xml_oarchive xml(ofs);
xml << boost::serialization::make_nvp("EulerSettings", *this);
xml << boost::serialization::make_nvp("EulerSettings", *this);
ofs.close();*/

0 comments on commit db703eb

Please sign in to comment.