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@21307 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
OpenModelica-Hudson committed Jun 27, 2014
1 parent 60b1018 commit 88a4cc2
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions Compiler/Template/CodegenCpp.tpl
Expand Up @@ -7384,13 +7384,13 @@ template equationLinearOrNonLinear(SimEqSystem eq, Context context,Text &varDecl
_algLoop<%index%>->getReal(algloop<%index%>Vars );
bool restatDiscrete<%index%>= false;
IContinuous::UPDATETYPE calltype = _callType;
try
try
{
if( _callType == IContinuous::DISCRETE )
{
_algLoop<%index%>->evaluate();
_algLoop<%index%>->evaluate();
while(restart<%index%> && !(iterations<%index%>++>500))
{
Expand Down
20 changes: 10 additions & 10 deletions SimulationRuntime/cpp/Solver/CVode/CVode.cpp
Expand Up @@ -39,7 +39,7 @@ Cvode::~Cvode()
N_VDestroy_Serial(_CV_y0);
N_VDestroy_Serial(_CV_y);
N_VDestroy_Serial(_CV_yWrite);
N_VDestroy_Serial(_CV_absTol);
N_VDestroy_Serial(_CV_absTol);
CVodeFree(&_cvodeMem);
}
}
Expand Down Expand Up @@ -73,14 +73,14 @@ void Cvode::initialize()
if(_zInit) delete [] _zInit;
if(_zWrite) delete [] _zWrite;
if(_zeroSign) delete [] _zeroSign;
if(_absTol) delete [] _absTol;
if(_absTol) delete [] _absTol;


_z = new double[_dimSys];
_zInit = new double[_dimSys];
_zWrite = new double[_dimSys];
_zeroSign = new int[_dimZeroFunc];
_absTol = new double[_dimSys];
_absTol = new double[_dimSys];

memset(_z,0,_dimSys*sizeof(double));
memset(_zInit,0,_dimSys*sizeof(double));
Expand Down Expand Up @@ -113,16 +113,16 @@ void Cvode::initialize()
_continuous_system->getContinuousStates(_zInit);
memcpy(_z,_zInit,_dimSys*sizeof(double));

// Get nominal values
_continuous_system->getNominalStates(_absTol);
for(int i=0;i<_dimSys;i++)
_absTol[i]*= dynamic_cast<ISolverSettings*>(_cvodesettings)->getATol();
// Get nominal values
_continuous_system->getNominalStates(_absTol);
for(int i=0;i<_dimSys;i++)
_absTol[i]*= dynamic_cast<ISolverSettings*>(_cvodesettings)->getATol();


_CV_y0 = N_VMake_Serial(_dimSys, _zInit);
_CV_y = N_VMake_Serial(_dimSys, _z);
_CV_yWrite = N_VMake_Serial(_dimSys, _zWrite);
_CV_absTol = N_VMake_Serial(_dimSys, _absTol);
_CV_absTol = N_VMake_Serial(_dimSys, _absTol);

if(check_flag((void*)_CV_y0, "N_VMake_Serial", 0))
{
Expand Down Expand Up @@ -301,7 +301,7 @@ void Cvode::CVodeCore()
_cv_rt = CVode(_cvodeMem, _tEnd, _CV_y, &_tCurrent, CV_ONE_STEP);

_idid = CVodeGetNumSteps(_cvodeMem, &_locStps);

_idid = CVodeGetLastStep(_cvodeMem,&_h);
//Ausgabe
writeCVodeOutput(_tCurrent,_h,_locStps);
Expand Down Expand Up @@ -398,7 +398,7 @@ void Cvode::CVodeCore()
_continuous_system->setContinuousStates(NV_DATA_S(_CV_y));
_continuous_system->evaluateODE(IContinuous::CONTINUOUS);
writeToFile(0, _tEnd, _h);
_accStps +=_locStps;
_accStps +=_locStps;
_solverStatus = DONE;
}
}
Expand Down
8 changes: 4 additions & 4 deletions SimulationRuntime/cpp/Solver/CVode/CVode.h
Expand Up @@ -163,10 +163,10 @@ class Cvode


double
*_z, ///< Output - (Current) State vector
*_zInit, ///< Temp - Initial state vector
*_z, ///< Output - (Current) State vector
*_zInit, ///< Temp - Initial state vector
*_zWrite, ///< Temp - Zustand den das System rausschreibt
*_absTol; /// - Vektor für absolute Toleranzen
*_absTol; /// - Vektor für absolute Toleranzen

double
_hOut; ///< Temp - Ouput step size for dense output
Expand All @@ -191,7 +191,7 @@ double
N_Vector
_CV_y0, ///< Temp - Initial values in the Cvode Format
_CV_y, ///< Temp - State in Cvode Format
_CV_yWrite, ///< Temp - Vector for dense out
_CV_yWrite, ///< Temp - Vector for dense out
_CV_absTol;


Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Solver/Kinsol/Kinsol.cpp
Expand Up @@ -167,7 +167,7 @@ void Kinsol::solve()
long int irtrn = 0; // Retrun-flag of Fortran code _algLoop->getReal(_y);

_algLoop->evaluate();
_algLoop->getRHS(_f);
_algLoop->getRHS(_f);
_algLoop->getSystemMatrix(_jac);
dgesv_(&dimSys,&dimRHS,_jac,&dimSys,_helpArray,_f,&dimSys,&irtrn);
memcpy(_y,_f,_dimSys*sizeof(double));
Expand Down

0 comments on commit 88a4cc2

Please sign in to comment.