Skip to content

Commit

Permalink
- Fix encoding in CPP and interactive
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@11535 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
sjoelund committed Mar 26, 2012
1 parent b2e92d2 commit 00aca31
Show file tree
Hide file tree
Showing 41 changed files with 188 additions and 189 deletions.
3 changes: 1 addition & 2 deletions Makefile.in
Expand Up @@ -81,7 +81,6 @@ fix-bom:
find . -type f \( ! -path '*/.svn/*' -prune \) | while read file;do sed -i '1 s/^\xef\xbb\xbf//' "$$file";done

SOURCE_DIRS=OM*/ Compiler/ SimulationRuntime/ mosh/
#SOURCE_DIRS=Compiler/

bom-error:
rm -f bom-error.log bom-error.sh
Expand All @@ -97,7 +96,7 @@ tab-error:

utf8-error:
rm -f utf8-error.log*
find $(SOURCE_DIRS) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo)$$' -exec bash -c "iconv -f UTF-8 -t UTF-8 '{}' -o /dev/null 2>utf8-error.log2 || (echo -n "{}: " && head -n1 utf8-error.log2)" ';' 2>&1 > utf8-error.log
find $(SOURCE_DIRS) -regextype posix-egrep -regex '.*\.(cpp|c|h|mo)$$' -exec bash -c "iconv -f UTF-8 -t UTF-8 '{}' -o /dev/null 2>utf8-error.log2 || (echo -n '{}: ' && head -n1 utf8-error.log2)" ';' 2>&1 > utf8-error.log
@if test -e utf8-error.log; then cat utf8-error.log; fi
@test ! -e utf8-error.log
rm -f utf8-error.log*
Expand Down
2 changes: 1 addition & 1 deletion SimulationRuntime/cpp/Source/Math/Implementation/stdafx.h
Expand Up @@ -4,7 +4,7 @@
#define WIN32_LEAN_AND_MEAN // Selten verwendete Teile der Windows-Header nicht einbinden.


// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
#pragma once

//typedef ublas::shallow_array_adaptor<double> adaptor_t;
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/Source/ModelicaExternalC/tables.cpp
@@ -1,9 +1,9 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-2010, Linköpings University,
* Copyright (c) 1998-2010, Linköpings University,
* Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
Expand All @@ -14,7 +14,7 @@
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linköpings University, either from the above address,
* from Linköpings University, either from the above address,
* from the URL: http://www.ida.liu.se/projects/OpenModelica
* and in the OpenModelica distribution.
*
Expand Down
6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/Source/ModelicaExternalC/tables.h
@@ -1,9 +1,9 @@
/*
* This file is part of OpenModelica.
*
* Copyright (c) 1998-CurrentYear, Linköping University,
* Copyright (c) 1998-CurrentYear, Linköping University,
* Department of Computer and Information Science,
* SE-58183 Linköping, Sweden.
* SE-58183 Linköping, Sweden.
*
* All rights reserved.
*
Expand All @@ -14,7 +14,7 @@
*
* The OpenModelica software and the Open Source Modelica
* Consortium (OSMC) Public License (OSMC-PL) are obtained
* from Linköping University, either from the above address,
* from Linköping University, either from the above address,
* from the URLs: http://www.ida.liu.se/projects/OpenModelica or
* http://www.openmodelica.org, and in the OpenModelica distribution.
* GNU version 3 is obtained from: http://www.gnu.org/copyleft/gpl.html.
Expand Down
@@ -1,6 +1,6 @@
// stdafx.h : Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
// stdafx.h : Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
//

#pragma once
Expand Down Expand Up @@ -33,5 +33,5 @@ using namespace boost::extensions;
using std::ios;
using boost::tuple;
using boost::shared_ptr;
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.

6 changes: 3 additions & 3 deletions SimulationRuntime/cpp/Source/SimManager/stdafx.h
@@ -1,6 +1,6 @@
// stdafx.h : Includedatei für Standardsystem-Includedateien,
// oder projektspezifische Includedateien, die häufig benutzt, aber
// in unregelmäßigen Abständen geändert werden.
// stdafx.h : Includedatei für Standardsystem-Includedateien,
// oder projektspezifische Includedateien, die häufig benutzt, aber
// in unregelmäßigen Abständen geändert werden.
//

#pragma once
Expand Down
26 changes: 13 additions & 13 deletions SimulationRuntime/cpp/Source/Solver/CVode/Implementation/CVode.cpp
Expand Up @@ -83,7 +83,7 @@ void Cvode::init()
_idid = 5000;

// System im Solver assemblen, da folgende Reihenfolge einzuhalten ist:
// 1) System assemblen und updaten, alles für Nullstellsuche anlegen
// 1) System assemblen und updaten, alles für Nullstellsuche anlegen
// 2) Spezielle Dimensionen bestimmen (muss wg. ODE/DAE im Solver stattfinden)
// 3) Zustandsvektor anlegen
SolverDefaultImplementation::init();
Expand Down Expand Up @@ -125,7 +125,7 @@ void Cvode::init()
memset(_zInit,0,_dimSys*sizeof(double));
memset(_zLastSucess,0,_dimSys*sizeof(double));
memset(_zLargeStep,0,_dimSys*sizeof(double));
// Arrays für Zustandswerte an den Berechnungsintervallgrenzen
// Arrays für Zustandswerte an den Berechnungsintervallgrenzen

if(_z0) delete [] _z0;
if(_z1) delete [] _z1;
Expand Down Expand Up @@ -232,7 +232,7 @@ void Cvode::solve(const SOLVERCALL action)

if (_cvodesettings && _system)
{
// Solver und System für Integration vorbereiten
// Solver und System für Integration vorbereiten
if(action & RECORDCALL && action & FIRST_CALL)
{
init();
Expand Down Expand Up @@ -288,7 +288,7 @@ void Cvode::solve(const SOLVERCALL action)
// Solveraufruf
if(_idid == 0)
{
// Zähler zurücksetzen
// Zähler zurücksetzen
_accStps = 0;
_locStps = 0;

Expand Down Expand Up @@ -391,7 +391,7 @@ void Cvode::CVodeCore()
{
_zeroFound = false;

//CVode für einen Schritt rufen
//CVode für einen Schritt rufen
_idid = CVode(_cvodeMem, _tEnd, _CV_y, &_tHelp, CV_ONE_STEP);

// Check, ob Schritt erfolgreich
Expand Down Expand Up @@ -427,7 +427,7 @@ void Cvode::CVodeCore()
continous_system->update(IContinous::ALL );
}

// Falls über tEnd hinaus. Zustand bei tEnd holen
// Falls über tEnd hinaus. Zustand bei tEnd holen
if(_tHelp <= _tEnd)
{
_tCurrent = _tHelp;
Expand Down Expand Up @@ -499,7 +499,7 @@ void Cvode::CVodeCore()
_idid = CVodeReInit(_cvodeMem, _tCurrent, _CV_y);
}

// Zähler für die Anzahl der ausgegebenen Schritte erhöhen
// Zähler für die Anzahl der ausgegebenen Schritte erhöhen
++ _outStps;

if ( (_tEnd - _tCurrent) <= dynamic_cast<ISolverSettings*>(_cvodesettings)->getEndTimeTol())
Expand Down Expand Up @@ -651,7 +651,7 @@ void Cvode::writeSimulationInfo(ostream& outputStream)
// << "ausgegebene Schritte: " << _outStps << "\n"
// << "Anfangsschrittweite: " << _cvodesettings->dH_init << "\n"
// << "Ausgabeschrittweite: " << dynamic_cast<ISolverSettings*>(_cvodesettings)->getGlobalSettings()->gethOutput() << "\n"
// << "Obere Grenze für Schrittweite: " << _hUpLim << "\n\n";
// << "Obere Grenze für Schrittweite: " << _hUpLim << "\n\n";

//// Status
//outputStream
Expand Down Expand Up @@ -679,7 +679,7 @@ void Cvode::restoreInitState()
// Initialen Zeitpunkt wiederherstellen
_tCurrent = _tInit;

// Einträge im ZeroFunction-Vektor wiederherstellen
// Einträge im ZeroFunction-Vektor wiederherstellen
if (_zeroVal)
memcpy(_zeroVal,_zeroValInit,_dimZeroFunc*sizeof(double));

Expand All @@ -690,7 +690,7 @@ void Cvode::restoreInitState()
void Cvode::saveLargeStepState()
{
IContinous* continous_system = dynamic_cast<IContinous*>(_system);
// Aktuellen Zeitpunkt als "End-Zeitpunkt des großen Schrittes bei partitionierter Integration" abspeichern
// Aktuellen Zeitpunkt als "End-Zeitpunkt des großen Schrittes bei partitionierter Integration" abspeichern
_tLargeStep = _tCurrent;

// Zustandsvektor abspeichern
Expand Down Expand Up @@ -718,7 +718,7 @@ void Cvode::restoreLastSuccessfullState()
// Letzten erfolgreichen Zeitpunkt wiederherstellen
_tCurrent = _tLastSuccess;

// Einträge im ZeroFunction-Vektor wiederherstellen
// Einträge im ZeroFunction-Vektor wiederherstellen
if (_zeroVal)
memcpy(_zeroVal,_zeroValLastSuccess,_dimZeroFunc*sizeof(double));

Expand All @@ -731,7 +731,7 @@ void Cvode::giveScaledError(const double& h, double& error)
IContinous* continous_system = dynamic_cast<IContinous*>(_system);
continous_system->giveVars(_z,IContinous::ALL_VARS);

// Berechnung der Skalierten Fehlernorm für ODE-Systeme
// Berechnung der Skalierten Fehlernorm für ODE-Systeme
double sc = 0.0;
for(int i=0; i<_dimSys; ++i)
{
Expand All @@ -743,7 +743,7 @@ void Cvode::giveScaledError(const double& h, double& error)
void Cvode::refineCurrentState(const double& r)
{
IContinous* continous_system = dynamic_cast<IContinous*>(_system);
// Approximation höherer Ordnung
// Approximation höherer Ordnung
for(int i=0; i<_dimSys; ++i)
_z[i] += (_z[i] - _zLargeStep[i]) / ( pow(1.0/r,3.0) );

Expand Down
24 changes: 12 additions & 12 deletions SimulationRuntime/cpp/Source/Solver/CVode/Implementation/CVode.h
Expand Up @@ -12,7 +12,7 @@

/*****************************************************************************/
// Cvode aus dem SUNDIALS-Package
// BDF-Verfahren für steife und nicht-steife ODEs
// BDF-Verfahren für steife und nicht-steife ODEs
// Dokumentation siehe offizielle Cvode Doku

/*****************************************************************************
Expand All @@ -37,13 +37,13 @@ class Cvode

// geerbt von ISolver
//---------------------------------------
/// Setzen der Startzeit für die numerische Lösung
/// Setzen der Startzeit für die numerische Lösung
virtual void setStartTime(const double& time)
{
SolverDefaultImplementation::setStartTime(time);
};

/// Setzen der Endzeit für die numerische Lösung
/// Setzen der Endzeit für die numerische Lösung
virtual void setEndTime(const double& time)
{
SolverDefaultImplementation::setEndTime(time);
Expand All @@ -55,7 +55,7 @@ class Cvode
SolverDefaultImplementation::setInitStepSize(stepSize);
};

/// Berechung der numerischen Lösung innerhalb eines gegebenen Zeitintervalls
/// Berechung der numerischen Lösung innerhalb eines gegebenen Zeitintervalls
virtual void solve(const SOLVERCALL command = UNDEF_CALL);

/*/// Liefert den Zeitpunkt des letzten erfolgreichen Zeitschrittes (kann ~= tend sein)
Expand Down Expand Up @@ -95,28 +95,28 @@ class Cvode
SolverDefaultImplementation::setOutputStream(outputStream);
};
*/
//// Ausgabe von statistischen Informationen (wird vom SimManager nach Abschluß der Simulation aufgerufen)
//// Ausgabe von statistischen Informationen (wird vom SimManager nach Abschluß der Simulation aufgerufen)
virtual void writeSimulationInfo(ostream& outputStream);

/// Anfangszustand (und entsprechenden Zeitpunkt) des Systems (als Kopie) speichern
virtual void saveInitState();

/// Anfangszustand (und entsprechenden Zeitpunkt) zurück ins System kopieren
/// Anfangszustand (und entsprechenden Zeitpunkt) zurück ins System kopieren
virtual void restoreInitState();

/// Letzten gültigen Zustand (und entsprechenden Zeitpunkt) des Systems (als Kopie) speichern
/// Letzten gültigen Zustand (und entsprechenden Zeitpunkt) des Systems (als Kopie) speichern
virtual void saveLastSuccessfullState();

/// Letzten gültigen Zustand (und entsprechenden Zeitpunkt) zurück ins System kopieren
/// Letzten gültigen Zustand (und entsprechenden Zeitpunkt) zurück ins System kopieren
virtual void restoreLastSuccessfullState();

/// speichert den Zustand (und entsprechenden Zeitpunkt) des Systems (als Kopie) nach einem "großen Schritt" bei partitionierter Integration
/// speichert den Zustand (und entsprechenden Zeitpunkt) des Systems (als Kopie) nach einem "großen Schritt" bei partitionierter Integration
virtual void saveLargeStepState();

/// liefert den normierten Fehler zwischen aktuellem Zustand und Zustand nach einem "großen Schritt" bei partitionierter Integration
/// liefert den normierten Fehler zwischen aktuellem Zustand und Zustand nach einem "großen Schritt" bei partitionierter Integration
virtual void giveScaledError(const double& h, double& error);

/// Approximation höherer Ordnung des Zustandes berechnen und in System kopieren
/// Approximation höherer Ordnung des Zustandes berechnen und in System kopieren
virtual void refineCurrentState(const double& r);
virtual const int reportErrorMessage(ostream& messageStream);
private:
Expand All @@ -127,7 +127,7 @@ class Cvode
/// Kapselung der Berechnung der rechten Seite
void calcFunction(const double& time, const double* y, double* yd);

// Callback für die rechte Seite
// Callback für die rechte Seite
static int CV_fCallback(double t, N_Vector y, N_Vector ydot, void *user_data);

// Checks error flags of SUNDIALS
Expand Down
@@ -1,6 +1,6 @@
// stdafx.h : Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
// stdafx.h : Includedatei für Standardsystem-Includedateien
// oder häufig verwendete projektspezifische Includedateien,
// die nur in unregelmäßigen Abständen geändert werden.
//

#pragma once
Expand Down Expand Up @@ -35,4 +35,4 @@ using std::ios;



// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.
// TODO: Hier auf zusätzliche Header, die das Programm erfordert, verweisen.

0 comments on commit 00aca31

Please sign in to comment.