From 176ad8fb99d7bdfc9e8e84e5b1e1ef4a7d7c4c8a Mon Sep 17 00:00:00 2001 From: Wenqing Wang Date: Fri, 1 Feb 2019 10:16:15 +0100 Subject: [PATCH 1/5] [Display.h/cpp] Removed some unused function --- Base/display.cpp | 89 ------------------------------------------------ Base/display.h | 5 --- 2 files changed, 94 deletions(-) diff --git a/Base/display.cpp b/Base/display.cpp index b72f4dc94..d029da73b 100644 --- a/Base/display.cpp +++ b/Base/display.cpp @@ -97,32 +97,6 @@ void DisplayMsgLn(const char* s) CloseMsgFile(f); } -/**************************************************************************/ -/* ROCKFLOW - Funktion: DisplayMsgCR - */ -/* Aufgabe: - Schreibt Zeichenkette mit Zeilenruecklauf auf Standardausgabe, - beginnt immer erst nach 12 Zeichen Einrueckung. - */ -/* Formalparameter: (E: Eingabe; R: Rueckgabe; X: Beides) - E char *s: Zeichenkette - */ -/* Ergebnis: - - void - - */ -/* Programmaenderungen: - 08/1994 MSR Erste Version - 01/2002 MK Umleitung in MSG-Datei - */ -/**************************************************************************/ -void DisplayMsgCR(const char* s) -{ - FILE* f; - f = OpenMsgFile(); - fprintf(f, "%s\r ", s); - CloseMsgFile(f); -} - /**************************************************************************/ /* ROCKFLOW - Funktion: DisplayDouble */ @@ -183,43 +157,6 @@ void DisplayLong(long x) CloseMsgFile(f); } -/**************************************************************************/ -/* ROCKFLOW - Funktion: DisplayDoubleVector - */ -/* Aufgabe: - Schreibt Vektor auf Standardausgabe - */ -/* Formalparameter: (E: Eingabe; R: Rueckgabe; X: Beides) - E double *vec: Zeiger auf Vektor - E long grad: Laenge des Vektors - E char *text: Ueberschrift ueber Ausgabe - */ -/* Ergebnis: - - void - - */ -/* Programmaenderungen: - 08/1994 Hans Herrmann Erste Version - 12/1994 MSR Von mathlib nach display portiert - 01/2002 MK Umleitung in MSG-Datei - */ -/**************************************************************************/ -void DisplayDoubleVector(double* vec, long grad, char* text) -{ - FILE* f; - long i; - DisplayMsgLn(""); - DisplayMsgLn(text); - f = OpenMsgFile(); - for (i = 0; i < grad; i++) - { - fprintf(f, "| %+e |", vec[i]); - fprintf(f, "%s\n ", ""); - fflush(stdout); - } - CloseMsgFile(f); - DisplayMsgLn(""); -} - /**************************************************************************/ /* ROCKFLOW - Funktion: DisplayErrorMsg */ @@ -244,29 +181,3 @@ void DisplayErrorMsg(const char* s) fprintf(f, "\n!!!!!!!! %s\n\n ", s); CloseMsgFile(f); } - -/**************************************************************************/ -/* ROCKFLOW - Funktion: DisplayTimeMsg - */ -/* Aufgabe: - Schreibt Laufzeitmeldung auf Standardausgabe. - */ -/* Formalparameter: (E: Eingabe; R: Rueckgabe; X: Beides) - E char *s: Zeichenkette (Fehlermeldung) - E double d: Zeitwert - */ -/* Ergebnis: - - void - - */ -/* Programmaenderungen: - 07/1994 MSR Erste Version - 01/2002 MK Umleitung in MSG-Datei - */ -/**************************************************************************/ -void DisplayTimeMsg(const char* s, double d) -{ - FILE* f; - f = OpenMsgFile(); - fprintf(f, "\n %s%20ld s\n\n ", s, ((long)d)); - CloseMsgFile(f); -} diff --git a/Base/display.h b/Base/display.h index bb3a8eb7a..02c81ec89 100644 --- a/Base/display.h +++ b/Base/display.h @@ -32,20 +32,15 @@ extern void ScreenMessage(const char *format , ... ); extern void DisplayMsg(const char* s); /* Schreibt Zeichenkette ohne Zeilenvorschub auf Standardausgabe */ extern void DisplayMsgLn(const char* s); -/* Schreibt Zeichenkette mit Zeilenvorschub auf Standardausgabe */ -extern void DisplayMsgCR(const char* s); /* Schreibt Zeichenkette mit Zeilenruecklauf auf Standardausgabe */ extern void DisplayDouble(double x, int i, int j); /* Schreibt Double-Wert ohne Zeilenvorschub auf Standardausgabe */ extern void DisplayLong(long x); -/* Schreibt Long-Wert ohne Zeilenvorschub auf Standardausgabe */ -extern void DisplayDoubleVector(double* vec, long grad, char* text); /* Schreibt Vektor auf Standardausgabe */ // OK411 extern void DisplayDoubleMatrix ( double *mat, long m, long n, char // *text ); /* Schreibt Matrix auf Standardausgabe */ extern void DisplayErrorMsg(const char* s); /* Schreibt Fehlermeldung auf Standardausgabe */ -extern void DisplayTimeMsg(const char* s, double d); /* Schreibt Laufzeitmeldung auf Standardausgabe */ #endif From 93dcbb380f69590e6255c89c0ece64de4f24c9ef Mon Sep 17 00:00:00 2001 From: Wenqing Wang Date: Fri, 1 Feb 2019 10:31:51 +0100 Subject: [PATCH 2/5] [Display.h/cpp] Give a namespace for the functions. --- Base/display.cpp | 3 + Base/display.h | 17 +- FEM/DUMUX.cpp | 6 +- FEM/Eclipse.cpp | 28 ++-- FEM/Material/Solid/BGRaCreep.cpp | 2 +- FEM/files0.cpp | 4 +- FEM/mathlib.cpp | 20 +-- FEM/matrix_routines.cpp | 140 ++++++++-------- FEM/pcs_dm.cpp | 6 +- FEM/problem.cpp | 12 +- FEM/rf_REACT_BRNS.cpp | 10 +- FEM/rf_REACT_GEM.cpp | 4 +- FEM/rf_bc_new.cpp | 4 +- FEM/rf_ic_new.cpp | 4 +- FEM/rf_kinreact.cpp | 24 +-- FEM/rf_mmp_new.cpp | 48 +++--- FEM/rf_num_new.cpp | 22 +-- FEM/rf_pcs.cpp | 20 +-- FEM/rf_react.cpp | 180 ++++++++++----------- FEM/rf_react_int.cpp | 2 +- FEM/rf_st_new.cpp | 4 +- FEM/rf_tim_new.cpp | 14 +- FEM/rfmat_cp.cpp | 70 ++++---- FEM/solver.cpp | 234 +++++++++++++-------------- FEM/tools.cpp | 80 ++++----- FileIO/FEMIO/BoundaryConditionIO.cpp | 4 +- 26 files changed, 483 insertions(+), 479 deletions(-) diff --git a/Base/display.cpp b/Base/display.cpp index d029da73b..7e33aebac 100644 --- a/Base/display.cpp +++ b/Base/display.cpp @@ -28,6 +28,8 @@ extern FILE* OpenMsgFile(void); extern void CloseMsgFile(FILE*); +namespace Display +{ /**************************************************************************/ /* ROCKFLOW - Funktion: DisplayMsg */ @@ -181,3 +183,4 @@ void DisplayErrorMsg(const char* s) fprintf(f, "\n!!!!!!!! %s\n\n ", s); CloseMsgFile(f); } +} // End of name space. diff --git a/Base/display.h b/Base/display.h index 02c81ec89..581f216ef 100644 --- a/Base/display.h +++ b/Base/display.h @@ -26,21 +26,22 @@ #include //#include +namespace Display +{ /*JT: Send output message*/ -extern void ScreenMessage(const char *format , ... ); +void ScreenMessage(const char *format , ... ); /* Gibt Programm-Abspann aus */ -extern void DisplayMsg(const char* s); +void DisplayMsg(const char* s); /* Schreibt Zeichenkette ohne Zeilenvorschub auf Standardausgabe */ -extern void DisplayMsgLn(const char* s); +void DisplayMsgLn(const char* s); /* Schreibt Zeichenkette mit Zeilenruecklauf auf Standardausgabe */ -extern void DisplayDouble(double x, int i, int j); +void DisplayDouble(double x, int i, int j); /* Schreibt Double-Wert ohne Zeilenvorschub auf Standardausgabe */ -extern void DisplayLong(long x); +void DisplayLong(long x); /* Schreibt Vektor auf Standardausgabe */ // OK411 extern void DisplayDoubleMatrix ( double *mat, long m, long n, char // *text ); /* Schreibt Matrix auf Standardausgabe */ -extern void DisplayErrorMsg(const char* s); -/* Schreibt Fehlermeldung auf Standardausgabe */ -/* Schreibt Laufzeitmeldung auf Standardausgabe */ +void DisplayErrorMsg(const char* s); +} #endif diff --git a/FEM/DUMUX.cpp b/FEM/DUMUX.cpp index ea70df238..2623d705c 100644 --- a/FEM/DUMUX.cpp +++ b/FEM/DUMUX.cpp @@ -395,7 +395,7 @@ int CDUMUXData::WriteInputForDuMux(CRFProcess* m_pcs, DOScommand = "rm " + Folder + "/dataForDumux.dat"; if (system(DOScommand.c_str())) - DisplayMsgLn("Could not delete input file! "); + Display::DisplayMsgLn("Could not delete input file! "); // Read length of current timestep and recalculate it to days if (m_pcs->Tim->time_unit == "DAY") @@ -1467,7 +1467,7 @@ void CDUMUXData::ExecuteDuMux(CRFProcess* m_pcs, string folder) cout << tempstring << "\n"; if (system(tempstring.c_str())) { - DisplayMsgLn("Warnung: DuMux doesn't run properly!!! "); + Display::DisplayMsgLn("Warnung: DuMux doesn't run properly!!! "); exit(0); } } @@ -1550,7 +1550,7 @@ int CDUMUXData::RunDuMux(long Timestep, CRFProcess* m_pcs) DOScommand = "rm " + folder + "dataForGeoSys*.dat"; if (system(DOScommand.c_str())) - DisplayMsgLn("Could not delete input file! "); + Display::DisplayMsgLn("Could not delete input file! "); } // check if dumux folder is subfolder of the geosys folder diff --git a/FEM/Eclipse.cpp b/FEM/Eclipse.cpp index 81273186f..c552f2cec 100644 --- a/FEM/Eclipse.cpp +++ b/FEM/Eclipse.cpp @@ -5448,7 +5448,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring << "\n"; if (system(tempstring.c_str())) { - DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5461,7 +5461,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring = EclipseExe + " " + projectname; if (system(tempstring.c_str())) { - DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5529,7 +5529,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring << "\n"; if (system(tempstring.c_str())) { - DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5544,7 +5544,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring = EclipseExe + " " + projectname; //WTP if (system(tempstring.c_str())) { - DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5586,13 +5586,13 @@ bool CECLIPSEData::CleanUpEclipseFiles(std::string folder, systemcommand = system_delete + folder + "TEMPORARYRESULTS.*"; if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not delete temporary result files! "); + Display::DisplayMsgLn("Could not delete temporary result files! "); // SB why return return 0; } /* systemcommand = system_delete + projectname + ".FSAVE" + system_noquery; if (system(systemcommand.c_str())){ - // DisplayMsgLn("Could not delete result .FSAVE files! "); + // Display::DisplayMsgLn("Could not delete result .FSAVE files! "); //SB ?? why return return 0; } */ @@ -5623,7 +5623,7 @@ bool CECLIPSEData::CleanUpEclipseFiles(std::string folder, } if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not rename the temporary result files .F*! "); + Display::DisplayMsgLn("Could not rename the temporary result files .F*! "); // return 0; } if (this->Windows_System == false) @@ -5631,44 +5631,44 @@ bool CECLIPSEData::CleanUpEclipseFiles(std::string folder, systemcommand = "rm " + projectname + extension; if (system(systemcommand.c_str())) { - DisplayMsgLn( + Display::DisplayMsgLn( "Could not delete the temporary result files basename.F*! "); // return 0; } } // systemcommand = system_delete + projectname + ".F*" + system_noquery; // if (system(systemcommand.c_str())){ - // DisplayMsgLn("Could not delete result files! "); + // Display::DisplayMsgLn("Could not delete result files! "); // return 0; //} systemcommand = system_delete + projectname + ".A*" + system_noquery; if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not delete result files .A*! "); + Display::DisplayMsgLn("Could not delete result files .A*! "); // return 0; } systemcommand = system_delete + projectname + ".P*" + system_noquery; if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not delete result files .P*! "); + Display::DisplayMsgLn("Could not delete result files .P*! "); // return 0; } systemcommand = system_delete + projectname + ".R*" + system_noquery; if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not delete result files .R*! "); + Display::DisplayMsgLn("Could not delete result files .R*! "); // return 0; } systemcommand = system_delete + projectname + ".M*" + system_noquery; if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not delete result files .M*! "); + Display::DisplayMsgLn("Could not delete result files .M*! "); // return 0; } systemcommand = system_delete + projectname + ".DB*" + system_noquery; if (system(systemcommand.c_str())) { - DisplayMsgLn("Could not delete result files .DB*! "); + Display::DisplayMsgLn("Could not delete result files .DB*! "); // return 0; } diff --git a/FEM/Material/Solid/BGRaCreep.cpp b/FEM/Material/Solid/BGRaCreep.cpp index 1d321ddcc..6d5fe4f9c 100644 --- a/FEM/Material/Solid/BGRaCreep.cpp +++ b/FEM/Material/Solid/BGRaCreep.cpp @@ -163,7 +163,7 @@ void BGRaCreep::integrateStress(const double dt, const double T, if (it == _max_iterations - 1) { - ScreenMessage( + Display::ScreenMessage( "The local Newton method did not converge within the given " "number of iterations. Iteration: %d, residual norm: " "%g", diff --git a/FEM/files0.cpp b/FEM/files0.cpp index 38f311439..60190f4c9 100644 --- a/FEM/files0.cpp +++ b/FEM/files0.cpp @@ -215,7 +215,7 @@ int ReadData(const char* dateiname, // Check line ending of input files if (!checkFormatOfInputFiles(dateiname)) { - ScreenMessage("terminate this program"); + Display::ScreenMessage("terminate this program"); exit(0); } //---------------------------------------------------------------------- @@ -340,7 +340,7 @@ void CloseMsgFile(FILE* f) { if (f != stdout) if (fclose(f)) - DisplayErrorMsg( + Display::DisplayErrorMsg( "Fehler: Message-Protokolldatei konnte nicht geschlossen " "werden !!"); } diff --git a/FEM/mathlib.cpp b/FEM/mathlib.cpp index e903a53b9..f025dd497 100644 --- a/FEM/mathlib.cpp +++ b/FEM/mathlib.cpp @@ -682,7 +682,7 @@ double* MMachVec(long g) zwerg = (double*)Malloc(sizeof(double) * g); #ifdef ERROR_CONTROL if (zwerg == NULL) - DisplayErrorMsg("zuwenig Speicher in MMachVec"); + Display::DisplayErrorMsg("zuwenig Speicher in MMachVec"); #endif return zwerg; } /* MMachVec */ @@ -708,7 +708,7 @@ void MNullVec(double* zwerg, long g) zwerg = (double*)Malloc(sizeof(double) * g); #ifdef ERROR_CONTROL if (zwerg == NULL) - DisplayErrorMsg("Fehler in MNullVec"); + Display::DisplayErrorMsg("Fehler in MNullVec"); #endif #ifdef SX #pragma cdir nodep @@ -742,7 +742,7 @@ void MKopierVec(double* vecquelle, double* vecziel, long g) register long i; #ifdef ERROR_CONTROL if ((vecquelle == NULL) || (vecziel == NULL)) - DisplayErrorMsg("Fehler in MLoeschVec"); + Display::DisplayErrorMsg("Fehler in MLoeschVec"); #endif #ifdef SX #pragma cdir nodep @@ -861,10 +861,10 @@ int MMultVecVec(double* vec1, long gv1, double* vec2, long gv2, double* mato, if (check_err) { if (gv1 != mo) - DisplayErrorMsg( + Display::DisplayErrorMsg( "MMultVecVec: Groesse von Matrix und Vektor 1 passen nicht"); if (gv2 != no) - DisplayErrorMsg( + Display::DisplayErrorMsg( "MMultVecVec: Groesse von Matrix und Vektor 2 passen nicht"); } @@ -920,10 +920,10 @@ int MMultVecMat(double* vec, long gv, double* mat, long m, long n, double* veco, if (check_err) { if (gv != m) - DisplayErrorMsg( + Display::DisplayErrorMsg( "MMultVecMat: Groesse von Matrix und Vektor passen nicht"); if (go != n) - DisplayErrorMsg( + Display::DisplayErrorMsg( "MMultVecMat: Groesse von Ergebnis-Vektor stimmt nicht"); } @@ -982,10 +982,10 @@ int MMultMatVec(/* Matrix */ if (check_err) { if (g != n) - DisplayErrorMsg( + Display::DisplayErrorMsg( "MMultMatVec: Groesse von Matrix und Vektor passen nicht"); if (r != m) - DisplayErrorMsg( + Display::DisplayErrorMsg( "MMultMatVec: Groesse von Ergebnis-Vektor stimmt nicht"); } @@ -1058,7 +1058,7 @@ int MMultMatMat(double* mat1, long m1, long n1, double* mat2, long m2, long n2, #ifdef ERROR_CONTROL if ((m1 != mo) || (n2 != no) || (n1 != m2)) { - DisplayErrorMsg("MMultMatMat:Die Matrizen passen nicht zueinander !"); + Display::DisplayErrorMsg("MMultMatMat:Die Matrizen passen nicht zueinander !"); return 0; } #endif diff --git a/FEM/matrix_routines.cpp b/FEM/matrix_routines.cpp index 3cb1e40c8..90c4101aa 100644 --- a/FEM/matrix_routines.cpp +++ b/FEM/matrix_routines.cpp @@ -317,7 +317,7 @@ void MX_Exit(const char* caller, int errcode) strcat(text, "Argumente falsch"); break; } - DisplayErrorMsg(strcat(text, " -> Abbruch!")); + Display::DisplayErrorMsg(strcat(text, " -> Abbruch!")); exit(1); } @@ -725,25 +725,25 @@ void* M2DestroyMatrix(void) zaehler += ((Zeil2(j).max_anz - sp2_start) / sp2_inc); } } - DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); - DisplayMsg(" - max. Dimension des Gleichungssystems: "); - DisplayLong(w->max_size); - DisplayMsgLn(""); - DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); - DisplayLong((long)sp2_start); - DisplayMsgLn(""); - DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); - DisplayLong((long)sp2_inc); - DisplayMsgLn(""); - DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); - DisplayLong(anz_inc); - DisplayMsgLn(""); - DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); - DisplayLong(max_inc); - DisplayMsgLn(""); - DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); - DisplayLong(zaehler); - DisplayMsgLn(""); + Display::DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); + Display::DisplayMsg(" - max. Dimension des Gleichungssystems: "); + Display::DisplayLong(w->max_size); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); + Display::DisplayLong((long)sp2_start); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); + Display::DisplayLong((long)sp2_inc); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); + Display::DisplayLong(anz_inc); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); + Display::DisplayLong(max_inc); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); + Display::DisplayLong(zaehler); + Display::DisplayMsgLn(""); } #endif @@ -777,25 +777,25 @@ void* M34DestroyMatrix(void) zaehler += (Sp34(j).max_anz - sp2_start) / sp2_inc; } } - DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); - DisplayMsg(" - max. Dimension des Gleichungssystems: "); - DisplayLong(w->max_size); - DisplayMsgLn(""); - DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); - DisplayLong((long)sp2_start); - DisplayMsgLn(""); - DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); - DisplayLong((long)sp2_inc); - DisplayMsgLn(""); - DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); - DisplayLong(anz_inc); - DisplayMsgLn(""); - DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); - DisplayLong(max_inc); - DisplayMsgLn(""); - DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); - DisplayLong(zaehler); - DisplayMsgLn(""); + Display::DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); + Display::DisplayMsg(" - max. Dimension des Gleichungssystems: "); + Display::DisplayLong(w->max_size); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); + Display::DisplayLong((long)sp2_start); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); + Display::DisplayLong((long)sp2_inc); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); + Display::DisplayLong(anz_inc); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); + Display::DisplayLong(max_inc); + Display::DisplayMsgLn(""); + Display::DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); + Display::DisplayLong(zaehler); + Display::DisplayMsgLn(""); } #endif @@ -3079,11 +3079,11 @@ void M1Vorkond(int aufgabe, double* x, double* b) } else { - DisplayMsg("!!! Equation system: Line: "); - DisplayLong(i); - DisplayMsg(" Value: "); - DisplayDouble(Aik1(i, i), 0, 0); - DisplayMsgLn( + Display::DisplayMsg("!!! Equation system: Line: "); + Display::DisplayLong(i); + Display::DisplayMsg(" Value: "); + Display::DisplayDouble(Aik1(i, i), 0, 0); + Display::DisplayMsgLn( "!!! Diagonal near zero! Disable diagonal " "preconditioner!"); exit(1); @@ -3230,12 +3230,12 @@ void M2Vorkond(int aufgabe, double* x, double* b) } else { - DisplayMsg("!!! Equation system: Line: "); - DisplayLong(k); - DisplayMsg(" Value: "); - DisplayDouble(Diag2(k), 0, 0); - DisplayMsgLn(""); - DisplayMsgLn( + Display::DisplayMsg("!!! Equation system: Line: "); + Display::DisplayLong(k); + Display::DisplayMsg(" Value: "); + Display::DisplayDouble(Diag2(k), 0, 0); + Display::DisplayMsgLn(""); + Display::DisplayMsgLn( "!!! Diagonal near zero! Disable diagonal " "preconditioner!"); exit(1); @@ -3259,7 +3259,7 @@ void M2Vorkond(int aufgabe, double* x, double* b) case 3: /* Linkstransformationen */ if VK_Modus(VK_iLDU) /* incomplete L(D)U-Zerlegung geht nicht! */ - DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); + Display::DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); //-------------------------------------------------------------------- } //====================================================================== @@ -3309,12 +3309,12 @@ void M34Vorkond(int aufgabe, double* x, double* b) } /* else { - DisplayMsg("!!! Equation system: Line: "); - DisplayLong(k); - DisplayMsg(" Value: "); - DisplayDouble(w -> Diag[k], 0, 0); - DisplayMsgLn(""); - DisplayMsgLn("!!! Diagonal near zero! Disable diagonal + Display::DisplayMsg("!!! Equation system: Line: "); + Display::DisplayLong(k); + Display::DisplayMsg(" Value: "); + Display::DisplayDouble(w -> Diag[k], 0, 0); + Display::DisplayMsgLn(""); + Display::DisplayMsgLn("!!! Diagonal near zero! Disable diagonal preconditioner!"); exit(1); }*/ @@ -3470,12 +3470,12 @@ void M5Vorkond(int aufgabe, double* x, double* b) } else { - DisplayMsg("!!! Equation system: Line: "); - DisplayLong(k); - DisplayMsg(" Value: "); - DisplayDouble(Diag2(k), 0, 0); - DisplayMsgLn(""); - DisplayMsgLn( + Display::DisplayMsg("!!! Equation system: Line: "); + Display::DisplayLong(k); + Display::DisplayMsg(" Value: "); + Display::DisplayDouble(Diag2(k), 0, 0); + Display::DisplayMsgLn(""); + Display::DisplayMsgLn( "!!! Diagonal near zero! Disable diagonal " "preconditioner!"); exit(1); @@ -3523,12 +3523,12 @@ void M5Vorkond(int aufgabe, double* x, double* b) for (i = 0; i < Zeil2(k).anz; i++) Aik2(k, i) *= h; } else { - DisplayMsg("!!! Equation system: Line: "); - DisplayLong(k); - DisplayMsg(" Value: "); - DisplayDouble(Diag2(k), 0, 0); - DisplayMsgLn(""); - DisplayMsgLn("!!! Diagonal near zero! Disable diagonal + Display::DisplayMsg("!!! Equation system: Line: "); + Display::DisplayLong(k); + Display::DisplayMsg(" Value: "); + Display::DisplayDouble(Diag2(k), 0, 0); + Display::DisplayMsgLn(""); + Display::DisplayMsgLn("!!! Diagonal near zero! Disable diagonal preconditioner!"); exit(1); } } @@ -3551,7 +3551,7 @@ void M5Vorkond(int aufgabe, double* x, double* b) case 3: /* Linkstransformationen */ if VK_Modus(VK_iLDU) /* incomplete L(D)U-Zerlegung geht nicht! */ - DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); + Display::DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); //-------------------------------------------------------------------- } //====================================================================== diff --git a/FEM/pcs_dm.cpp b/FEM/pcs_dm.cpp index bb6ca682a..adddc35e9 100644 --- a/FEM/pcs_dm.cpp +++ b/FEM/pcs_dm.cpp @@ -543,7 +543,7 @@ double CRFProcessDeformation::Execute(int loop_process_number) loading 2 //--------------------------------------------------------------------- // InitializeNewtonSteps(1); // u=0 - DisplayMsgLn("\nEvaluate load ratio: "); + Display::DisplayMsgLn("\nEvaluate load ratio: "); PreLoad = 1; GlobalAssembly(); PreLoad = 0; @@ -3127,7 +3127,7 @@ void CRFProcessDeformation::WriteGaussPointStress(const bool last_step) #else const std::string StressFileName = FileName + ".sts"; #endif - ScreenMessage("-> Write initial stress \n"); + Display::ScreenMessage("-> Write initial stress \n"); fstream file_stress(StressFileName.data(), ios::binary | ios::out | ios::trunc); ElementValue_DM* eleV_DM = NULL; @@ -3183,7 +3183,7 @@ void CRFProcessDeformation::ReadGaussPointStress() const std::string StressFileName = FileName + ".sts"; #endif - ScreenMessage("-> Read initial stress \n"); + Display::ScreenMessage("-> Read initial stress \n"); fstream file_stress(StressFileName.data(), ios::binary | ios::in); ElementValue_DM* eleV_DM = NULL; // diff --git a/FEM/problem.cpp b/FEM/problem.cpp index 8ce858270..b5ca5a604 100644 --- a/FEM/problem.cpp +++ b/FEM/problem.cpp @@ -1183,7 +1183,7 @@ void Problem::Euler_TimeDiscretize() // CTimeDiscretization* m_tim = NULL; aktueller_zeitschritt = 0; - ScreenMessage("\n\n***Start time steps\n"); + Display::ScreenMessage("\n\n***Start time steps\n"); // // Output zero time initial values #if defined(USE_MPI) || defined(USE_MPI_KRC) @@ -1230,7 +1230,7 @@ void Problem::Euler_TimeDiscretize() if (!last_dt_accepted && dt == previous_rejected_dt) { - ScreenMessage( + Display::ScreenMessage( "Stop this simulation. New time step size is same as the " "rejected one.\n"); break; @@ -1284,7 +1284,7 @@ void Problem::Euler_TimeDiscretize() defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) if (mrank == 0) #endif - ScreenMessage("This step is accepted.\n"); + Display::ScreenMessage("This step is accepted.\n"); PostCouplingLoop(); if (print_result) { @@ -1312,7 +1312,7 @@ void Problem::Euler_TimeDiscretize() } else if (isSteadySimulation) { - ScreenMessage( + Display::ScreenMessage( "This time step is rejected. We stop the simulation because " "this is steady state simulation.\n"); break; @@ -1323,7 +1323,7 @@ void Problem::Euler_TimeDiscretize() // TIME STEP FAILED // --------------------------------- last_dt_accepted = false; - ScreenMessage( + Display::ScreenMessage( "This step is rejected: Redo, with a new time step.\n"); rejected_times++; current_time -= dt; @@ -1364,7 +1364,7 @@ void Problem::Euler_TimeDiscretize() } } } - ScreenMessage( + Display::ScreenMessage( "\n#############################################################" "\n"); if (aktueller_zeitschritt >= max_time_steps) diff --git a/FEM/rf_REACT_BRNS.cpp b/FEM/rf_REACT_BRNS.cpp index b6607b263..7e4155be3 100644 --- a/FEM/rf_REACT_BRNS.cpp +++ b/FEM/rf_REACT_BRNS.cpp @@ -220,7 +220,7 @@ void REACT_BRNS::InitBRNS(Problem* myProblem) AfxMessageBox( "!!! Node number and Components Number must be bigger than zero!"); #endif - DisplayErrorMsg( + Display::DisplayErrorMsg( "!!! Node number and Components Number must be bigger than zero!"); abort(); } @@ -265,7 +265,7 @@ void REACT_BRNS::InitBRNS(Problem* myProblem) // end of if (this_pcs) else // not getting the pointer to the proper PCS. { - DisplayErrorMsg( + Display::DisplayErrorMsg( "!!! In InitBRNS, can not find corresponding PCS!"); abort(); } @@ -339,7 +339,7 @@ void REACT_BRNS::GSRF2Buffer(long i) "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); #endif - DisplayErrorMsg( + Display::DisplayErrorMsg( "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); abort(); @@ -373,7 +373,7 @@ void REACT_BRNS::Buffer2GSRF(long i) "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); #endif - DisplayErrorMsg( + Display::DisplayErrorMsg( "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); abort(); @@ -689,7 +689,7 @@ int REACT_BRNS::SetPorosityValue_MT(long ele_Index, #ifdef USE_MPI_BRNS if (myrank == 0 /*should be set to root*/) #endif - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: Not implemented for the flow in BRNS case!!!"); break; } diff --git a/FEM/rf_REACT_GEM.cpp b/FEM/rf_REACT_GEM.cpp index a44fc6bda..2478e4f0e 100644 --- a/FEM/rf_REACT_GEM.cpp +++ b/FEM/rf_REACT_GEM.cpp @@ -1704,12 +1704,12 @@ short REACT_GEM::GetSoComponentValue_MT(long node_Index, int timelevel, node_Index, m_pcs->GetNodeValueIndex(str) + timelevel); else { - // DisplayErrorMsg("Error: Corresponding Component NOT FOUND in + // Display::DisplayErrorMsg("Error: Corresponding Component NOT FOUND in // GEM part!!"); return 0; } } } - // DisplayErrorMsg("Error: MASS TRANSPORT NOT FOUND!!"); + // Display::DisplayErrorMsg("Error: MASS TRANSPORT NOT FOUND!!"); return 1; } /* diff --git a/FEM/rf_bc_new.cpp b/FEM/rf_bc_new.cpp index e05b61f66..345971c30 100644 --- a/FEM/rf_bc_new.cpp +++ b/FEM/rf_bc_new.cpp @@ -276,7 +276,7 @@ std::ios::pos_type CBoundaryCondition::Read(std::ifstream* bc_file, } else { - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: In reading BC file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -309,7 +309,7 @@ std::ios::pos_type CBoundaryCondition::Read(std::ifstream* bc_file, } else { - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: In reading BC file, the input component names " "are not found in MCP file!!!"); exit(1); diff --git a/FEM/rf_ic_new.cpp b/FEM/rf_ic_new.cpp index b70531fb1..891b8693b 100644 --- a/FEM/rf_ic_new.cpp +++ b/FEM/rf_ic_new.cpp @@ -278,7 +278,7 @@ ios::pos_type CInitialCondition::Read(std::ifstream* ic_file, } else { - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: In reading IC file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -309,7 +309,7 @@ ios::pos_type CInitialCondition::Read(std::ifstream* ic_file, } else { - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: In reading BC file, the input component names are " "not found in MCP file!!!"); exit(1); diff --git a/FEM/rf_kinreact.cpp b/FEM/rf_kinreact.cpp index b145ad4f4..bf95ba414 100644 --- a/FEM/rf_kinreact.cpp +++ b/FEM/rf_kinreact.cpp @@ -290,7 +290,7 @@ bool MicrobeData::Read(ifstream* rfd_file) _drmc_ = true; else { - DisplayMsgLn(" ERROR reading Microbe _drmc_ Terms - skipping"); + Display::DisplayMsgLn(" ERROR reading Microbe _drmc_ Terms - skipping"); return false; } in.clear(); @@ -1760,7 +1760,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, monod.push_back(m_monod); else { - DisplayMsgLn(" ERROR reading Monod Terms - skipping"); + Display::DisplayMsgLn(" ERROR reading Monod Terms - skipping"); number_monod--; delete m_monod; } @@ -1809,7 +1809,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, } } else - DisplayMsgLn(" ERROR reading Threshhold Terms - skipping"); + Display::DisplayMsgLn(" ERROR reading Threshhold Terms - skipping"); in.clear(); } //.................................................................... @@ -1842,7 +1842,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, else { delete m_inhibit; // CB_merge_0513 ?? - DisplayMsgLn(" ERROR reading Inhibition Terms - skipping"); + Display::DisplayMsgLn(" ERROR reading Inhibition Terms - skipping"); number_inhibit--; } @@ -1877,7 +1877,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, production.push_back(m_production); else { - DisplayMsgLn(" ERROR reading Production Terms - skipping"); + Display::DisplayMsgLn(" ERROR reading Production Terms - skipping"); number_production--; } in.clear(); @@ -2231,7 +2231,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, speciesname = "NIX"; } else - DisplayMsgLn( + Display::DisplayMsgLn( " ERROR reading Mechanism Species - skipping"); in.clear(); } @@ -2240,7 +2240,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, } // successfull read else { - DisplayMsgLn(" ERROR reading Mechanism Terms - skipping"); + Display::DisplayMsgLn(" ERROR reading Mechanism Terms - skipping"); number_Mech--; delete m_mech; } @@ -2628,7 +2628,7 @@ void CKinReact::ReadReactionEquation(string line_string_all) partners = 0; ih1 = (int)line_string.find(" = "); if (ih1 < 0) - DisplayMsgLn(" Error in keyword REACTION"); + Display::DisplayMsgLn(" Error in keyword REACTION"); // Exception handling while (indexhigh < linelength) { @@ -8421,14 +8421,14 @@ void CKinReactData::PreprocessMinKin() break; case 1: /* DH*/ if (Imax > 0.1) - DisplayMsgLn( + Display::DisplayMsgLn( "Warning in CKinReactData::PreprocessMinkin(): I > 0.1 " "--> use of DH activity model is not " "recomended!"); break; case 2: /* Davies*/ if (Imin < 0.1) - DisplayMsgLn( + Display::DisplayMsgLn( "Warning in CKinReactData::PreprocessMinkin(): I < 0.1 " "--> use of Davies activity model is not " "recomended!"); @@ -8436,7 +8436,7 @@ void CKinReactData::PreprocessMinKin() case 3: /* CHEMAPP*/ break; default: - DisplayMsgLn( + Display::DisplayMsgLn( "Unknown activity model in " "CKinReactData::PreprocessMinkin()!"); break; @@ -8605,7 +8605,7 @@ void CKinReactData::PreprocessMinKin() #endif break; default: - DisplayMsgLn( + Display::DisplayMsgLn( "Unknown activity model in CKinReactData::PreprocessMinkin()!"); break; } /* switch */ diff --git a/FEM/rf_mmp_new.cpp b/FEM/rf_mmp_new.cpp index fe5d43c08..013c800af 100644 --- a/FEM/rf_mmp_new.cpp +++ b/FEM/rf_mmp_new.cpp @@ -812,7 +812,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) { if (!PCSGet("DEFORMATION")) { - ScreenMessage( + Display::ScreenMessage( "Error: Porosity model 7 must be combined with " "deformation process"); exit(EXIT_FAILURE); @@ -1154,7 +1154,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) case 2: // krg = 1.0 - krl (only for gas phase) if (k == 0) { - ScreenMessage( + Display::ScreenMessage( "ERROR in MMPRead: Relative permeability model " "2 is only valid for the gas phase.\n"); exit(0); @@ -1308,7 +1308,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) // default: { - ScreenMessage( + Display::ScreenMessage( "Error in MMPRead: no valid permeability " "saturation model.\n"); abort(); @@ -1685,7 +1685,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) if (capillary_pressure_values[2] >= 0.0) { // Then a constant saturation value has been entered. // This is model #2. - ScreenMessage( + Display::ScreenMessage( "WARNING in MMPRead. Capillary pressure model 1 " "used for a constant saturation. THIS IS " "NOW MODEL #2. PLEASE SWITCH TO MODEL #2.\n"); @@ -1772,7 +1772,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) in >> capillary_pressure_values[0]; // Pb break; default: - ScreenMessage( + Display::ScreenMessage( "Error in MMPRead: no valid capillary pressure " "model.\n"); exit(1); @@ -1780,13 +1780,13 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) } if (old_format) { - ScreenMessage( + Display::ScreenMessage( "\n--\n Adopting capillary pressure saturation parameters " "from the\n"); - ScreenMessage( + Display::ScreenMessage( " relative permeability function for phase 0. " "Alternatively, you\n"); - ScreenMessage( + Display::ScreenMessage( " may enter capillary pressure specific parameters " "directly.\n--/n"); } @@ -2506,7 +2506,7 @@ double CMediumProperties::PermeabilitySaturationFunction( switch (model) { default: - ScreenMessage( + Display::ScreenMessage( "ERROR in PermeabilitySaturationFunction(): Unrecognized " "relative permeability method.\n"); exit(0); @@ -2526,7 +2526,7 @@ double CMediumProperties::PermeabilitySaturationFunction( case 2: // krg = 1.0 - krl // No need to come here. Method will have been shifted to the liquid // phase. - ScreenMessage( + Display::ScreenMessage( "ERROR in PermeabilitySaturationFunction(). Shouldn't be " "here.\n"); break; @@ -4352,7 +4352,7 @@ double CMediumProperties::Porosity(CElement* assem) #endif default: - DisplayMsgLn("Unknown porosity model!"); + Display::DisplayMsgLn("Unknown porosity model!"); break; } //---------------------------------------------------------------------- @@ -5153,7 +5153,7 @@ double CMediumProperties::CapillaryPressureFunction( switch (capillary_pressure_model) { default: - ScreenMessage( + Display::ScreenMessage( "Error in CFluidProperties::CapillaryPressure: no valid " "material model.\n"); exit(0); @@ -5170,8 +5170,8 @@ double CMediumProperties::CapillaryPressureFunction( // case 2: // Constant saturation for pp models (for WX, from JT) (MUST BE // A PP MODEL, SO WON'T COME HERE) - ScreenMessage("ERROR: in CFluidProperties::CapillaryPressure:"); - ScreenMessage( + Display::ScreenMessage("ERROR: in CFluidProperties::CapillaryPressure:"); + Display::ScreenMessage( "Constant saturation is not possible for a PS model " "(PwSnw).\n"); exit(0); @@ -5232,7 +5232,7 @@ double CMediumProperties::SaturationCapillaryPressureFunction( switch (capillary_pressure_model) { default: - ScreenMessage( + Display::ScreenMessage( "Error in " "CFluidProperties::SaturationCapillaryPressureFunction: no " "valid material model.\n"); @@ -5249,10 +5249,10 @@ double CMediumProperties::SaturationCapillaryPressureFunction( break; // case 1: // Constant capillary pressure for ps models - ScreenMessage( + Display::ScreenMessage( "ERROR: in " "CFluidProperties::SaturationCapillaryPressureFunction:"); - ScreenMessage( + Display::ScreenMessage( "Constant capillary pressure is not possible for a pressure " "model (PcPnw, PwPnw, or Richards).\n"); exit(0); @@ -5341,7 +5341,7 @@ Richard's flow) return 0.0; switch(capillary_pressure_model) { default: - ScreenMessage("Error in + Display::ScreenMessage("Error in CFluidProperties::SaturationPressureDependency: no valid material model.\n"); exit(0); break; @@ -5413,7 +5413,7 @@ double CMediumProperties::PressureSaturationDependency( switch (capillary_pressure_model) { default: - ScreenMessage( + Display::ScreenMessage( "Error in CFluidProperties::PressureSaturationDependency: no " "valid material model.\n"); exit(0); @@ -6302,7 +6302,7 @@ double GetAverageHetVal2(long EleIndex, { ihet = GetNearestHetVal2(EleIndex, m_msh, xvals, yvals, zvals, mmpvals); if (ihet < 0) - DisplayMsgLn(" Error getting nearest het_value location"); + Display::DisplayMsgLn(" Error getting nearest het_value location"); else average = mmpvals[ihet]; } @@ -7316,7 +7316,7 @@ double CMediumProperties::TortuosityFunction(long number, double* gp, tortuosity = Porosity(number, theta) * tortuosity_model_values[0]; break; default: - DisplayMsgLn("Unknown tortuosisty model!"); + Display::DisplayMsgLn("Unknown tortuosisty model!"); break; } return tortuosity; @@ -7994,7 +7994,7 @@ double CMediumProperties::StorageFunction(long index, double* gp, double theta) << std::endl; break; default: - storage = 0.0; // OK DisplayMsgLn("The requested storativity model + storage = 0.0; // OK Display::DisplayMsgLn("The requested storativity model // is unknown!!!"); break; } @@ -8146,8 +8146,8 @@ double CMediumProperties::PermeabilityPressureFunction(long index, double* gp, switch (ElGetElementType(index)) { default: - DisplayMsgLn("Error in GetSoilRelPermPress!"); - DisplayMsgLn(" Nonlinear permeability not available!"); + Display::DisplayMsgLn("Error in GetSoilRelPermPress!"); + Display::DisplayMsgLn(" Nonlinear permeability not available!"); abort(); case 2: Calc2DElementJacobiMatrix(index, 0.0, 0.0, invjac, &detjac); diff --git a/FEM/rf_num_new.cpp b/FEM/rf_num_new.cpp index 232dda4e1..6f6674e44 100644 --- a/FEM/rf_num_new.cpp +++ b/FEM/rf_num_new.cpp @@ -453,7 +453,7 @@ ios::pos_type CNumerics::Read(ifstream* num_file) break; // default: - ScreenMessage( + Display::ScreenMessage( "ERROR in NUMRead. Invalid non-linear iteration error " "method selected.\n"); exit(1); @@ -472,13 +472,13 @@ ios::pos_type CNumerics::Read(ifstream* num_file) } else if (line_string.find("$NON_LINEAR_SOLVER") != string::npos) { - ScreenMessage(" --\n Using old $NON_LINEAR_SOLVER keyword.\n"); - ScreenMessage( + Display::ScreenMessage(" --\n Using old $NON_LINEAR_SOLVER keyword.\n"); + Display::ScreenMessage( " Eventually this will be obsolete. Consider switching to\n"); - ScreenMessage( + Display::ScreenMessage( " $NON_LINEAR_ITERATIONS for better results and greater " "flexibility.\n"); - ScreenMessage(" --\n"); + Display::ScreenMessage(" --\n"); // // JT: in >> method_name // in >> tolerance @@ -551,8 +551,8 @@ ios::pos_type CNumerics::Read(ifstream* num_file) // JT subkeyword found if (line_string.find("$COUPLING_ITERATIONS") != string::npos) { - ScreenMessage("$COUPLING_ITERATIONS keyword obsolete.\n"); - ScreenMessage( + Display::ScreenMessage("$COUPLING_ITERATIONS keyword obsolete.\n"); + Display::ScreenMessage( "Use $COUPLING_CONTROL and $COUPLED_PROCESS for process " "couplings.\n"); exit(1); @@ -599,17 +599,17 @@ ios::pos_type CNumerics::Read(ifstream* num_file) break; // case FiniteElement::BNORM: - ScreenMessage( + Display::ScreenMessage( "ERROR in NUMRead. BNORM not configured for process " "couplings.\n"); - ScreenMessage( + Display::ScreenMessage( "We suggest ENORM as a valid companion for NEWTON " "couplings.\n"); exit(1); break; // default: - ScreenMessage( + Display::ScreenMessage( "ERROR in NUMRead. Invalid coupling error method " "selected.\n"); exit(1); @@ -647,7 +647,7 @@ ios::pos_type CNumerics::Read(ifstream* num_file) } else { - ScreenMessage( + Display::ScreenMessage( "WARNING. $COUPLED_PROCESS keyword encountered, but a " "valid process OR primary variable was not " "found.\n"); diff --git a/FEM/rf_pcs.cpp b/FEM/rf_pcs.cpp index e4c254099..80ebc7beb 100644 --- a/FEM/rf_pcs.cpp +++ b/FEM/rf_pcs.cpp @@ -573,10 +573,10 @@ CRFProcess::~CRFProcess(void) #endif if (_init_domain_data_type == FiniteElement::READ) { - ScreenMessage( + Display::ScreenMessage( "!!!Waning: Reading and writing solutions (reload=3)\ are selected in this computation.\n"); - ScreenMessage( + Display::ScreenMessage( "\t Please make sure that the original initial\ data files are used.\n"); } @@ -1086,7 +1086,7 @@ void CRFProcess::SetBoundaryConditionAndSourceTerm() { const int DOF = GetPrimaryVNumber(); // BC - create BC groups for each process - ScreenMessage("-> Create BC\n"); + Display::ScreenMessage("-> Create BC\n"); CBoundaryConditionsGroup* m_bc_group = NULL; // 25.08.2011. WW @@ -1130,7 +1130,7 @@ void CRFProcess::SetBoundaryConditionAndSourceTerm() Write_Processed_BC(); } // ST - create ST groups for each process - ScreenMessage("-> Create ST\n"); + Display::ScreenMessage("-> Create ST\n"); CSourceTermGroup* m_st_group = NULL; if (WriteSourceNBC_RHS == 2) // Read from file @@ -5217,7 +5217,7 @@ void CRFProcess::CalculateElementMatrices(void) case 66: // OF break; default: - DisplayMsgLn( + Display::DisplayMsgLn( "CalculateElementMatrices: no CalculateElementMatrices " "specified"); abort(); @@ -6374,7 +6374,7 @@ void CRFProcess::AssembleSystemMatrixNew(void) // SMAssembleMatrix(eqs->b,eqs->x,ddummy,this); break; default: - DisplayMsgLn( + Display::DisplayMsgLn( "CalculateElementMatrices: no CalculateElementMatrices " "specified"); abort(); @@ -8690,7 +8690,7 @@ void CRFProcess::PCSMoveNOD(void) MSHMoveNODUcFlow(this); break; default: - DisplayMsgLn("PCSMoveNOD: no valid process"); + Display::DisplayMsgLn("PCSMoveNOD: no valid process"); abort(); } } @@ -8864,14 +8864,14 @@ string GetPFNamebyCPName(string inname) int GetRFProcessNumPhases(void) { - // DisplayMsgLn("GetRFProcessNumPhases - to be removed"); + // Display::DisplayMsgLn("GetRFProcessNumPhases - to be removed"); int no_phases = (int)mfp_vector.size(); return no_phases; } long GetRFProcessNumComponents(void) { - // DisplayMsgLn("GetRFProcessNumComponents - to be removed"); + // Display::DisplayMsgLn("GetRFProcessNumComponents - to be removed"); int no_components = (int)cp_vec.size(); return no_components; } @@ -9467,7 +9467,7 @@ double CRFProcess::CalcIterationNODError(FiniteElement::ErrorMethod method, break; // default: - ScreenMessage( + Display::ScreenMessage( "ERROR: Invalid error method for Iteration or Coupling Node " "error.\n"); return 0.0; diff --git a/FEM/rf_react.cpp b/FEM/rf_react.cpp index a937113d8..8dc17a3d1 100644 --- a/FEM/rf_react.cpp +++ b/FEM/rf_react.cpp @@ -100,7 +100,7 @@ void REACT::ExecuteReactionsPHREEQC(void) FILE *indatei, *fphinp, *fsel_out = NULL; char fsout[80]; - DisplayMsgLn("ExecuteReactionsPHREEQC:"); + Display::DisplayMsgLn("ExecuteReactionsPHREEQC:"); /* Initialize arrays of concentrations and array for reaction rates (list, * in pretimeloop)*/ @@ -142,7 +142,7 @@ void REACT::ExecuteReactionsPHREEQC(void) } else { - DisplayMsgLn("The file phinput.dat could not be opened !"); + Display::DisplayMsgLn("The file phinput.dat could not be opened !"); exit(1); } @@ -156,14 +156,14 @@ void REACT::ExecuteReactionsPHREEQC(void) fsel_out = fopen(fsout, "r"); if ((ok) && !fsel_out) { - DisplayMsgLn("The selected output file doesn't exist!!!"); + Display::DisplayMsgLn("The selected output file doesn't exist!!!"); exit(1); } else if (ok) { ok = ReadOutputPhreeqc(fsout); if (!ok) - DisplayMsgLn(" Error in call to PHREEQC !!!"); + Display::DisplayMsgLn(" Error in call to PHREEQC !!!"); fclose(fsel_out); } } /* if flag */ @@ -182,24 +182,24 @@ void REACT::ExecuteReactionsPHREEQC(void) /* test output*/ /* for(comp=0; compnumber_of_comp;comp++){ - DisplayMsg("component : "); DisplayLong(comp);DisplayMsg(", name = "); - DisplayMsg(this->name[comp]);DisplayMsgLn(". "); - DisplayMsgLn("val_in: "); + Display::DisplayMsg("component : "); Display::DisplayLong(comp);Display::DisplayMsg(", name = "); + Display::DisplayMsg(this->name[comp]);Display::DisplayMsgLn(". "); + Display::DisplayMsgLn("val_in: "); for(i=0;inodenumber;i++){ - DisplayDouble(this->val_in[comp][i],0,0); DisplayMsg(", ");} - DisplayMsgLn(" "); - DisplayMsgLn("val_out: "); + Display::DisplayDouble(this->val_in[comp][i],0,0); Display::DisplayMsg(", ");} + Display::DisplayMsgLn(" "); + Display::DisplayMsgLn("val_out: "); for(i=0;inodenumber;i++){ - DisplayDouble(this->val_out[comp][i],0,0); DisplayMsg(", ");} - DisplayMsgLn(" "); + Display::DisplayDouble(this->val_out[comp][i],0,0); Display::DisplayMsg(", ");} + Display::DisplayMsgLn(" "); - DisplayMsgLn("rate : "); - for(i=0;inodenumber;i++){ DisplayDouble(this->rate[comp][i],0,0); - DisplayMsg(", ");} DisplayMsgLn(" "); + Display::DisplayMsgLn("rate : "); + for(i=0;inodenumber;i++){ Display::DisplayDouble(this->rate[comp][i],0,0); + Display::DisplayMsg(", ");} Display::DisplayMsgLn(" "); } - DisplayMsgLn("rateflag : "); - for(i=0;inodenumber;i++){ DisplayDouble((double) - this->rateflag[i],0,0); DisplayMsg(", ");} DisplayMsgLn(" "); + Display::DisplayMsgLn("rateflag : "); + for(i=0;inodenumber;i++){ Display::DisplayDouble((double) + this->rateflag[i],0,0); Display::DisplayMsg(", ");} Display::DisplayMsgLn(" "); */ } /* End of ExecuteReactionsPHREEQC */ @@ -1739,13 +1739,13 @@ void REACT::InitREACT(void) { if (abs(this->val_in[comp][i]) > MKleinsteZahl) { - DisplayMsg(" Neg. conc for component "); - DisplayLong((long)comp); - DisplayMsg(" at node "); - DisplayLong((long)i); - DisplayMsg("; conc = "); - DisplayDouble(this->val_in[comp][i], 0, 0); - DisplayMsgLn(" "); + Display::DisplayMsg(" Neg. conc for component "); + Display::DisplayLong((long)comp); + Display::DisplayMsg(" at node "); + Display::DisplayLong((long)i); + Display::DisplayMsg("; conc = "); + Display::DisplayDouble(this->val_in[comp][i], 0, 0); + Display::DisplayMsgLn(" "); } this->val_in[comp][i] = 0.0 * this->val_in[comp][i]; } @@ -1834,13 +1834,13 @@ void REACT::InitREACT0() { if (abs(this->val_in[comp][i]) > MKleinsteZahl) { - DisplayMsg(" Neg. conc for component "); - DisplayLong((long)comp); - DisplayMsg(" at node "); - DisplayLong((long)i); - DisplayMsg("; conc = "); - DisplayDouble(this->val_in[comp][i], 0, 0); - DisplayMsgLn(" "); + Display::DisplayMsg(" Neg. conc for component "); + Display::DisplayLong((long)comp); + Display::DisplayMsg(" at node "); + Display::DisplayLong((long)i); + Display::DisplayMsg("; conc = "); + Display::DisplayDouble(this->val_in[comp][i], 0, 0); + Display::DisplayMsgLn(" "); } this->val_in[comp][i] = 0.0 * this->val_in[comp][i]; } @@ -2173,8 +2173,8 @@ int REACT::ReadReactionModel(FILE* File) /* Open input file and read the reaction model values*/ if (indatei == NULL) /*input dateien does not exist*/ { - DisplayMsgLn(""); - DisplayMsgLn(" The input file *.pqc does not exist!!!"); + Display::DisplayMsgLn(""); + Display::DisplayMsgLn(" The input file *.pqc does not exist!!!"); exit(1); } /*end if*/ @@ -2246,7 +2246,7 @@ int REACT::ReadReactionModel(FILE* File) while (fgets(str, 256, indatei) && (!strstr(str, "#ende"))) if (strstr(str, "-file")) { - DisplayMsgLn("-file in *.pqc found"); + Display::DisplayMsgLn("-file in *.pqc found"); p = 0; StringReadStr(&sub, str, &p); StringReadStr(&sub1, &str[p], &p); @@ -2267,7 +2267,7 @@ int REACT::ReadReactionModel(FILE* File) nj = rcml_number_of_master_species + rcml_number_of_equi_phases + rcml_number_of_ion_exchanges; if (nj + 2 != this->number_of_comp) - DisplayMsgLn( + Display::DisplayMsgLn( "!!!Error:Number of components in file *.pqc is not equal to that " "in file *.rfd!"); // fclose(indatei); @@ -2742,15 +2742,15 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) if (indatei == NULL) { - DisplayMsgLn("Erro:The input file *.pqc doesn't exist!!!"); + Display::DisplayMsgLn("Erro:The input file *.pqc doesn't exist!!!"); return 0; } /* zeilenweise lesen */ while (fgets(str, 256, indatei)) { - // DisplayMsgLn(""); - // DisplayMsgLn(str); + // Display::DisplayMsgLn(""); + // Display::DisplayMsgLn(str); pos = 0; // WW beginn=1; @@ -2779,12 +2779,12 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) while (fgets(str, 256, indatei) && (!strstr(str, "#ende"))) { if ((!strstr(str, "# comp")) && (!strstr(str, "# temp"))) - // DisplayMsgLn(" #ende and # not found"); + // Display::DisplayMsgLn(" #ende and # not found"); FilePrintString(f, str); else { - // DisplayMsgLn(" # comp found "); + // Display::DisplayMsgLn(" # comp found "); // sscanf(str, "%s"); StrReadStr(s, str, f, /*TFString,*/ &pos); @@ -2886,7 +2886,7 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) if (pH_flag < 0) { - DisplayMsgLn( + Display::DisplayMsgLn( "pH is not included in the transport " "but will be calculated in the " "reaction"); @@ -2940,7 +2940,7 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) if (pe_flag < 0) { - DisplayMsgLn( + Display::DisplayMsgLn( "pe is not included in the transport " "but will be calculated in the " "reaction"); @@ -4128,11 +4128,11 @@ int REACT::Call_Phreeqc(void) strcpy(m_phreeqc, mm_phreeqc.c_str()); #ifdef PHREEQC if (!system(m_phreeqc)) - // DisplayMsgLn("Phreeqc runs succesfully! "); + // Display::DisplayMsgLn("Phreeqc runs succesfully! "); return 1; else { - DisplayMsgLn("Warnung: Phreeqc doesn't run properly!!! "); + Display::DisplayMsgLn("Warnung: Phreeqc doesn't run properly!!! "); exit(1); } #endif @@ -4174,7 +4174,7 @@ int REACT::ReadOutputPhreeqc(char* fout) ein.open(fout); if (!ein) { - DisplayMsgLn("The selected output file doesn't exist!!!"); + Display::DisplayMsgLn("The selected output file doesn't exist!!!"); return 0; } /* get total number of species in PHREEQC output file */ @@ -4639,7 +4639,7 @@ void REACT::CalculateReactionRateFlag(void) else { // determine for each node separately - DisplayMsgLn(" sum of rates "); + Display::DisplayMsgLn(" sum of rates "); helprates = (double*)Malloc(np * sizeof(double)); for (j = 0; j < np; j++) @@ -4651,17 +4651,17 @@ void REACT::CalculateReactionRateFlag(void) rate = 0.0; for (comp = 0; comp < np; comp++) rate = rate + fabs(this->rate[comp][i] * this->val_in[comp][i]); - DisplayLong(i); - DisplayMsg(": "); - DisplayDouble(rate, 0, 0); - DisplayMsgLn(" "); + Display::DisplayLong(i); + Display::DisplayMsg(": "); + Display::DisplayDouble(rate, 0, 0); + Display::DisplayMsgLn(" "); if (rate > schwellwert) this->rateflag[i] = 1; else this->rateflag[i] = 0; } // end for(irf[i]: "); - DisplayLong(this->rateflag[i]); - DisplayMsg(", this->rate[i]: "); - DisplayDouble(this->rate[0][i], 0, 0); - DisplayMsg(", help[i]: "); - DisplayLong(help[i]); - DisplayMsgLn(" "); + Display::DisplayMsg(" i: "); + Display::DisplayLong(i); + Display::DisplayMsg(", this->rf[i]: "); + Display::DisplayLong(this->rateflag[i]); + Display::DisplayMsg(", this->rate[i]: "); + Display::DisplayDouble(this->rate[0][i], 0, 0); + Display::DisplayMsg(", help[i]: "); + Display::DisplayLong(help[i]); + Display::DisplayMsgLn(" "); if (help[i] > 0) { this->rateflag[i] = 1; j++; } } - DisplayMsg("Total number of nodes, at which chemistry is calculated: "); - DisplayLong(j); - DisplayMsgLn(" "); + Display::DisplayMsg("Total number of nodes, at which chemistry is calculated: "); + Display::DisplayLong(j); + Display::DisplayMsgLn(" "); // give back storage help = (int*)Free(help); @@ -4740,13 +4740,13 @@ void REACT::GetTransportResults(void) { if (abs(val_in[comp][i]) > MKleinsteZahl) { - DisplayMsg(" Neg. conc for component "); - DisplayLong((long)comp); - DisplayMsg(" at node "); - DisplayLong((long)i); - DisplayMsg("; conc = "); - DisplayDouble(val_in[comp][i], 0, 0); - DisplayMsgLn(" "); + Display::DisplayMsg(" Neg. conc for component "); + Display::DisplayLong((long)comp); + Display::DisplayMsg(" at node "); + Display::DisplayLong((long)i); + Display::DisplayMsg("; conc = "); + Display::DisplayDouble(val_in[comp][i], 0, 0); + Display::DisplayMsgLn(" "); } val_in[comp][i] = 0.0 * val_in[comp][i]; } @@ -4782,13 +4782,13 @@ void REACT::SetNeighborNodesActive(long startnode, long level, int* help) long *elems1d,*elems2d,*elems3d; int num_elems1d,num_elems2d,num_elems3d,num_elems; - // DisplayMsg(" RSNNA: startnode: "); DisplayLong(startnode); - DisplayMsg(", level: "); DisplayLong(level); DisplayMsgLn(""); + // Display::DisplayMsg(" RSNNA: startnode: "); Display::DisplayLong(startnode); + Display::DisplayMsg(", level: "); Display::DisplayLong(level); Display::DisplayMsgLn(""); // Ende rekursiv if(level == 0) { help[startnode] = 1; - // DisplayMsg(" Knoten, Level 0 "); DisplayLong(startnode); - DisplayMsgLn(" "); + // Display::DisplayMsg(" Knoten, Level 0 "); Display::DisplayLong(startnode); + Display::DisplayMsgLn(" "); } else { @@ -4806,7 +4806,7 @@ void REACT::SetNeighborNodesActive(long startnode, long level, int* help) anz_n = ElGetElementNodesNumber(elems1d[j]); for(k=0;k 0) GetTransportResults2Element(); @@ -4952,7 +4952,7 @@ void REACT::ExecuteReactionsPHREEQC0(void) } else { - DisplayMsgLn("The file phinput.dat could not be opened !"); + Display::DisplayMsgLn("The file phinput.dat could not be opened !"); exit(1); } @@ -4966,14 +4966,14 @@ void REACT::ExecuteReactionsPHREEQC0(void) fsel_out = fopen(fsout, "r"); if ((ok) && !fsel_out) { - DisplayMsgLn("The selected output file doesn't exist!!!"); + Display::DisplayMsgLn("The selected output file doesn't exist!!!"); exit(1); } else if (ok) { ok = ReadOutputPhreeqc(fsout); if (!ok) - DisplayMsgLn(" Error in call to PHREEQC !!!"); + Display::DisplayMsgLn(" Error in call to PHREEQC !!!"); fclose(fsel_out); } } /* if flag */ @@ -5026,13 +5026,13 @@ void REACT::GetTransportResults2Element() { if (abs(val_in[comp][i]) > MKleinsteZahl) { - DisplayMsg(" Neg. conc for component "); - DisplayLong((long)comp); - DisplayMsg(" at node "); - DisplayLong((long)i); - DisplayMsg("; conc = "); - DisplayDouble(val_in[comp][i], 0, 0); - DisplayMsgLn(" "); + Display::DisplayMsg(" Neg. conc for component "); + Display::DisplayLong((long)comp); + Display::DisplayMsg(" at node "); + Display::DisplayLong((long)i); + Display::DisplayMsg("; conc = "); + Display::DisplayDouble(val_in[comp][i], 0, 0); + Display::DisplayMsgLn(" "); } val_in[comp][i] = 0.0 * val_in[comp][i]; } @@ -5979,7 +5979,7 @@ int REACT::Call_PhreeqcLib( return 1; // ok == 1 for Geosys conventions else { - DisplayMsgLn("Warning: libphreeqc doesn't run properly!!! "); + Display::DisplayMsgLn("Warning: libphreeqc doesn't run properly!!! "); exit(1); } } diff --git a/FEM/rf_react_int.cpp b/FEM/rf_react_int.cpp index 3256bec31..b2fe47ac7 100644 --- a/FEM/rf_react_int.cpp +++ b/FEM/rf_react_int.cpp @@ -255,7 +255,7 @@ bool REACTINT::Read(ifstream* rfd_file) speciesname = "NIX"; } else - DisplayMsgLn( + Display::DisplayMsgLn( " ERROR reading Water concentration relevant " "Species - skipping"); in.clear(); diff --git a/FEM/rf_st_new.cpp b/FEM/rf_st_new.cpp index 4e4970722..fc7a4edca 100644 --- a/FEM/rf_st_new.cpp +++ b/FEM/rf_st_new.cpp @@ -295,7 +295,7 @@ std::ios::pos_type CSourceTerm::Read(std::ifstream* st_file, } else { - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: In reading ST file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -326,7 +326,7 @@ std::ios::pos_type CSourceTerm::Read(std::ifstream* st_file, } else { - DisplayErrorMsg( + Display::DisplayErrorMsg( "Error: In reading ST file, the input component names are " "not found in MCP file!!!"); exit(1); diff --git a/FEM/rf_tim_new.cpp b/FEM/rf_tim_new.cpp index f4c398ef9..08f916ee9 100644 --- a/FEM/rf_tim_new.cpp +++ b/FEM/rf_tim_new.cpp @@ -452,17 +452,17 @@ std::ios::pos_type CTimeDiscretization::Read(std::ifstream* tim_file) break; // case FiniteElement::BNORM: - ScreenMessage( + Display::ScreenMessage( "ERROR in TIMRead. BNORM not configured for " "time control.\n"); - ScreenMessage( + Display::ScreenMessage( "We suggest ENORM as a valid companion for " "NEWTON couplings.\n"); exit(1); break; // default: - ScreenMessage( + Display::ScreenMessage( "ERROR in TIMRead. Invalid error method " "selected for dynamic time control.\n"); exit(1); @@ -715,7 +715,7 @@ std::ios::pos_type CTimeDiscretization::Read(std::ifstream* tim_file) } else { - ScreenMessage("ERROR: Unrecognized time control type.\n"); + Display::ScreenMessage("ERROR: Unrecognized time control type.\n"); exit(1); } } // end of while @@ -1547,9 +1547,9 @@ double CTimeDiscretization::StableErrorAdaptive(void) if (!m_pcs) { // does this ever trigger? - ScreenMessage( + Display::ScreenMessage( "-> ERROR in StableErrorAdaptive: PCS not found\n"); - // ScreenMessage("-> ERROR in " + + // Display::ScreenMessage("-> ERROR in " + // convertTimeControlTypeToString(time_control_type).c_str() + // ": PCS not found\n"); //why is this not possible? return 0.0; @@ -1872,7 +1872,7 @@ double CTimeDiscretization::SelfAdaptiveTimeControl(void) } if (!m_pcs) { - ScreenMessage("-> ERROR in SelfAdaptiveTimeControl(): PCS not found\n"); + Display::ScreenMessage("-> ERROR in SelfAdaptiveTimeControl(): PCS not found\n"); return 0.0; } diff --git a/FEM/rfmat_cp.cpp b/FEM/rfmat_cp.cpp index 3722f6662..addce6a62 100644 --- a/FEM/rfmat_cp.cpp +++ b/FEM/rfmat_cp.cpp @@ -142,14 +142,14 @@ bool CPRead(std::string file_base_name) { if (pcs_vector[0]->getProcessType() == FiniteElement::TNEQ) { - DisplayMsgLn( + Display::DisplayMsgLn( "ERROR. TNEQ requires specification of inert and reactive " "components in mcp file."); exit(1); } if (pcs_vector[0]->getProcessType() == FiniteElement::TES) { - DisplayMsgLn( + Display::DisplayMsgLn( "ERROR. TES requires specification of inert and reactive " "components in mcp file."); exit(1); @@ -203,7 +203,7 @@ bool CPRead(std::string file_base_name) pcs_vector[0]->getProcessType() != FiniteElement::TNEQ && pcs_vector[0]->getProcessType() != FiniteElement::TES) { - DisplayMsgLn( + Display::DisplayMsgLn( "Mass transport components and Mass transport processes do not " "fit!"); exit(1); @@ -212,7 +212,7 @@ bool CPRead(std::string file_base_name) (pcs_vector[0]->getProcessType() == FiniteElement::TNEQ || pcs_vector[0]->getProcessType() == FiniteElement::TES)) { - DisplayMsgLn( + Display::DisplayMsgLn( "ERROR. TNEQ/TES requires specification of inert and reactive " "components in mcp file."); exit(1); @@ -452,7 +452,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // unknown parameter model if (count_of_diffusion_model_values < 0) { - DisplayMsgLn(" Unknown Diffusion model - program stops !"); + Display::DisplayMsgLn(" Unknown Diffusion model - program stops !"); exit(1); } @@ -491,7 +491,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // diffusion_model_values = read_help; if (diffusion_model < 0) - DisplayMsgLn( + Display::DisplayMsgLn( "Error: Diffusion model must be larger than or 0"); } in.clear(); @@ -511,7 +511,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) if (count_of_decay_model_values < 0) // unknown parameter model { - DisplayMsgLn( + Display::DisplayMsgLn( " Unknown Aqueous Decay model - program stops !"); exit(1); } @@ -539,7 +539,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // decay_model_values = read_help; if (decay_model < -1) - DisplayMsgLn( + Display::DisplayMsgLn( "Error: Aqueous decay model must be larger than or 0"); } in.clear(); @@ -559,7 +559,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) if (count_of_isotherm_model_values < 0) // unknown parameter model { - DisplayMsgLn(" Unknown Isotherm model - program stops !"); + Display::DisplayMsgLn(" Unknown Isotherm model - program stops !"); exit(1); } @@ -585,7 +585,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // isotherm_model_values = read_help; if (isotherm_model < 0) - DisplayMsgLn( + Display::DisplayMsgLn( "Error: Isotherm model must be larger than or 0"); } in.clear(); @@ -613,7 +613,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (molar_density <= 0) // unphysical entry { - DisplayMsgLn( + Display::DisplayMsgLn( "Error in MOLAR_DENSITY - setting molar_density to 1.0!"); molar_density = 1.0; } @@ -626,7 +626,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (molar_weight <= 0) // unphysical entry { - DisplayMsgLn( + Display::DisplayMsgLn( "Error in MOLAR_WEIGHT - setting molar_weight to 1.0!"); molar_weight = 1.0; } @@ -640,7 +640,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (max_solubility <= 0) // unphysical entry { - DisplayMsgLn( + Display::DisplayMsgLn( ": Error in MAXIMUM_AQUEOUS_SOLUBILITY - setting " "max_solubility to 1.0!"); max_solubility = 1.0; @@ -664,7 +664,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (fabs(double(valence)) >= 7) { // unphysical entry - DisplayMsgLn("Error in VALENCE - setting valence to 0!"); + Display::DisplayMsgLn("Error in VALENCE - setting valence to 0!"); valence = 0; } } @@ -675,7 +675,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (a_zero >= 10) { // unphysical entry - // DisplayMsgLn("Error in A_ZERO - setting valence to 0!"); + // Display::DisplayMsgLn("Error in A_ZERO - setting valence to 0!"); // a_zero = 0.0; } } @@ -909,7 +909,7 @@ double CompProperties::CalcDiffusionCoefficientCP(long index, return 0.0; // no diffusion specified case 0: /* curve value */ { - // DisplayMsgLn("Not implemented"); + // Display::DisplayMsgLn("Not implemented"); return 0.0; } case 1: /* Konstanter Diffusionswert */ @@ -1156,7 +1156,7 @@ double CompProperties::CalcDiffusionCoefficientCP(long index, else { Dm = 0; - DisplayMsgLn("Something wrong in diffusion model 10! T = 0."); + Display::DisplayMsgLn("Something wrong in diffusion model 10! T = 0."); } // A = -1.4943; //Daq(T) PCE // B = -1059.0; //Daq(T) PCE @@ -1164,7 +1164,7 @@ double CompProperties::CalcDiffusionCoefficientCP(long index, } default: - DisplayMsgLn("Unknown diffusion model!"); + Display::DisplayMsgLn("Unknown diffusion model!"); break; } /* switch */ @@ -1304,7 +1304,7 @@ double CompProperties::CalcDiffusionCoefficientCP_Method1(long index, 1.e-4; // WW } } - DisplayMsgLn("Unknown diffusion model specified!"); + Display::DisplayMsgLn("Unknown diffusion model specified!"); return 0.; } @@ -1424,7 +1424,7 @@ int CompProperties::GetNumberDecayValuesCompProperties(int decay_model) break; /* Monod or Michaelis-Menten kinetics with constant rate coefficients */ default: - DisplayMsgLn(" Error: Unknown model for decay "); + Display::DisplayMsgLn(" Error: Unknown model for decay "); break; } /* switch */ @@ -1502,7 +1502,7 @@ int CompProperties::GetNumberIsothermValuesCompProperties(int isotherm) n=1; break; */ default: - DisplayMsgLn(" Error - this ISOTHERM model found "); + Display::DisplayMsgLn(" Error - this ISOTHERM model found "); break; } /* switch */ @@ -1557,7 +1557,7 @@ double CompProperties::CalcElementRetardationFactorNew(long index, /* Get mean element concentration from last time step */ conc = CalcElementMeanConcNew(index, m_pcs); - /* DisplayMsg(" Mean conc: "); DisplayDouble(conc,0,0); DisplayMsgLn(" "); + /* Display::DisplayMsg(" Mean conc: "); Display::DisplayDouble(conc,0,0); Display::DisplayMsgLn(" "); */ switch (isotherm_model) @@ -1615,20 +1615,20 @@ double CompProperties::CalcElementRetardationFactorNew(long index, // isotherm = GetCurveDerivative((int) isotherm_model_values[0], 0, // fabs(conc), &gueltig); break; default: - DisplayMsgLn( + Display::DisplayMsgLn( "Unknown sorption isotherm type. Assuming no sorption"); isotherm = 0.0; // CMCD moved here retard = 1. + (1. - porosity) * density_rock * isotherm / porosity; break; } - // DisplayMsg(" conc: "); DisplayDouble(conc,0,0);DisplayMsg(" isotherm: "); - // DisplayDouble(isotherm,0,0); DisplayMsgLn(" "); if(conc < 0.0) isotherm = + // Display::DisplayMsg(" conc: "); Display::DisplayDouble(conc,0,0);Display::DisplayMsg(" isotherm: "); + // Display::DisplayDouble(isotherm,0,0); Display::DisplayMsgLn(" "); if(conc < 0.0) isotherm = // 0.0; // retard = 1. + (1.-porosity)*density_rock*isotherm/porosity; Case 4 - // doesn't use this function. if(index < 1) {DisplayMsg(" Retardation - // factor: "); DisplayDouble(retard,0,0); DisplayMsgLn(" ");} + // doesn't use this function. if(index < 1) {Display::DisplayMsg(" Retardation + // factor: "); Display::DisplayDouble(retard,0,0); Display::DisplayMsgLn(" ");} return retard; } @@ -1700,9 +1700,9 @@ double CompProperties::CalcElementMeanConcNew(long index, CRFProcess* m_pcs) val2 /= (double)nn; /* calculate mean value */ - // DisplayMsgLn(" "); DisplayMsg(" val1: "); - // DisplayDouble(val1,0,0);DisplayMsg(", val2: "); - // DisplayDouble(val2,0,0); DisplayMsgLn(""); + // Display::DisplayMsgLn(" "); Display::DisplayMsg(" val1: "); + // Display::DisplayDouble(val1,0,0);Display::DisplayMsg(", val2: "); + // Display::DisplayDouble(val2,0,0); Display::DisplayMsgLn(""); val = theta * val1 + (1.0 - theta) * val2; return val; @@ -1731,7 +1731,7 @@ double CompProperties::CalcElementDecayRateNew(long index, CRFProcess* m_pcs) static double conc, lambda = 0.0; int gueltig; - // if(index >= anz_active_elements){DisplayMsgLn(" Too many elements "); + // if(index >= anz_active_elements){Display::DisplayMsgLn(" Too many elements "); // return 0.0; } /* Get mean element concentration from last time step */ conc = CalcElementMeanConcNew(index, m_pcs); @@ -1778,8 +1778,8 @@ double CompProperties::CalcElementDecayRateNew(long index, CRFProcess* m_pcs) lambda = 0.0; break; } - // if(index < 0){DisplayMsg(" Decay Rate lambda: "); - // DisplayDouble(lambda,0,0); DisplayMsgLn(" ");} + // if(index < 0){Display::DisplayMsg(" Decay Rate lambda: "); + // Display::DisplayDouble(lambda,0,0); Display::DisplayMsgLn(" ");} return lambda; } @@ -1793,12 +1793,12 @@ int CPGetMobil(long comp) cp_single = cp_vec[comp]; if (cp_single == NULL) { - DisplayMsgLn("The requested component properties are not defined!"); + Display::DisplayMsgLn("The requested component properties are not defined!"); return 0; } mobil = cp_single->mobil; if (mobil < 0) - DisplayMsgLn("Error getting component property"); + Display::DisplayMsgLn("Error getting component property"); return mobil; } diff --git a/FEM/solver.cpp b/FEM/solver.cpp index 9c52e3de0..966d6840f 100644 --- a/FEM/solver.cpp +++ b/FEM/solver.cpp @@ -285,7 +285,7 @@ int SpRichardson(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES1 - DisplayMsgLn("SpRichard"); + Display::DisplayMsgLn("SpRichard"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -356,11 +356,11 @@ int SpRichardson(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif } @@ -418,7 +418,7 @@ int SpJOR(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES1 - DisplayMsgLn("SpJacobi"); + Display::DisplayMsgLn("SpJacobi"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -478,8 +478,8 @@ int SpJOR(double* b, double* x, long n) { /* Eventuell Zeilenvertauschen */ #ifdef TESTLOES1 - DisplayMsg("Fehler im Jacobi-Loser: Diagonalelement = 0.0 !!"); - DisplayMsgLn(""); + Display::DisplayMsg("Fehler im Jacobi-Loser: Diagonalelement = 0.0 !!"); + Display::DisplayMsgLn(""); #endif k = -1; break; @@ -510,11 +510,11 @@ int SpJOR(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif } @@ -576,7 +576,7 @@ int SpSOR(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES1 - DisplayMsgLn("SpGaussSeidel"); + Display::DisplayMsgLn("SpGaussSeidel"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -641,9 +641,9 @@ int SpSOR(double* b, double* x, long n) { /* Eventuell Zeilenvertauschen */ #ifdef TESTLOES1 - DisplayMsg( + Display::DisplayMsg( "Fehler im Gauss-Seidel-Loeser: Diagonalelement = 0.0 !!"); - DisplayMsgLn(""); + Display::DisplayMsgLn(""); #endif k = -1; break; @@ -670,11 +670,11 @@ int SpSOR(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif } @@ -1006,8 +1006,8 @@ int SpAMG1R5(double* b, double* x, long n) n = n; *x = *x; *b = *b; - DisplayMsg("!!!! Error: AMG1R5-Solver not included in this version!"); - DisplayMsgLn(" "); + Display::DisplayMsg("!!!! Error: AMG1R5-Solver not included in this version!"); + Display::DisplayMsgLn(" "); exit(1); #endif } @@ -1096,9 +1096,9 @@ int SpUMF(double* b, double* x, long n) } /* Fehler ausgeben */ - DisplayMsg(" Relativer UMF-Anfangsfehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); - DisplayMsgLn(""); + Display::DisplayMsg(" Relativer UMF-Anfangsfehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); + Display::DisplayMsgLn(""); if (VEKNORM_BICGSTAB(r, n) <= EPS) { @@ -1158,10 +1158,10 @@ int SpUMF(double* b, double* x, long n) #ifdef UMFPACK31 umfpack_i_symbolic(n, Ap, Ai, &Symbolic, Control, Info); if (Symbolic == NULL) - DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); + Display::DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); umfpack_i_numeric(Ap, Ai, Ax, Symbolic, &Numeric, Control, Info); if (Numeric == NULL) - DisplayMsgLn("UMFPACK: Numeric ist NULL!"); + Display::DisplayMsgLn("UMFPACK: Numeric ist NULL!"); status = umfpack_i_solve("Ax=b", Ap, Ai, Ax, x, b, Numeric, Control, Info); umfpack_i_report_info(Control, Info); umfpack_i_report_status(Control, status); @@ -1179,25 +1179,25 @@ int SpUMF(double* b, double* x, long n) } if (status != UMFPACK_OK) { - DisplayMsgLn("UMFPACK wird abgebrochen!"); - DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); + Display::DisplayMsgLn("UMFPACK wird abgebrochen!"); + Display::DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); MXDumpGLS("ERROR.GLS", 1, b, NULL); exit(1); } if (Symbolic == NULL) - DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); + Display::DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); status = umfpack_di_numeric(Ap, Ai, Ax, Symbolic, &Numeric, Control, Info); umfpack_di_report_status(Control, status); if (status != UMFPACK_OK) { - DisplayMsgLn("UMFPACK wird abgebrochen!"); - DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); + Display::DisplayMsgLn("UMFPACK wird abgebrochen!"); + Display::DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); MXDumpGLS("ERROR.GLS", 1, b, NULL); exit(1); } if (Numeric == NULL) - DisplayMsgLn("UMFPACK: Numeric ist NULL!"); + Display::DisplayMsgLn("UMFPACK: Numeric ist NULL!"); status = umfpack_di_solve(UMFPACK_A, Ap, Ai, Ax, x, b, Numeric, Control, Info); @@ -1205,8 +1205,8 @@ int SpUMF(double* b, double* x, long n) umfpack_di_report_status(Control, status); if (status != UMFPACK_OK) { - DisplayMsgLn("UMFPACK wird abgebrochen!"); - DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); + Display::DisplayMsgLn("UMFPACK wird abgebrochen!"); + Display::DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); MXDumpGLS("ERROR.GLS", 1, b, NULL); exit(1); } @@ -1222,9 +1222,9 @@ int SpUMF(double* b, double* x, long n) #endif MXResiduum(x, b, r); - DisplayMsg(" Relativer UMF-Endfehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); - DisplayMsgLn(""); + Display::DisplayMsg(" Relativer UMF-Endfehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); + Display::DisplayMsgLn(""); /* Ggf. abschliessen der Vorkonditionierung */ if (vorkond) @@ -1242,8 +1242,8 @@ int SpUMF(double* b, double* x, long n) n = n; *x = *x; *b = *b; - DisplayMsg("!!!! Error: UMF-Solver not included in this version!"); - DisplayMsgLn(" "); + Display::DisplayMsg("!!!! Error: UMF-Solver not included in this version!"); + Display::DisplayMsgLn(" "); exit(1); #endif } @@ -1298,7 +1298,7 @@ int SpBICG(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - DisplayMsgLn("SpBICG"); + Display::DisplayMsgLn("SpBICG"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -1338,9 +1338,9 @@ int SpBICG(double* b, double* x, long n) } #ifdef TESTLOES4 - DisplayMsg("eps = "); - DisplayDouble(eps, 22, 20); - DisplayMsgLn(""); + Display::DisplayMsg("eps = "); + Display::DisplayDouble(eps, 22, 20); + Display::DisplayMsgLn(""); #endif if (VEKNORM_BICG(r, n) <= eps) @@ -1415,11 +1415,11 @@ int SpBICG(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif @@ -1519,7 +1519,7 @@ int SpBICGSTAB(double* b, double* x, long n) alpha = omega = rho1 = rho = 1.0; #ifdef TESTLOES4 - DisplayMsgLn("SpBICGSTAB"); + Display::DisplayMsgLn("SpBICGSTAB"); #endif MXResiduum(x, b, r); @@ -1560,9 +1560,9 @@ int SpBICGSTAB(double* b, double* x, long n) // WW cout << "\n SpBICGSTAB iteration: 0/" << max_iter << " Error: " << // error_rel << "\n"; #ifdef TESTLOES4 - DisplayMsg("eps = "); - DisplayDouble(eps, 22, 20); - DisplayMsgLn(""); + Display::DisplayMsg("eps = "); + Display::DisplayDouble(eps, 22, 20); + Display::DisplayMsgLn(""); #endif /* Fehlerkriterium oder max_iter erreicht? */ if ((k >= max_iter) || (VEKNORM_BICGSTAB(r, n) <= eps)) @@ -1676,11 +1676,11 @@ int SpBICGSTAB(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((max_iter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r2, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r2, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif @@ -1766,7 +1766,7 @@ int SpQMRCGSTAB(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - DisplayMsgLn("SpQMRCGSTAB"); + Display::DisplayMsgLn("SpQMRCGSTAB"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -1800,9 +1800,9 @@ int SpQMRCGSTAB(double* b, double* x, long n) } #ifdef TESTLOES4 - DisplayMsg("eps = "); - DisplayDouble(eps, 22, 20); - DisplayMsgLn(""); + Display::DisplayMsg("eps = "); + Display::DisplayDouble(eps, 22, 20); + Display::DisplayMsgLn(""); #endif if (VEKNORM_QMRCGSTAB(r, n) <= eps) @@ -1891,11 +1891,11 @@ int SpQMRCGSTAB(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif rho1 = rho; @@ -2071,8 +2071,8 @@ int SpMGMRES(double* b, double* x, long n) n = n; *x = *x; *b = *b; - DisplayMsg("!!!! Error: GMRES-Solver not yet finished!"); - DisplayMsgLn(" "); + Display::DisplayMsg("!!!! Error: GMRES-Solver not yet finished!"); + Display::DisplayMsgLn(" "); exit(1); #endif } @@ -2151,7 +2151,7 @@ int SpCG(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - DisplayMsgLn("SpCG"); + Display::DisplayMsgLn("SpCG"); #endif r = (double*)Malloc(n * sizeof(double)); @@ -2187,9 +2187,9 @@ int SpCG(double* b, double* x, long n) s = (double*)Free(s); #ifdef TESTLOES4 - DisplayMsg("eps = "); - DisplayDouble(eps, 22, 20); - DisplayMsgLn(""); + Display::DisplayMsg("eps = "); + Display::DisplayDouble(eps, 22, 20); + Display::DisplayMsgLn(""); #endif if (VEKNORM_CG(r, n) <= eps) @@ -2238,11 +2238,11 @@ int SpCG(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif @@ -2313,7 +2313,7 @@ int SpCGNR(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - DisplayMsgLn("SpCGNE"); + Display::DisplayMsgLn("SpCGNE"); #endif r = (double*)Malloc(n * sizeof(double)); @@ -2404,11 +2404,11 @@ int SpCGNR(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif @@ -2486,7 +2486,7 @@ int SpCGS(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - DisplayMsgLn("SpCGS"); + Display::DisplayMsgLn("SpCGS"); #endif r = (double*)Malloc(n * sizeof(double)); @@ -2583,11 +2583,11 @@ int SpCGS(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Fehler = "); - DisplayDouble(VEKNORM_QMRCGSTAB(r, n) / eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Fehler = "); + Display::DisplayDouble(VEKNORM_QMRCGSTAB(r, n) / eps, 4, 1); + Display::DisplayMsgLn(" "); } #endif @@ -2659,7 +2659,7 @@ int SpGauss(double* vecb, double* vecx, long g) static double z, hilf; register int k, i, j, sk; #ifdef TESTLOES - DisplayMsgLn("SpGAUSS"); + Display::DisplayMsgLn("SpGAUSS"); #endif s = (int*)Malloc(sizeof(int) * (g - 1)); /* LR-Faktorisierung */ @@ -2844,7 +2844,7 @@ int NonLinearSolve(long cas, double* b, double* x, long n, strcpy(text, "SpNEWTON"); break; } - DisplayMsgLn(text); + Display::DisplayMsgLn(text); #endif } else if (cas == 2) @@ -2902,14 +2902,14 @@ int NonLinearSolve(long cas, double* b, double* x, long n, strcpy(text, "SpNEWTON"); break; } - DisplayMsgLn(text); + Display::DisplayMsgLn(text); #endif } iter = NonlinearSolver(b, x, n, f, ind); if (iter == nonlinear_maxiter) { - DisplayErrorMsg("Abbruch! Maximale Anzahl an Iterationen erreicht."); + Display::DisplayErrorMsg("Abbruch! Maximale Anzahl an Iterationen erreicht."); return 0; } return iter; @@ -2970,7 +2970,7 @@ int SpPICARD(double* b, double* x, long n, #define GERMAN #ifdef TESTLOES6 - DisplayMsgLn("SpPICARD"); + Display::DisplayMsgLn("SpPICARD"); #endif cg_eps_original = cg_eps; @@ -3019,7 +3019,7 @@ int SpPICARD(double* b, double* x, long n, if ((rebuild_matrix) || (!(k % nonlinear_assemble_flow))) { #ifdef TESTLOES6 - DisplayMsgLn("Neuaufbau der Systemmatrix"); + Display::DisplayMsgLn("Neuaufbau der Systemmatrix"); #endif f(b, x, aktuelle_zeit); rebuild_matrix = 0; @@ -3054,22 +3054,22 @@ int SpPICARD(double* b, double* x, long n, } #ifdef GERMAN - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", GLS-Iter. = "); - DisplayLong((long)iter); - DisplayMsg(", Fehler/Abbruchf. = "); - DisplayDouble(error / nonlinear_eps, 4, 1); - DisplayMsgLn(" "); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", GLS-Iter. = "); + Display::DisplayLong((long)iter); + Display::DisplayMsg(", Fehler/Abbruchf. = "); + Display::DisplayDouble(error / nonlinear_eps, 4, 1); + Display::DisplayMsgLn(" "); #endif #ifdef ENGLISH - DisplayMsg(" Iteration-Nr.: "); - DisplayLong((long)k); - DisplayMsg(", Linear solver iterations = "); - DisplayLong((long)iter); - DisplayMsg(", error/errorcrit. = "); - DisplayDouble(error / nonlinear_eps, 4, 1); - DisplayMsgLn(""); + Display::DisplayMsg(" Iteration-Nr.: "); + Display::DisplayLong((long)k); + Display::DisplayMsg(", Linear solver iterations = "); + Display::DisplayLong((long)iter); + Display::DisplayMsg(", error/errorcrit. = "); + Display::DisplayDouble(error / nonlinear_eps, 4, 1); + Display::DisplayMsgLn(""); #endif if (nonlinear_rel_cg_eps > 0) @@ -3170,7 +3170,7 @@ int SpNEWTON(double*, double*, long, void (*)(double*, double*, double), long) // WW long ldummy; // WW void (*g) (double *b, double *x, double dummy); - DisplayMsgLn("Newton noch nicht implementiert !!! "); + Display::DisplayMsgLn("Newton noch nicht implementiert !!! "); // WW ddummy = b[0]; // WW ddummy = x[0]; @@ -3189,7 +3189,7 @@ int SpNEWTON(double*, double*, long, void (*)(double*, double*, double), long) static double error; #ifdef TESTLOES6 - DisplayMsgLn("SpNEWTON"); + Display::DisplayMsgLn("SpNEWTON"); #endif k = 0; @@ -3205,9 +3205,9 @@ int SpNEWTON(double*, double*, long, void (*)(double*, double*, double), long) #endif #ifdef TESTLOES6 - DisplayMsg("eps = "); - DisplayDouble(eps, 22, 20); - DisplayMsgLn(""); + Display::DisplayMsg("eps = "); + Display::DisplayDouble(eps, 22, 20); + Display::DisplayMsgLn(""); #endif MXResiduum(x, b, r); diff --git a/FEM/tools.cpp b/FEM/tools.cpp index 0b0b93579..72e5e5b4e 100644 --- a/FEM/tools.cpp +++ b/FEM/tools.cpp @@ -123,10 +123,10 @@ double GetCurveValue(int kurve, int methode, double punkt, int* gueltig) #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - DisplayMsgLn(""); - DisplayMsg("PANIC! Curve "); - DisplayLong(kurve); - DisplayMsgLn(" is requested but not defined!"); + Display::DisplayMsgLn(""); + Display::DisplayMsg("PANIC! Curve "); + Display::DisplayLong(kurve); + Display::DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -155,7 +155,7 @@ double GetCurveValue(int kurve, int methode, double punkt, int* gueltig) switch (methode) { default: - ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); + Display::ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); return 0.0; // case 0: // Linear Interpolation @@ -203,10 +203,10 @@ double GetCurveValueInverse(int kurve, int methode, double wert, int* gueltig) #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - DisplayMsgLn(""); - DisplayMsg("PANIC! Curve "); - DisplayLong(kurve); - DisplayMsgLn(" is requested but not defined!"); + Display::DisplayMsgLn(""); + Display::DisplayMsg("PANIC! Curve "); + Display::DisplayLong(kurve); + Display::DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -256,7 +256,7 @@ double GetCurveValueInverse(int kurve, int methode, double wert, int* gueltig) switch (methode) { default: - ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); + Display::ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); return 0.0; // case 0: // Lineare Interpolation @@ -311,10 +311,10 @@ double GetCurveDerivative(int kurve, int methode, double punkt, int* gueltig) #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - DisplayMsgLn(""); - DisplayMsg("PANIC! Curve "); - DisplayLong(kurve); - DisplayMsgLn(" is requested but not defined!"); + Display::DisplayMsgLn(""); + Display::DisplayMsg("PANIC! Curve "); + Display::DisplayLong(kurve); + Display::DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -423,10 +423,10 @@ double GetCurveInverseDerivative(int kurve, #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - DisplayMsgLn(""); - DisplayMsg("PANIC! Curve "); - DisplayLong(kurve); - DisplayMsgLn(" is requested but not defined!"); + Display::DisplayMsgLn(""); + Display::DisplayMsg("PANIC! Curve "); + Display::DisplayLong(kurve); + Display::DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -553,7 +553,7 @@ int FctCurves(char* data, int found, FILE* f) int i; #ifdef TESTFILES - DisplayMsgLn("Eingabedatenbank, Schluesselwort CURVES"); + Display::DisplayMsgLn("Eingabedatenbank, Schluesselwort CURVES"); #endif LineFeed(f); @@ -717,14 +717,14 @@ int FctCurves(char* data, int found, FILE* f) // long NumberOfElementsPerLayer = -1; // MeshLib::CElem* m_ele = NULL; // //------------------------------------------------------------------------ -// DisplayMsgLn("Input file Heterogeneous Fields "); +// Display::DisplayMsgLn("Input file Heterogeneous Fields "); // //------------------------------------------------------------------------ // // File handling // ein.open(name_file); // if(!ein) // { -// //DisplayMsgLn(" ERROR opening file with heterogeneous fields!"); -// //DisplayMsgLn(" File does not exist."); +// //Display::DisplayMsgLn(" ERROR opening file with heterogeneous fields!"); +// //Display::DisplayMsgLn(" File does not exist."); // cout << " FctReadHeterogeneousFields" << "\n"; // cout << " Cannot find " << name_file << "\n"; // exit(1); @@ -837,7 +837,7 @@ int FctCurves(char* data, int found, FILE* f) // } // //Warning // if(no_values < NumberOfElementsPerLayer) -// DisplayMsgLn( +// Display::DisplayMsgLn( // "Warning! Fewer element values in File for heterogeneous // permeability field than elements in element // list"); @@ -904,20 +904,20 @@ int FctCurves(char* data, int found, FILE* f) // { // ihet = GetNearestHetVal(i, m_msh, no_values, invals); // if(ihet < 0) -// DisplayMsgLn(" Error getting nearest het_value location"); +// Display::DisplayMsgLn(" Error getting nearest het_value location"); // else // for(j = 0; j < nof; j++) // values[j] = invals[ihet][j + 3]; -// //DisplayMsg(" Het Val for element: "); DisplayLong(i); -// DisplayMsg(" with coordinates "); -// //DisplayDouble(x,0,0); DisplayMsg(", "); DisplayDouble(y,0,0); -// DisplayMsg(", "); DisplayDouble(z,0,0); -// DisplayMsg(" found at: "); -// //DisplayDouble(invals[ihet][0],0,0); DisplayMsg(", "); -// DisplayDouble(invals[ihet][1],0,0); -// DisplayMsg(", +// //Display::DisplayMsg(" Het Val for element: "); Display::DisplayLong(i); +// Display::DisplayMsg(" with coordinates "); +// //Display::DisplayDouble(x,0,0); Display::DisplayMsg(", "); Display::DisplayDouble(y,0,0); +// Display::DisplayMsg(", "); Display::DisplayDouble(z,0,0); +// Display::DisplayMsg(" found at: "); +// //Display::DisplayDouble(invals[ihet][0],0,0); Display::DisplayMsg(", "); +// Display::DisplayDouble(invals[ihet][1],0,0); +// Display::DisplayMsg(", //"); -// DisplayDouble(invals[ihet][2],0,0); DisplayMsgLn(". "); +// Display::DisplayDouble(invals[ihet][2],0,0); Display::DisplayMsgLn(". "); // } // //..................................................................... // //Get all values in Element and calculate the geometric mean @@ -925,11 +925,11 @@ int FctCurves(char* data, int found, FILE* f) // { // values[0] = GetAverageHetVal(i, m_msh, no_values, invals); // -// DisplayMsgLn(" AverageHetVal "); -// DisplayMsg(" Element "); -// DisplayDouble(i,0,0); -// DisplayMsg(" Value: "); -// DisplayDouble(values[0],0,0); +// Display::DisplayMsgLn(" AverageHetVal "); +// Display::DisplayMsg(" Element "); +// Display::DisplayDouble(i,0,0); +// Display::DisplayMsg(" Value: "); +// Display::DisplayDouble(values[0],0,0); // } // // save values // m_ele = m_msh->ele_vector[i]; @@ -1068,7 +1068,7 @@ double GetAverageHetVal(long EleIndex, { ihet = GetNearestHetVal(EleIndex, m_msh, no_values, invals); if (ihet < 0) - DisplayMsgLn(" Error getting nearest het_value location"); + Display::DisplayMsgLn(" Error getting nearest het_value location"); else average = invals[ihet][j + 3]; } @@ -1286,7 +1286,7 @@ double GetHetValue(int ele_no, char* inname) return value; } } - DisplayMsgLn(" Error - No het. Field Value found"); + Display::DisplayMsgLn(" Error - No het. Field Value found"); return -1.0; } diff --git a/FileIO/FEMIO/BoundaryConditionIO.cpp b/FileIO/FEMIO/BoundaryConditionIO.cpp index 9b43c9155..459381188 100644 --- a/FileIO/FEMIO/BoundaryConditionIO.cpp +++ b/FileIO/FEMIO/BoundaryConditionIO.cpp @@ -58,7 +58,7 @@ namespace FileIO //// setProcess(cp_vec[cp_name_2_idx[tmp]]->getProcess()); //// setProcessPrimaryVariable(CONCENTRATION); //// } else { -//// DisplayErrorMsg( +//// Display::DisplayErrorMsg( //// "Error: In reading BC file, the input component names ///are /// not found in MCP file!!!"); / exit(1); / } / @@ -78,7 +78,7 @@ namespace FileIO //// setProcess(cp_vec[cp_name_2_idx[tmp]]->getProcess()); //// setProcessPrimaryVariable(CONCENTRATION); //// } else { -//// DisplayErrorMsg( +//// Display::DisplayErrorMsg( //// "Error: In reading BC file, the input component names ///are not found /// in MCP file!!!"); / exit(1); / } / } / From 6311af58145fb6c053512a030397917b7bca5be5 Mon Sep 17 00:00:00 2001 From: Wenqing Wang Date: Fri, 1 Feb 2019 17:56:40 +0100 Subject: [PATCH 3/5] Only allow one rank to call ScreenMessage under MPI --- Base/display.cpp | 11 ++++++++++- Base/display.h | 2 ++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Base/display.cpp b/Base/display.cpp index 7e33aebac..2c8b85e2b 100644 --- a/Base/display.cpp +++ b/Base/display.cpp @@ -62,7 +62,8 @@ void DisplayMsg(const char* s) **************************************************************************/ void ScreenMessage(const char *format , ... ) { -#ifdef USE_MPI +#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ + defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) if (myrank > 0) return; #endif @@ -72,6 +73,14 @@ void ScreenMessage(const char *format , ... ) va_end( arglist ); } +void ScreenMessageNoMPIRank(const char *format , ... ) +{ + va_list arglist; + va_start( arglist, format ); + vprintf( format, arglist ); + va_end( arglist ); +} + /**************************************************************************/ /* ROCKFLOW - Funktion: DisplayMsgLn */ diff --git a/Base/display.h b/Base/display.h index 581f216ef..e0da7ba69 100644 --- a/Base/display.h +++ b/Base/display.h @@ -30,6 +30,8 @@ namespace Display { /*JT: Send output message*/ void ScreenMessage(const char *format , ... ); +void ScreenMessageNoMPIRank(const char *format , ... ); + /* Gibt Programm-Abspann aus */ void DisplayMsg(const char* s); /* Schreibt Zeichenkette ohne Zeilenvorschub auf Standardausgabe */ From db8fa4688831e23a8d7bdd7da7e215ebf63ea069 Mon Sep 17 00:00:00 2001 From: Wenqing Wang Date: Fri, 1 Feb 2019 17:52:46 +0100 Subject: [PATCH 4/5] Replaced frequently called std::cout with ScreenMessage to suppress log in MPI --- FEM/fem_ele_std.cpp | 6 +- FEM/files0.cpp | 5 +- FEM/par_ddc.cpp | 42 ++++----- FEM/pcs_dm.cpp | 187 +++++++++++++++--------------------- FEM/problem.cpp | 219 ++++++++++++++++--------------------------- FEM/rf_bc_new.cpp | 22 +++-- FEM/rf_ic_new.cpp | 6 +- FEM/rf_mfp_new.cpp | 16 ++-- FEM/rf_mmp_new.cpp | 11 +-- FEM/rf_msp_new.cpp | 11 ++- FEM/rf_num_new.cpp | 17 ++-- FEM/rf_out_new.cpp | 14 ++- FEM/rf_pcs.cpp | 178 +++++++++++++++++------------------ FEM/rf_react_int.cpp | 8 +- FEM/rf_st_new.cpp | 13 ++- FEM/rf_tim_new.cpp | 15 ++- FEM/rfmat_cp.cpp | 3 +- FileIO/OGSIOVer4.cpp | 26 ++--- GEO/Surface.cpp | 11 ++- MSH/msh_lib.cpp | 11 ++- MSH/msh_mesh.cpp | 5 +- OGS/rf.cpp | 15 +-- 22 files changed, 389 insertions(+), 452 deletions(-) diff --git a/FEM/fem_ele_std.cpp b/FEM/fem_ele_std.cpp index 3733f9dd8..962276d21 100644 --- a/FEM/fem_ele_std.cpp +++ b/FEM/fem_ele_std.cpp @@ -18,6 +18,9 @@ //#include //#include // PCH to better use system max and min #include "memory.h" + +#include "display.h" + // Method #include "mathlib.h" // Problems @@ -499,7 +502,8 @@ CFiniteElementStd::CFiniteElementStd(CRFProcess* Pcs, const int C_Sys_Flad, if (!done) { done = true; - std::cout << "-> Gass flow is formulated as mass balance." << '\n'; + Display::ScreenMessage( + "-> Gass flow is formulated as mass balance.\n"); } } #if defined(USE_PETSC) // || defined(other parallel libs)//03~04.3012. WW diff --git a/FEM/files0.cpp b/FEM/files0.cpp index 60190f4c9..6b3c83ad4 100644 --- a/FEM/files0.cpp +++ b/FEM/files0.cpp @@ -403,8 +403,9 @@ void CURRead(std::string base_file_name) cur_file.seekg(0L, std::ios::beg); //======================================================================== // keyword loop - std::cout << "CURRead" - << "\n"; + + Display::ScreenMessage("CURRead\n"); + while (!cur_file.eof()) { cur_file.getline(line, MAX_ZEILE); diff --git a/FEM/par_ddc.cpp b/FEM/par_ddc.cpp index 8053181e9..0a13785df 100644 --- a/FEM/par_ddc.cpp +++ b/FEM/par_ddc.cpp @@ -46,6 +46,9 @@ double time_ele_paral; // FEM-Makros #include "makros.h" + +#include "display.h" + #ifndef NEW_EQS // WW. 11.2008 #include "matrix_routines.h" #endif @@ -114,7 +117,7 @@ bool SubKeywordFound(string line) void DOMRead(string file_base_name) { //---------------------------------------------------------------------- - cout << "DOMRead: "; + Display::ScreenMessage("DOMRead: "); //---------------------------------------------------------------------- CPARDomain* m_dom = NULL; char line[MAX_ZEILE]; @@ -128,8 +131,7 @@ void DOMRead(string file_base_name) ifstream ddc_file(ddc_file_name.data(), ios::in); if (!ddc_file.good()) { - cout << "no DDC file" - << "\n"; + Display::ScreenMessage("no DDC file\n"); return; } ddc_file.seekg(0L, ios::beg); @@ -150,8 +152,7 @@ void DOMRead(string file_base_name) } // keyword found } // eof //---------------------------------------------------------------------- - cout << dom_vector.size() << " domains" - << "\n"; + Display::ScreenMessage("%d domains\n", dom_vector.size()); //---------------------------------------------------------------------- } @@ -250,8 +251,8 @@ void DOMCreate() //---------------------------------------------------------------------- // Create domain nodes - cout << "->Create DOM" - << "\n"; + Display::ScreenMessage("->Create Sub-Domains\n"); + /* // Comment by WW for(i=0;im_msh = m_pcs->m_msh; - cout << " Domain:" << m_dom->ID << "\n"; + //Display::ScreenMessageNoMPIRank(" Domain: %d\n", m_dom->ID); m_dom->CreateNodes(); } //---------------------------------------------------------------------- // Create domain elements - cout << " Create domain elements" - << "\n"; + Display::ScreenMessage(" Create domain elements\n"); for (i = 0; i < no_domains; i++) { m_dom = dom_vector[i]; - cout << " Domain:" << m_dom->ID << "\n"; + //Display::ScreenMessageNoMPIRank(" Domain: %d\n", m_dom->ID); m_dom->CreateElements(quadr); } // For find nodes connected to node WW @@ -295,11 +294,10 @@ void DOMCreate() // // Find nodes of all neighbors of each node. // WW // Local topology. WW - cout << " Find nodes on borders" - << "\n"; + Display::ScreenMessage(" Find nodes on borders\n"); FindNodesOnInterface(m_pcs->m_msh, quadr); - cout << " Find the connected nodes for each node" - << "\n"; + + Display::ScreenMessage(" Find the connected nodes for each node\n"); #ifndef USE_MPI // WW for (i = 0; i < no_domains; i++) { @@ -313,16 +311,18 @@ void DOMCreate() #endif //---------------------------------------------------------------------- // Create domain EQS - cout << " Create domain EQS" - << "\n"; + Display::ScreenMessage(" Create domain EQS\n"); + #ifdef USE_MPI i = myrank; #else for (i = 0; i < no_domains; i++) { #endif - m_dom = dom_vector[i]; - cout << " Domain:" << m_dom->ID << "\n"; + m_dom = dom_vector[i]; + + //Display::ScreenMessage(" Domain: %d\n", m_dom->ID); + #ifdef NEW_EQS m_dom->CreateEQS(); #else diff --git a/FEM/pcs_dm.cpp b/FEM/pcs_dm.cpp index adddc35e9..e9121b7a6 100644 --- a/FEM/pcs_dm.cpp +++ b/FEM/pcs_dm.cpp @@ -189,8 +189,7 @@ void CRFProcessDeformation::Initialization() if (!msp_vector.size()) { - std::cout << "***ERROR: MSP data not found!" - << "\n"; + Display::ScreenMessage("***ERROR: MSP data not found!"); return; } InitialMBuffer(); @@ -245,8 +244,8 @@ void CRFProcessDeformation::InitialNodeValueHpcs() const int idx_p2_1 = h_pcs->GetNodeValueIndex("PRESSURE2") + 1; for (std::size_t i = 0; i < m_msh->GetNodesNumber(false); i++) { - h_pcs->SetNodeValue( - i, idx_p2_ini, h_pcs->GetNodeValue(i, idx_p2_1)); + h_pcs->SetNodeValue(i, idx_p2_ini, + h_pcs->GetNodeValue(i, idx_p2_1)); } } @@ -367,8 +366,7 @@ void CRFProcessDeformation::InitialMBuffer() { if (!msp_vector.size()) { - cout << "No .msp file. " - << "\n"; + Display::ScreenMessage("No .msp file found"); abort(); } @@ -415,19 +413,13 @@ void CRFProcessDeformation::InitialMBuffer() **************************************************************************/ double CRFProcessDeformation::Execute(int loop_process_number) { -#if defined(USE_MPI) || defined(USE_PETSC) - if (myrank == 1) - { -#endif - std::cout << "\n ================================================" - << "\n"; - std::cout << " ->Process " << loop_process_number << ": " - << convertProcessTypeToString(getProcessType()) << "\n"; - std::cout << " ================================================" - << "\n"; -#if defined(USE_MPI) || defined(USE_PETSC) - } -#endif + Display::ScreenMessage( + " ================================================\n"); + Display::ScreenMessage(" ->Process %d: %s\n", + loop_process_number, + convertProcessTypeToString(getProcessType()).data()); + Display::ScreenMessage( + " ================================================\n"); clock_t dm_time; @@ -639,20 +631,9 @@ double CRFProcessDeformation::Execute(int loop_process_number) Norm = 1.0e+8; NormU = 1.0e+8; -#if defined(USE_MPI) || defined(USE_PETSC) - if (myrank == 0) - { -#endif - // Screan printing: - std::cout << " Starting loading step " << l << "/" - << number_of_load_steps - << ". Load factor: " << LoadFactor << "\n"; - std::cout - << " ------------------------------------------------" - << "\n"; -#if defined(USE_MPI) || defined(USE_PETSC) - } -#endif + Display::ScreenMessage(" Starting loading step %d/%d\n", l, + number_of_load_steps); + Display::ScreenMessage(" Load factor: %g\n", LoadFactor); } ite_steps = 0; while (ite_steps < MaxIteration) @@ -677,21 +658,19 @@ double CRFProcessDeformation::Execute(int loop_process_number) SetZeroLinearSolver(eqs); #endif -// Assemble and solve system equation -/* - #ifdef MFC - CString m_str; - m_str.Format("Time step: t=%e sec, %s, Load step: %i, NR-Iteration: %i, - Calculate element matrices",\ - aktuelle_zeit,pcs_type_name.c_str(),l,ite_steps); - pWin->SendMessage(WM_SETMESSAGESTRING,0,(LPARAM)(LPCSTR)m_str); - #endif - */ -#if defined(USE_MPI) || defined(USE_PETSC) // WW - if (myrank == 0) -#endif - std::cout << " Assembling equation system..." - << "\n"; + // Assemble and solve system equation + /* + #ifdef MFC + CString m_str; + m_str.Format("Time step: t=%e sec, %s, Load step: %i, + NR-Iteration: %i, + Calculate element matrices",\ + aktuelle_zeit,pcs_type_name.c_str(),l,ite_steps); + pWin->SendMessage(WM_SETMESSAGESTRING,0,(LPARAM)(LPCSTR)m_str); + #endif + */ + + Display::ScreenMessage(" Assembling equation system...\n"); #if defined(USE_MPI) || defined(USE_PETSC) // WW clock_t cpu_time = 0; // WW @@ -717,12 +696,9 @@ double CRFProcessDeformation::Execute(int loop_process_number) // #endif -#if defined(USE_MPI) || defined(USE_PETSC) // WW - if (myrank == 0) -#endif - std::cout << " Calling linear solver..." - << "\n"; -/// Linear solver + Display::ScreenMessage(" Calling linear solver...\n"); + +// Linear solver #if defined(USE_PETSC) //|| defined(other parallel libs)//03~04.3012. WW eqs_new->Solver(); eqs_new->MappingSolution(); @@ -819,37 +795,30 @@ double CRFProcessDeformation::Execute(int loop_process_number) // CRFProcess::CalcIterationNODError to calculate // cpl_max_relative_error and cpl_num_dof_errors; } -// -#if defined(USE_MPI) || defined(USE_PETSC) - if (myrank == 0) - { -#endif - // Screan printing: - std::cout << " -->End of Newton-Raphson iteration: " - << ite_steps << "/" << MaxIteration << "\n"; - cout.width(8); - cout.precision(2); - cout.setf(ios::scientific); - std::cout << " DeltaU/DeltaU0" - << " " - << "DeltaU" - << " " - << "DeltaF/DeltaF0 " - << " " - << "DeltaF" - << " " - << "Damping" - << "\n"; - std::cout << " " << ErrorU << " " << NormU << " " - << Error << " " << Norm << " " - << " " << damping << "\n"; - std::cout - << " " - "------------------------------------------------" - << "\n"; -#if defined(USE_MPI) || defined(USE_PETSC) - } -#endif + + Display::ScreenMessage( + " -->End of Newton-Raphson iteration: %d/%d\n", + ite_steps, MaxIteration); + Display::ScreenMessage( + " " + "------------------------------------------------\n"); + Display::ScreenMessage( + " DeltaU/DeltaU0" + " DeltaU" + " DeltaF/DeltaF0" + " DeltaF" + " Damping\n"); + Display::ScreenMessage( + " %0.3e " + " %0.3e" + " %0.3e" + " %0.3e" + " %0.3e\n", + ErrorU, NormU, Error, Norm, damping); + Display::ScreenMessage( + " " + "------------------------------------------------\n"); + if (Error <= Tolerance_global_Newton && Norm <= m_num->nls_abs_residual_tolerance && NormU <= m_num->nls_abs_unknown_tolerance && @@ -881,8 +850,8 @@ double CRFProcessDeformation::Execute(int loop_process_number) // Load step // // For coupling control - std::cout << " Deformation process converged." - << "\n"; + Display::ScreenMessage(" Deformation process converged.\n"); + Error = 0.0; if (type / 10 != 4) // Partitioned scheme { @@ -906,19 +875,13 @@ double CRFProcessDeformation::Execute(int loop_process_number) Trace_Discontinuity(); // dm_time += clock(); -#if defined(USE_MPI) || defined(USE_PETSC) // WW - if (myrank == 0) - { -#endif - std::cout << " CPU time elapsed in deformation: " - << (double)dm_time / CLOCKS_PER_SEC << "s" - << "\n"; - std::cout << " ------------------------------------------------" - << "\n"; -#if defined(USE_MPI) || defined(USE_PETSC) // WW - } -#endif - // Recovery the old solution. Temp --> u_n for flow proccess + + Display::ScreenMessage(" CPU time elapsed in deformation: %g s\n", + (double)dm_time / CLOCKS_PER_SEC); + Display::ScreenMessage( + " ------------------------------------------------\n"); + + // Recovery the old solution. Temp --> u_n for flow process if (m_num->nls_method != 2) RecoverSolution(); // @@ -2681,7 +2644,7 @@ void CRFProcessDeformation::GlobalAssembly() #ifdef USE_MPI if (dom_vector.size() > 0) { - std::cout << " Domain Decomposition " << myrank << '\n'; + // std::cout << " Domain Decomposition " << myrank << '\n'; CPARDomain* m_dom = NULL; m_dom = dom_vector[myrank]; @@ -2715,7 +2678,7 @@ void CRFProcessDeformation::GlobalAssembly() // DDC if (dom_vector.size() > 0) { - cout << " Domain Decomposition" << '\n'; + Display::ScreenMessage(" Domain Decomposition\n"); CPARDomain* m_dom = NULL; for (int j = 0; j < (int)dom_vector.size(); j++) { @@ -2741,7 +2704,7 @@ void CRFProcessDeformation::GlobalAssembly() // STD else #endif //#if !defined(USE_PETSC) // && !defined(other parallel libs)//10.3012. - // WW + // WW { GlobalAssembly_DM(); @@ -2790,8 +2753,8 @@ void CRFProcessDeformation::GlobalAssembly() else CalcBC_or_SecondaryVariable_Dynamics(true); } - // { MXDumpGLS("rf_pcs1.txt",1,eqs->b,eqs->x); //abort();} - // +// { MXDumpGLS("rf_pcs1.txt",1,eqs->b,eqs->x); //abort();} +// #define atest_dump #ifdef test_dump @@ -3313,7 +3276,7 @@ void CRFProcessDeformation::ReleaseLoadingByExcavation() << "\n"; abort(); } - // 2. Compute the released node loading +// 2. Compute the released node loading #if !defined(NEW_EQS) && !defined(USE_PETSC) // WW. 06.11.2008, 04.2012 SetLinearSolver(eqs); @@ -3648,17 +3611,17 @@ bool CRFProcessDeformation::CalcBC_or_SecondaryVariable_Dynamics(bool BC) // v = GetNodeValue(i, idx_disp[k]); v += GetNodeValue(i, idx_vel[k]) * dt + - 0.5 * dt * dt * - (ARRAY[i + Shift[k]] + m_num->GetDynamicDamping_beta2() * - GetNodeValue(i, idx_acc0[k])); + 0.5 * dt * dt * (ARRAY[i + Shift[k]] + + m_num->GetDynamicDamping_beta2() * + GetNodeValue(i, idx_acc0[k])); SetNodeValue(i, idx_disp[k], v); if (bc_type[i] & (int)MathLib::fastpow(2, k + problem_dimension_dm)) continue; // v v = GetNodeValue(i, idx_vel[k]); - v += dt * ARRAY[i + Shift[k]] + m_num->GetDynamicDamping_beta1() * - dt * - GetNodeValue(i, idx_acc0[k]); + v += dt * ARRAY[i + Shift[k]] + + m_num->GetDynamicDamping_beta1() * dt * + GetNodeValue(i, idx_acc0[k]); SetNodeValue(i, idx_vel[k], v); } diff --git a/FEM/problem.cpp b/FEM/problem.cpp index b5ca5a604..5715b5ced 100644 --- a/FEM/problem.cpp +++ b/FEM/problem.cpp @@ -966,19 +966,7 @@ void Problem::SetActiveProcesses() ***************************************************************************/ void Problem::PCSCreate() { -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) - if (mrank == 0) - { -#endif - std::cout << "---------------------------------------------" - << "\n"; - std::cout << "Create PCS processes" - << "\n"; -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) - } -#endif + Display::ScreenMessage("Create PCS processes\n"); size_t no_processes = pcs_vector.size(); // OK_MOD if(pcs_deformation>0) Init_Linear_Elements(); @@ -994,37 +982,6 @@ void Problem::PCSCreate() for (size_t i = 0; i < no_processes; i++) { -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) - if (mrank == 0) - { -#endif - std::cout << "............................................." - << "\n"; - FiniteElement::ProcessType pcs_type( - pcs_vector[i]->getProcessType()); - std::cout << "Create: " - << FiniteElement::convertProcessTypeToString(pcs_type) - << "\n"; - // if (!pcs_vector[i]->pcs_type_name.compare("MASS_TRANSPORT")) - //{ - // YS // TF - // if (pcs_type != FiniteElement::MASS_TRANSPORT && pcs_type != - // FiniteElement::FLUID_MOMENTUM - // && pcs_type != FiniteElement::RANDOM_WALK) - if (pcs_type == FiniteElement::MASS_TRANSPORT) // SB - { - std::cout << " for " - << pcs_vector[i]->pcs_primary_function_name[0] << " "; - std::cout << " pcs_component_number " - << pcs_vector[i]->pcs_component_number; - } - std::cout << "\n"; -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) - } -#endif - pcs_vector[i]->Create(); } @@ -1080,8 +1037,7 @@ void Problem::PCSRestart() if (ok == 0) { - std::cout << "RFR: no restart data" - << "\n"; + Display::ScreenMessage("RFR: no restart data\n"); return; } @@ -1252,39 +1208,31 @@ void Problem::Euler_TimeDiscretize() aktueller_zeitschritt++; current_time += dt; aktuelle_zeit = current_time; -// -// Print messsage -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) - if (mrank == 0) + + Display::ScreenMessage( + "\n\n#################################################" + "############\n"); + + Display::ScreenMessage("Time step: %g" + "| Time: %g" + "| Time step size: %g\n", + aktueller_zeitschritt, current_time, dt); + if (dt_rec > dt) { -#endif - std::cout << "\n\n#################################################" - "############\n"; - std::cout << "Time step: " << aktueller_zeitschritt - << "| Time: " << current_time - << "| Time step size: " << dt << "\n"; - if (dt_rec > dt) - { - std::cout << "This time step size was modified to match a " - "critical time!" - << "\n"; - } -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) + Display::ScreenMessage( + "This time step size was modified to match a " + "critical time!\n"); } -#endif + if (CouplingLoop()) { // --------------------------------- // TIME STEP ACCEPTED // --------------------------------- last_dt_accepted = true; -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) - if (mrank == 0) -#endif - Display::ScreenMessage("This step is accepted.\n"); + + Display::ScreenMessage("This step is accepted.\n"); + PostCouplingLoop(); if (print_result) { @@ -1373,55 +1321,51 @@ void Problem::Euler_TimeDiscretize() // // executing only one time step for profiling // current_time = end_time; } -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) || defined(USE_MPI_KRC) - if (mrank == 0) + + Display::ScreenMessage( + "\n----------------------------------------------------\n"); + for (i = 0; i < (int)active_process_index.size(); i++) // JT2012 { -#endif - std::cout << "\n----------------------------------------------------\n"; - for (i = 0; i < (int)active_process_index.size(); i++) // JT2012 + m_tim = total_processes[active_process_index[i]]->Tim; + + Display::ScreenMessage( + "\nFor process: %s\n", + convertProcessTypeToString( + total_processes[active_process_index[i]] + ->getProcessType()).data()); + if (m_tim->time_control_type == TimeControlType::FIXED_STEPS) { - m_tim = total_processes[active_process_index[i]]->Tim; - std::cout << "\nFor process: " - << convertProcessTypeToString( - total_processes[active_process_index[i]] - ->getProcessType()) - << "\n"; - if (m_tim->time_control_type == TimeControlType::FIXED_STEPS) - { - std::cout << "No time control for this process." - << "\n"; - } - else - { - std::cout << "Accepted time steps: " - << m_tim->accepted_step_count << "\n"; - std::cout << "Rejected time steps: " - << m_tim->rejected_step_count << "\n"; - } - if (total_processes[active_process_index[i]] - ->m_num->nls_max_iterations > 1) - { - std::cout << "Number of non-converged iterations: " - << total_processes[active_process_index[i]] - ->num_notsatisfied - << "\n"; - std::cout - << "Number of stagnated iterations: " - << total_processes[active_process_index[i]]->num_diverged - << "\n"; - } + Display::ScreenMessage("No time control for this process.\n"); } - std::cout << "\n----------------------------------------------------\n"; -#if defined(USE_PETSC) || defined(USE_MPI) || defined(USE_MPI_PARPROC) || \ - defined(USE_MPI_REGSOIL) || defined(USE_MPI_GEMS) || defined(USE_MPI_KRC) + else + { + Display::ScreenMessage("Accepted time steps: %d\n", + m_tim->accepted_step_count); + Display::ScreenMessage("Rejected time steps: %d\n", + m_tim->rejected_step_count); + } + if (total_processes[active_process_index[i]] + ->m_num->nls_max_iterations > 1) + { + Display::ScreenMessage( + "Number of non-converged iterations: %d\n", + total_processes[active_process_index[i]] + ->num_notsatisfied); + Display::ScreenMessage( + "Number of stagnated iterations: %d\n", + total_processes[active_process_index[i]]->num_diverged); + } + } + Display::ScreenMessage( + "----------------------------------------------------\n"); #if defined(USE_PETSC) // 05.2014. WW + if (mrank == 0) + { for (size_t i = 0; i < out_vector.size(); i++) { out_vector[i]->NODDomainWriteBinary_Header(); } -#endif } #endif } @@ -1597,15 +1541,18 @@ bool Problem::CouplingLoop() max_outer_error = MMax(max_outer_error, max_inner_error); // - std::cout << "\n===========================================" - "===========\n"; - std::cout << "Inner coupling loop " << inner_index + 1 - << "/" << inner_max << " complete." - << "\n"; - std::cout << "Max coupling error (relative to tolerance): " - << max_inner_error << "\n"; - std::cout << "=============================================" - "=========\n"; + Display::ScreenMessage( + "\n===========================================" + "===========\n"); + Display::ScreenMessage( + "Inner coupling loop %d/%d complete.\n", + inner_index + 1, inner_max); + Display::ScreenMessage( + "Max coupling error (relative to tolerance): %0.3e\n", + max_inner_error); + Display::ScreenMessage( + "=============================================" + "=========\n"); // // Coupling convergence criteria (use loop minimum from // a_pcs because this is where the coupled process was @@ -1675,10 +1622,9 @@ if(has_constrained_bc > 0) #else const int rank = -1; #endif - if (rank < 1) - std::cout - << "this process has constrained BCs. reapply BCs." - << std::endl; + Display::ScreenMessage( + "this process has constrained BCs. reapply BCs.\n"); + a_pcs->IncorporateBoundaryConditions(rank); } } @@ -1687,21 +1633,21 @@ if(has_constrained_bc > 0) } if (!accept) { - std::cout << "\n"; break; } // if (cpl_overall_max_iterations > 1) { - std::cout - << "\n======================================================\n"; - std::cout << "Outer coupling loop " << outer_index + 1 << "/" - << cpl_overall_max_iterations << " complete." - << "\n"; - std::cout << "Max coupling error (relative to tolerance): " - << max_outer_error << "\n"; - std::cout - << "======================================================\n"; + Display::ScreenMessage( + "\n======================================================\n"); + Display::ScreenMessage("Outer coupling loop %d/%d complete.\n", + outer_index + 1, + cpl_overall_max_iterations); + Display::ScreenMessage( + "Max coupling error (relative to tolerance): %0.3e\n", + max_outer_error); + Display::ScreenMessage( + "======================================================\n"); // update max cpl error variable in all processes for (std::size_t i(0); i < active_process_index.size(); i++) @@ -1711,10 +1657,7 @@ if(has_constrained_bc > 0) thisPCS->cpl_max_relative_error_overall = max_outer_error; } } - else - { - std::cout << "\n"; - } + // Coupling convergence criteria // if(max_outer_error <= 1.0 && outer_index+2 > // cpl_overall_min_iterations) // JT: error is relative to the diff --git a/FEM/rf_bc_new.cpp b/FEM/rf_bc_new.cpp index 345971c30..4bd995dfb 100644 --- a/FEM/rf_bc_new.cpp +++ b/FEM/rf_bc_new.cpp @@ -851,22 +851,21 @@ bool BCRead(std::string const& file_base_name, std::ifstream bc_file(bc_file_name.data(), std::ios::in); if (!bc_file.good()) { - std::cout << "! Error in BCRead: No boundary conditions !" - << "\n"; + Display::ScreenMessage( + "! Error in BCRead: No boundary conditions !\n"); return false; } // Keyword loop - std::cout << "BCRead ... " << std::flush; + Display::ScreenMessage("BCRead ... "); while (!bc_file.eof()) { bc_file.getline(line, MAX_ZEILE); line_string = line; if (line_string.find("#STOP") != std::string::npos) { - std::cout << "done, read " << bc_list.size() - << " boundary conditions" - << "\n"; + Display::ScreenMessage("done, read %d boundary conditions.\n", + bc_list.size()); return true; } if (line_string.find("#BOUNDARY_CONDITION") != std::string::npos) @@ -1764,8 +1763,10 @@ void CBoundaryConditionsGroup::Set(CRFProcess* pcs, } // list clock_t end_time(clock()); - std::cout << "\t[BC] set BC took " - << (end_time - start_time) / (double)(CLOCKS_PER_SEC) << "\n"; + + Display::ScreenMessage( + "\t[BC] set BC took %0.3e\n", + (end_time - start_time) / (double)(CLOCKS_PER_SEC)); start_time = clock(); // SetTransientBCtoNodes 10/2008 WW/CB Implementation @@ -1850,8 +1851,9 @@ void CBoundaryConditionsGroup::Set(CRFProcess* pcs, } end_time = clock(); - std::cout << "\t[BC] set transient BC took " - << (end_time - start_time) / (double)(CLOCKS_PER_SEC) << "\n"; + Display::ScreenMessage( + "\t[BC] set transient BC took %0.3e\n", + (end_time - start_time) / (double)(CLOCKS_PER_SEC)); } /************************************************************************** diff --git a/FEM/rf_ic_new.cpp b/FEM/rf_ic_new.cpp index 891b8693b..50fe7d50b 100644 --- a/FEM/rf_ic_new.cpp +++ b/FEM/rf_ic_new.cpp @@ -134,8 +134,7 @@ bool ICRead(const std::string& file_base_name, std::ifstream ic_file(ic_file_name.data(), std::ios::in); if (!ic_file.good()) { - std::cout << "WARNING: ICRead: No initial conditions !" - << "\n"; + Display::ScreenMessage("WARNING: ICRead: No initial conditions !\n"); return false; } @@ -144,8 +143,7 @@ bool ICRead(const std::string& file_base_name, std::ios::pos_type position; // Keyword loop - std::cout << "ICRead" - << "\n"; + Display::ScreenMessage("ICRead\n"); while (!ic_file.eof()) { ic_file.getline(line, MAX_ZEILE); diff --git a/FEM/rf_mfp_new.cpp b/FEM/rf_mfp_new.cpp index 100373dba..53d975703 100644 --- a/FEM/rf_mfp_new.cpp +++ b/FEM/rf_mfp_new.cpp @@ -19,8 +19,7 @@ #include #include -// FEM-Makros -//#include "mathlib.h" +#include "display.h" #include "eos.h" //NB // GeoSys-GeoLib #include "files0.h" @@ -208,9 +207,10 @@ std::ios::pos_type CFluidProperties::Read(std::ifstream* mfp_file) break; // OXYGEN default: { - std::cout << "Fluid type of " << name - << " is not valid. Take the default type of WATER" - << std::endl; + Display::ScreenMessage( + "Fluid type of %s " + " is not valid. Take the default type of WATER", + name.data()); fluid_id = 1; } } @@ -870,8 +870,7 @@ bool MFPRead(std::string file_base_name) mfp_file.seekg(0L, std::ios::beg); //======================================================================== // Keyword loop - std::cout << "MFPRead" - << "\n"; + Display::ScreenMessage("MFPRead\n"); while (!mfp_file.eof()) { mfp_file.getline(line, MAX_ZEILE); @@ -911,8 +910,7 @@ bool MFPRead(std::string file_base_name) // Test if (mfp_vector.size() == 0) { - std::cout << "Error in MFPRead: no MFP data" - << "\n"; + Display::ScreenMessage("Error in MFPRead: no MFP data\n"); abort(); } //---------------------------------------------------------------------- diff --git a/FEM/rf_mmp_new.cpp b/FEM/rf_mmp_new.cpp index 013c800af..f8d308f7d 100644 --- a/FEM/rf_mmp_new.cpp +++ b/FEM/rf_mmp_new.cpp @@ -180,7 +180,7 @@ bool MMPRead(std::string base_file_name) //---------------------------------------------------------------------- // OK MMPDelete(); //---------------------------------------------------------------------- - std::cout << "MMPRead ... " << std::flush; + Display::ScreenMessage("MMPRead ... ");; CMediumProperties* m_mat_mp = NULL; char line[MAX_ZEILE]; std::string sub_line; @@ -193,8 +193,7 @@ bool MMPRead(std::string base_file_name) std::ifstream mp_file(mp_file_name.data(), std::ios::in); if (!mp_file.good()) { - std::cout << "! Error in MMPRead: No material data !" - << "\n"; + Display::ScreenMessage("! Error in MMPRead: No material data !\n"); return false; } mp_file.seekg(0L, std::ios::beg); @@ -206,9 +205,9 @@ bool MMPRead(std::string base_file_name) line_string = line; if (line_string.find("#STOP") != string::npos) { - std::cout << "done, read " << mmp_vector.size() - << " medium properties" - << "\n"; + Display::ScreenMessage("done, read %d medium properties\n", + mmp_vector.size()); + return true; } //---------------------------------------------------------------------- diff --git a/FEM/rf_msp_new.cpp b/FEM/rf_msp_new.cpp index 2698f7b0d..40b1b8c08 100644 --- a/FEM/rf_msp_new.cpp +++ b/FEM/rf_msp_new.cpp @@ -25,6 +25,8 @@ #include "Eigen/Dense" +#include "display.h" + // FEM-Makros #include "makros.h" #include "rf_pcs.h" @@ -8815,14 +8817,19 @@ bool MSPRead(const std::string& given_file_base_name) msp_file.seekg(0L, std::ios::beg); //======================================================================== // Keyword loop - std::cout << "MSPRead" - << "\n"; + Display::ScreenMessage("MSPRead ... \n"); + while (!msp_file.eof()) { msp_file.getline(line, MAX_ZEILE); line_string = line; if (line_string.find("#STOP") != string::npos) + { + Display::ScreenMessage( + "done, read %d sets of solid properties terms\n", + msp_vector.size()); return true; + } //---------------------------------------------------------------------- // keyword found if (line_string.find("#SOLID_PROPERTIES") != std::string::npos) diff --git a/FEM/rf_num_new.cpp b/FEM/rf_num_new.cpp index 6f6674e44..8935ae9ce 100644 --- a/FEM/rf_num_new.cpp +++ b/FEM/rf_num_new.cpp @@ -206,8 +206,8 @@ bool NUMRead(string file_base_name) num_file.seekg(0L, ios::beg); //======================================================================== // Keyword loop - cout << "NUMRead" - << "\n"; + Display::ScreenMessage("NUMRead ...\n"); + int max_num_integration_pnts = 0; while (!num_file.eof()) { @@ -223,6 +223,8 @@ bool NUMRead(string file_base_name) num_vector[i]->ele_gauss_points = max_num_integration_pnts; } + Display::ScreenMessage("done, read %d numerical properties\n", + num_vector.size()); return true; } // @@ -766,11 +768,12 @@ ios::pos_type CNumerics::Read(ifstream* num_file) // step will be dampened line >> newton_damping_factor; // dampened by this factor line.clear(); - std::cout << "NR step will be damped by " << newton_damping_factor - << " if relative residual or relative unknown increment " - "decrease by less than " - << newton_damping_tolerance - << " from one iteration to the next." << std::endl; + Display::ScreenMessage( + "NR step will be damped by %g" + " if relative residual or relative unknown increment " + " decrease by less than %g" + " from one iteration to the next.\n", + newton_damping_factor, newton_damping_tolerance); continue; } // Extended convergence test for Newton diff --git a/FEM/rf_out_new.cpp b/FEM/rf_out_new.cpp index a85fc209d..c6c2b01a7 100644 --- a/FEM/rf_out_new.cpp +++ b/FEM/rf_out_new.cpp @@ -27,6 +27,8 @@ using namespace std; // Base #include "BuildInfo.h" +#include "display.h" + #include "StringTools.h" // Math #include "matrix_class.h" //JOD 2014-11-10 @@ -141,14 +143,18 @@ bool OUTRead(const std::string& file_base_name, out_file.seekg(0L, ios::beg); // Keyword loop - cout << "OUTRead" - << "\n"; + Display::ScreenMessage("OUTRead ... "); + while (!out_file.eof()) { out_file.getline(line, MAX_ZEILE); line_string = line; if (line_string.find("#STOP") != string::npos) + { + Display::ScreenMessage("done, read %d output definitions\n", + out_vector.size()); return true; + } COutput* out(new COutput(out_vector.size())); @@ -770,8 +776,8 @@ COutput* OUTGetRWPT(const std::string& out_name) *****************************************************************************************/ void OUTCheck() { - std::cout << "Checking output data " - << "\n"; + Display::ScreenMessage("Checking output data\n"); + // Go through all out objects (#OUTPUT-section in input file) for (size_t i = 0; i < out_vector.size(); i++) out_vector[i]->checkConsistency(); diff --git a/FEM/rf_pcs.cpp b/FEM/rf_pcs.cpp index 80ebc7beb..8f69c58f9 100644 --- a/FEM/rf_pcs.cpp +++ b/FEM/rf_pcs.cpp @@ -614,17 +614,27 @@ decomposition **************************************************************************/ void CRFProcess::Create() { - if (hasAnyProcessDeactivatedSubdomains) - CheckMarkedElement(); // 01.2014 WW - // we need the string representation of process type at some points std::string pcs_type_name( convertProcessTypeToString(this->getProcessType())); + Display::ScreenMessage("Create: %s \n", pcs_type_name.data()); + + if (getProcessType() == FiniteElement::MASS_TRANSPORT) // SB + { + Display::ScreenMessage(" for %s process with component number %d\n", + pcs_primary_function_name[0], + pcs_component_number); + } + + if (hasAnyProcessDeactivatedSubdomains) + CheckMarkedElement(); // 01.2014 WW + // Element matrix output. WW if (Write_Matrix) { - std::cout << "->Write Matrix" << '\n'; + Display::ScreenMessage("->Write Matrix'\n"); + #if defined(USE_MPI) || defined(USE_PETSC) char stro[32]; sprintf(stro, "%d", myrank); @@ -650,8 +660,8 @@ void CRFProcess::Create() int DOF = GetPrimaryVNumber(); // OK should be PCS member variable //---------------------------------------------------------------------------- // MMP - create mmp groups for each process //YD - std::cout << "->Create MMP" - << "\n"; + + Display::ScreenMessage("->Create MMP\n"); CMediumPropertiesGroup* m_mmp_group = NULL; int continua = 1; // WW if (RD_Process) @@ -668,8 +678,8 @@ void CRFProcess::Create() m_mmp_group = NULL; //---------------------------------------------------------------------------- // NUM_NEW - std::cout << "->Create NUM" - << "\n"; + Display::ScreenMessage("->Create NUM\n"); + // if (pcs_type_name.compare("RANDOM_WALK")) { // PCH RWPT does not need // this. if (this->getProcessType() != @@ -692,8 +702,8 @@ void CRFProcess::Create() } if (!m_num) { - std::cout << "Warning in CRFProcess::Create() - no NUM data" - << "\n"; + Display::ScreenMessage( + "Warning in CRFProcess::Create() - no NUM data\n"); m_num = new CNumerics(pcs_type_name); // OK // m_num = m_num_tmp; } @@ -720,7 +730,8 @@ void CRFProcess::Create() //---------------------------------------------------------------------------- // EQS - create equation system // WW CreateEQS(); - std::cout << "->Create EQS" << '\n'; + Display::ScreenMessage("->Create EQS\n"); + #if !defined(USE_PETSC) // && !defined(other parallel solver lib). 04.2012 WW #if defined(NEW_EQS) size_t k; @@ -823,7 +834,7 @@ void CRFProcess::Create() //---------------------------------------------------------------------------- // Time unit factor //WW - std::cout << "->Create TIM" << '\n'; + Display::ScreenMessage("->Create TIM\n"); // CTimeDiscretization* Tim = TIMGet(_pcs_type_name); Tim = TIMGet(pcs_type_name); if (!Tim) @@ -864,12 +875,12 @@ void CRFProcess::Create() m_msh->SwitchOnQuadraticNodes(false); // ELE - config and create element values - cout << "->Config ELE values" << '\n'; + Display::ScreenMessage("->Config ELE values\n"); AllocateMemGPoint(); // ELE - config element matrices // NOD - config and create node values - cout << "->Config NOD values" << '\n'; + Display::ScreenMessage("->Config NOD values\n"); double* nod_values = NULL; double* ele_values = NULL; // PCH @@ -931,8 +942,7 @@ void CRFProcess::Create() type != 4 && type / 10 != 4) // Modified at 03.08.2010. WW { // PCH - cout << "Reloading the primary variables... " - << "\n"; + Display::ScreenMessage("Reloading the primary variables...\n"); ReadSolution(); // WW } @@ -941,14 +951,13 @@ void CRFProcess::Create() FiniteElement::WRITE) // PCH: If reload is set, no need to have ICs { // IC - cout << "->Assign IC" << '\n'; + Display::ScreenMessage("->Assign IC\n"); SetIC(); } else // Bypassing IC - cout << "RELOAD is set to be " << _init_domain_data_type - << ". So, bypassing IC's" - << "\n"; + Display::ScreenMessage("RELOAD is set to be %d. So, bypassing IC's\n", + _init_domain_data_type); if (pcs_type_name_vector.size() && pcs_type_name_vector[0].find("DYNAMIC") != string::npos) // WW @@ -1766,7 +1775,7 @@ bool PCSRead(std::string file_base_name) pcs_file.seekg(0, std::ios::beg); //======================================================================== // Keyword loop - std::cout << "PCSRead ... " << std::flush; + Display::ScreenMessage("PCSRead ... "); while (!pcs_file.eof()) { pcs_file.getline(line, MAX_ZEILE); @@ -1806,8 +1815,8 @@ bool PCSRead(std::string file_base_name) } // keyword found } // eof - std::cout << "done, read " << pcs_vector.size() << " processes" - << "\n"; + Display::ScreenMessage("done, read %d processes\n", + pcs_vector.size()); return true; } @@ -2546,8 +2555,8 @@ void CRFProcess::Config(void) if (this->getProcessType() == FiniteElement::LIQUID_FLOW || this->getProcessType() == FiniteElement::FLUID_FLOW) { - std::cout << "CRFProcess::Config LIQUID_FLOW" - << "\n"; + Display::ScreenMessage("CRFProcess::Config LIQUID_FLOW\n"); + type = 1; ConfigLiquidFlow(); } @@ -4699,8 +4708,9 @@ double CRFProcess::Execute() const_val = GetCurveValue(_pcs_constant_curve, 0, aktuelle_zeit, &valid); } - std::cout << "-> set given constant value. no need to solve a linear " - "system.\n"; + Display::ScreenMessage( + "-> set given constant value. no need to solve a linear system.\n"); + for (int ii = 0; ii < pcs_number_of_primary_nvals; ii++) { nidx1 = GetNodeValueIndex(pcs_primary_function_name[ii]) + 1; @@ -4800,18 +4810,18 @@ double CRFProcess::Execute() #if defined(USE_MPI) || defined(USE_PETSC) // WW clock_t cpu_time = 0; // WW cpu_time = -clock(); - if (myrank == 0) #endif - cout << " Assembling equation system..." - << "\n"; + + Display::ScreenMessage(" Assembling equation system...\n"); + GlobalAssembly(); #if defined(USE_MPI) || defined(USE_PETSC) // WW cpu_time += clock(); cpu_time_assembly += cpu_time; - if (myrank == 0) #endif - cout << " Calling linear solver..." - << "\n"; + + Display::ScreenMessage(" Calling linear solver...\n"); + #ifdef CHECK_EQS std::string eqs_name = convertProcessTypeToString(this->getProcessType()) + "_EQS.txt"; @@ -4852,16 +4862,9 @@ double CRFProcess::Execute() true, false); // JT #endif -#if defined(USE_MPI) || defined(USE_PETSC) - if (myrank == 0) - { -#endif - cout << " Relative PCS error: " << pcs_error << "\n"; - cout << " Start FCT calculation" - << "\n"; -#if defined(USE_MPI) || defined(USE_PETSC) - } -#endif + Display::ScreenMessage(" Relative PCS error: %0.3e\n", pcs_error); + Display::ScreenMessage(" Start FCT calculation\n"); + // Set u^H: use the solution as the higher-order solution for (int ii = 0; ii < pcs_number_of_primary_nvals; ii++) { @@ -5670,7 +5673,7 @@ void CRFProcess::GlobalAssembly() // DDC if (dom_vector.size() > 0) { - cout << " Domain Decomposition" << '\n'; + Display::ScreenMessage(" Domain Decomposition\n"); CPARDomain* m_dom = NULL; size_t j = 0; #if defined(USE_MPI) // WW @@ -5943,7 +5946,7 @@ void CRFProcess::CalIntegrationPointValue() return; } - std::cout << "->Calculate velocity" << '\n'; + Display::ScreenMessage("->Calculate velocity\n"); // check linear flow or not bool isLinearFlow = true; @@ -8624,9 +8627,9 @@ int CRFProcess::ExecuteLinearSolver(LINEAR_SOLVER* eqs) eqs->master_iter = iter_count; if (iter_count >= cg_maxiter) { - cout << "Warning in CRFProcess::ExecuteLinearSolver() - Maximum " - "iteration number reached" - << "\n"; + Display::ScreenMessage( + "Warning in CRFProcess::ExecuteLinearSolver() - Maximum " + "iteration number reached\n"); return -1; } iter_sum += iter_count; @@ -9727,8 +9730,8 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) last_error = 1.0; for (iter_nlin = 0; iter_nlin < m_num->nls_max_iterations; iter_nlin++) { - cout << " PCS non-linear iteration: " << iter_nlin << "/" - << m_num->nls_max_iterations << '\n'; + Display::ScreenMessage(" PCS non-linear iteration: %d/%d\n", + iter_nlin, m_num->nls_max_iterations); nonlinear_iteration_error = Execute(); // // --------------------------------------------------- @@ -9834,9 +9837,9 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) } else { - cout << "Attention: Newton-Raphson step is " - "diverged. Programme halt!" - << "\n"; + Display::ScreenMessage( + "Attention: Newton-Raphson step is " + "diverged. Program halt! \n"); #if defined(USE_PETSC) // || defined(other parallel libs)//08.3012. WW PetscFinalize(); #endif @@ -9868,25 +9871,17 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) converged = true; } } -// Newton information printout. -#if defined(USE_MPI) || defined(USE_PETSC) - if (myrank == 0) - { -#endif - cout.width(10); - cout.precision(3); - cout.setf(ios::scientific); - cout << " NR-Error |" - << " RHS Norm|" - << " Unknowns Norm|" - << " Damping\n"; - cout << " " << setw(10) << error << "| " - << setw(9) << norm_b << "| "; - cout << setw(14) << norm_x << "| " << setw(9) << damping - << "\n"; -#if defined(USE_MPI) || defined(USE_PETSC) - } -#endif + + Display::ScreenMessage( + " NR-Error |" + " RHS Norm|" + " Unknowns Norm|" + " Damping\n"); + Display::ScreenMessage( + " %0.3e |" + " %0.3e|" + " %0.3e|" + " %0.3e|", error, norm_b, norm_x, damping); break; } } @@ -9980,7 +9975,7 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) { if (accepted) // only increment if not fixed by a failed time step. num_diverged++; - std::cout << "\nNon-linear iteration stabilized."; + Display::ScreenMessage("\nNon-linear iteration stabilized.\n"); } else if (!converged) { @@ -9989,7 +9984,8 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) if (Tim->GetPITimeStepCrtlType() < 1) // PI has the intrinsic property of doing this. So don't // print it. - std::cout << "\nMax number of non-linear iterations reached."; + Display::ScreenMessage( + "\nMax number of non-linear iterations reached.\n"); } } // @@ -10025,14 +10021,15 @@ void CRFProcess::PrintStandardIterationInformation(bool write_std_errors) // LINEAR SOLUTION if (m_num->nls_method < 0) { - std::cout << " -->LINEAR solution complete. " - << "\n"; + Display::ScreenMessage(" -->LINEAR solution complete.\n"); + if (write_std_errors) { for (ii = 0; ii < pcs_number_of_primary_nvals; ii++) { - std::cout << " PCS error DOF[" << ii - << "]: " << pcs_absolute_error[ii] << "\n"; + Display::ScreenMessage( + " PCS error DOF[%d] %0.3e\n", + ii, pcs_absolute_error[ii]); } } return; @@ -10040,11 +10037,12 @@ void CRFProcess::PrintStandardIterationInformation(bool write_std_errors) // // NON-LINEAR METHODS if (m_num->nls_method == 0) - std::cout << " -->End of PICARD iteration: " << iter_nlin << "/" - << m_num->nls_max_iterations << "\n"; + Display::ScreenMessage(" -->End of PICARD iteration: %d/%d\n", + iter_nlin, m_num->nls_max_iterations); else - std::cout << " -->End of NEWTON-RAPHSON iteration: " << iter_nlin - << "/" << m_num->nls_max_iterations << "\n"; + Display::ScreenMessage( + " -->End of NEWTON-RAPHSON iteration: %d/%d\n", + iter_nlin, m_num->nls_max_iterations); // // Errors // -------------------------------------------------- @@ -10052,19 +10050,21 @@ void CRFProcess::PrintStandardIterationInformation(bool write_std_errors) { if (pcs_num_dof_errors == 1) { - std::cout << " PCS error: " << pcs_absolute_error[0] - << "\n"; + Display::ScreenMessage( + " PCS error: %0.3e\n", pcs_absolute_error[0]); } else { for (ii = 0; ii < pcs_number_of_primary_nvals; ii++) { - std::cout << " PCS error DOF[" << ii - << "]: " << pcs_absolute_error[ii] << "\n"; + Display::ScreenMessage( + " PCS error DOF[%d]: %0.3e\n", + ii, pcs_absolute_error[ii]); } } - std::cout << " ->Euclidian norm of unknowns: " - << pcs_unknowns_norm << "\n"; + Display::ScreenMessage( + " ->Euclidian norm of unknowns: %0.3e\n", + pcs_unknowns_norm); } } @@ -13699,7 +13699,7 @@ void CRFProcess::PI_TimeStepSize() // DDC if (dom_vector.size() > 0) { - cout << " Domain Decomposition" << '\n'; + Display::ScreenMessage(" Domain Decomposition\n"); CPARDomain* m_dom = NULL; int j = 0; // diff --git a/FEM/rf_react_int.cpp b/FEM/rf_react_int.cpp index b2fe47ac7..1f2f1af8f 100644 --- a/FEM/rf_react_int.cpp +++ b/FEM/rf_react_int.cpp @@ -133,8 +133,8 @@ bool REACINTRead(string file_base_name) rei_file.seekg(0L, ios::beg); // rewind? //======================================================================== // Keyword loop - cout << "REIRead" - << "\n"; + Display::ScreenMessage("REIRead ... \n"); + while (!rei_file.eof()) { rei_file.getline(line, MAX_ZEILE); @@ -154,8 +154,8 @@ bool REACINTRead(string file_base_name) if (!m_rei) { - cout << " No keyword #REACTION_INTERFACE specified - setting defaults" - << "\n"; + Display::ScreenMessage( + " No keyword #REACTION_INTERFACE specified - setting defaults\n"); m_rei = new REACTINT(); REACTINT_vec.push_back(m_rei); } diff --git a/FEM/rf_st_new.cpp b/FEM/rf_st_new.cpp index fc7a4edca..4a1a4f620 100644 --- a/FEM/rf_st_new.cpp +++ b/FEM/rf_st_new.cpp @@ -798,13 +798,13 @@ bool STRead(const std::string& file_base_name, if (!st_file.good()) { - std::cout << "! Warning in STRead: No source terms !" - << "\n"; + Display::ScreenMessage( + "! Warning in STRead: No source terms !\n"); return false; } // Keyword loop - std::cout << "STRead ... " << std::flush; + Display::ScreenMessage("STRead ... "); while (!st_file.eof()) { st_file.getline(line, MAX_ZEILE); @@ -833,8 +833,8 @@ bool STRead(const std::string& file_base_name, } } - std::cout << "done, read " << st_vector.size() << " source terms" - << "\n"; + Display::ScreenMessage("done, read %d source terms.\n", + st_vector.size()); return true; } @@ -871,8 +871,7 @@ bool STRead(const std::string& file_base_name, } // keyword found } // eof - std::cout << "done, read " << st_vector.size() << " source terms" - << "\n"; + Display::ScreenMessage("done, read %d source terms\n", st_vector.size()); return true; } diff --git a/FEM/rf_tim_new.cpp b/FEM/rf_tim_new.cpp index 08f916ee9..93c44bb7f 100644 --- a/FEM/rf_tim_new.cpp +++ b/FEM/rf_tim_new.cpp @@ -759,14 +759,19 @@ bool TIMRead(std::string file_base_name) tim_file.seekg(0L, std::ios::beg); //======================================================================== // Keyword loop - std::cout << "TIMRead" - << "\n"; + Display::ScreenMessage("TIMRead ... "); + while (!tim_file.eof()) { tim_file.getline(line, MAX_ZEILE); line_string = line; if (line_string.find("#STOP") != std::string::npos) + { + Display::ScreenMessage("done, read %d time stepping definitions\n", + time_vector.size()); return true; + } + //---------------------------------------------------------------------- // keyword found if (line_string.find("#TIME_STEPPING") != std::string::npos) @@ -785,8 +790,10 @@ bool TIMRead(std::string file_base_name) *tim_dis << " No. Time Tim-Disc Iter" << "\n"; if (!m_tim->tim_discrete->good()) - std::cout << "Warning : Time-Discrete files are not found" - << "\n"; + { + Display::ScreenMessage( + "Warning : Time-Discrete files are not found\n"); + } } //---------------------------------------------------------------------- time_vector.push_back(m_tim); diff --git a/FEM/rfmat_cp.cpp b/FEM/rfmat_cp.cpp index addce6a62..dcdd7700b 100644 --- a/FEM/rfmat_cp.cpp +++ b/FEM/rfmat_cp.cpp @@ -160,8 +160,7 @@ bool CPRead(std::string file_base_name) //======================================================================== cp_vec.clear(); - cout << "CPRead" - << "\n"; + Display::ScreenMessage("CPRead\n"); // Schleife ueber alle Phasen bzw. Komponenten while (!cp_file.eof()) { diff --git a/FileIO/OGSIOVer4.cpp b/FileIO/OGSIOVer4.cpp index 8067d7c9a..7addc15bc 100644 --- a/FileIO/OGSIOVer4.cpp +++ b/FileIO/OGSIOVer4.cpp @@ -16,6 +16,8 @@ // FileIO #include "OGSIOVer4.h" +#include "display.h" + // Base #include "StringTools.h" #include "quicksort.h" @@ -653,8 +655,9 @@ std::string readSurfaces(std::istream& in, std::vector& sfc_vec, bool readGLIFileV4(const std::string& fname, GEOObjects* geo, std::string& unique_name, std::vector& errors) { - std::cout << "GEOLIB::readGLIFile open stream from file " << fname - << " ... " << std::flush; + Display::ScreenMessage( + "GEOLIB::readGLIFile open stream from file %s ...", fname.data()); + std::ifstream in(fname.c_str()); if (!in) { @@ -662,8 +665,8 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, errors.push_back("[readGLIFileV4] error opening stream from " + fname); return false; } - std::cout << "done" - << "\n"; + + Display::ScreenMessage("done\n"); std::string tag; while (tag.find("#POINTS") == std::string::npos && !in.eof()) @@ -674,10 +677,9 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, new std::map); bool zero_based_idx(true); std::vector* pnt_vec(new std::vector); - std::cout << "read points from stream ... " << std::flush; + Display::ScreenMessage("read points from stream ... \n"); tag = readPoints(in, pnt_vec, zero_based_idx, pnt_id_names_map); - std::cout << " ok, " << pnt_vec->size() << " points read" - << "\n"; + Display::ScreenMessage(" ok, %d points read\n", pnt_vec->size()); unique_name = BaseLib::getFileNameFromPath(fname, true); if (!pnt_vec->empty()) @@ -694,12 +696,11 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, std::vector* ply_vec(new std::vector); if (tag.find("#POLYLINE") != std::string::npos && in) { - std::cout << "read polylines from stream ... " << std::flush; + Display::ScreenMessage("read polylines from stream ... \n"); tag = readPolylines(in, ply_vec, *ply_names, *pnt_vec, zero_based_idx, geo->getPointVecObj(unique_name)->getIDMap(), path, errors); - std::cout << " ok, " << ply_vec->size() << " polylines read" - << "\n"; + Display::ScreenMessage(" ok, %d polylines read.\n", ply_vec->size()); } else std::cerr @@ -710,11 +711,10 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, std::map* sfc_names(new std::map); if (tag.find("#SURFACE") != std::string::npos && in) { - std::cout << "read surfaces from stream ... " << std::flush; + Display::ScreenMessage("read surfaces from stream ... \n"); tag = readSurfaces(in, *sfc_vec, *sfc_names, *ply_vec, *ply_names, *pnt_vec, path, errors); - std::cout << " ok, " << sfc_vec->size() << " surfaces read" - << "\n"; + Display::ScreenMessage(" ok, %d surfaces read.\n", sfc_vec->size()); } else std::cerr diff --git a/GEO/Surface.cpp b/GEO/Surface.cpp index 8e3ede705..4c6d840df 100644 --- a/GEO/Surface.cpp +++ b/GEO/Surface.cpp @@ -10,12 +10,16 @@ * http://www.opengeosys.org/project/license */ + +#include "Surface.h" + #include +#include "display.h" + // GEOLIB #include "AxisAlignedBoundingBox.h" #include "Polygon.h" -#include "Surface.h" // MathLib #include "AnalyticalGeometry.h" @@ -74,10 +78,9 @@ Surface* Surface::createSurface(const Polyline& ply) ++simple_polygon_it) { std::list triangles; - std::cout << "triangulation of surface: ... " << std::flush; + Display::ScreenMessage("triangulation of surface: ... "); MathLib::EarClippingTriangulation(*simple_polygon_it, triangles); - std::cout << "done - " << triangles.size() << " triangles " - << "\n"; + Display::ScreenMessage("done - %d triangles\n", triangles.size()); // add Triangles to Surface std::list::const_iterator it(triangles.begin()); diff --git a/MSH/msh_lib.cpp b/MSH/msh_lib.cpp index 6b1ccf811..27a8262cc 100644 --- a/MSH/msh_lib.cpp +++ b/MSH/msh_lib.cpp @@ -19,13 +19,16 @@ #include #include +// MSHLib +#include "msh_lib.h" + +#include "display.h" + #include "memory.h" // GEOLib #include "files0.h" #include "geo_lib.h" -// MSHLib -#include "msh_lib.h" // PCSLib #include "mathlib.h" #include "rf_mmp_new.h" //OK411 @@ -78,8 +81,8 @@ void FEMRead(const std::string& file_base_name, std::vector& mesh_vec, if (!msh_file_ascii.is_open()) std::cout << "CFEMesh::FEMRead() - Could not open file...\n"; - std::cout << "MSHRead: ASCII file" - << "\n"; + Display::ScreenMessage("MSHRead: ASCII file\n"); + std::string line_string(""); getline(msh_file_ascii, line_string); diff --git a/MSH/msh_mesh.cpp b/MSH/msh_mesh.cpp index 131d8fcae..6bfb46428 100644 --- a/MSH/msh_mesh.cpp +++ b/MSH/msh_mesh.cpp @@ -24,6 +24,7 @@ #include // BaseLib +#include "display.h" #include "memory.h" #include "Histogram.h" @@ -535,7 +536,7 @@ void CFEMesh::ConnectedElements2Node(bool quadratic) **************************************************************************/ void CFEMesh::ConstructGrid() { - std::cout << "Executing ConstructGrid() ... " << std::flush; + Display::ScreenMessage("Executing ConstructGrid() ... \n"); bool done; @@ -939,8 +940,6 @@ void CFEMesh::ConstructGrid() Neighbors0.resize(0); e_edgeNodes0.resize(0); e_edgeNodes.resize(0); - std::cout << " done." - << "\n"; // computeSearchLength(); computeMinEdgeLength(); diff --git a/OGS/rf.cpp b/OGS/rf.cpp index b6082bd45..7cfeaea2a 100644 --- a/OGS/rf.cpp +++ b/OGS/rf.cpp @@ -297,11 +297,13 @@ int main(int argc, char* argv[]) // No default linear solver package is in use. if (solver_pkg_name.find("Default") == std::string::npos) { - std::cout << "\nWarning: " << solver_pkg_name - << " other than the OGS default one is in use." << std::endl; - std::cout << " The solver setting may need to be adjusted for " - "the solution accuracy!" - << std::endl; + Display::ScreenMessage( + "\nWarning: %s other than the OGS default one is in use.\n", + solver_pkg_name.data()); + + Display::ScreenMessage( + " The solver setting may need to be adjusted for " + "the solution accuracy!\n"); } // LB Check if file exists @@ -309,7 +311,8 @@ int main(int argc, char* argv[]) tmpFilename.append(".pcs"); if (!IsFileExisting(tmpFilename)) { - std::cout << " Error: Cannot find file " << FileName << "\n"; + Display::ScreenMessage(" Error: Cannot find file %s\n", + tmpFilename.data()); return 1; } From a08adb42b9c1f56ccb9092711ab75ff6933ab67f Mon Sep 17 00:00:00 2001 From: Wenqing Wang Date: Mon, 4 Feb 2019 15:34:02 +0100 Subject: [PATCH 5/5] Avoid to show namespace of Display --- FEM/DUMUX.cpp | 9 +- FEM/Eclipse.cpp | 29 ++--- FEM/mathlib.cpp | 22 ++-- FEM/matrix_routines.cpp | 141 ++++++++++++------------ FEM/par_ddc.cpp | 25 +++-- FEM/pcs_dm.cpp | 43 ++++---- FEM/problem.cpp | 59 +++++----- FEM/rf_REACT_BRNS.cpp | 17 ++- FEM/rf_bc_new.cpp | 16 +-- FEM/rf_ic_new.cpp | 10 +- FEM/rf_kinreact.cpp | 25 +++-- FEM/rf_mfp_new.cpp | 7 +- FEM/rf_mmp_new.cpp | 55 +++++----- FEM/rf_msp_new.cpp | 6 +- FEM/rf_num_new.cpp | 29 ++--- FEM/rf_out_new.cpp | 8 +- FEM/rf_pcs.cpp | 97 ++++++++-------- FEM/rf_react.cpp | 181 +++++++++++++++--------------- FEM/rf_react_int.cpp | 8 +- FEM/rf_st_new.cpp | 13 ++- FEM/rf_tim_new.cpp | 24 ++-- FEM/rfmat_cp.cpp | 74 +++++++------ FEM/solver.cpp | 237 ++++++++++++++++++++-------------------- FEM/tools.cpp | 81 +++++++------- FileIO/OGSIOVer4.cpp | 17 +-- 25 files changed, 637 insertions(+), 596 deletions(-) diff --git a/FEM/DUMUX.cpp b/FEM/DUMUX.cpp index 2623d705c..bc7660811 100644 --- a/FEM/DUMUX.cpp +++ b/FEM/DUMUX.cpp @@ -40,7 +40,8 @@ CReadTextfiles_DuMux::~CReadTextfiles_DuMux(void) {} using std::cout; using std::string; using std::vector; -// using std:"\n"; + +using namespace Display; /*------------------------------------------------------------------------- GeoSys - Function: SplitStrings @@ -395,7 +396,7 @@ int CDUMUXData::WriteInputForDuMux(CRFProcess* m_pcs, DOScommand = "rm " + Folder + "/dataForDumux.dat"; if (system(DOScommand.c_str())) - Display::DisplayMsgLn("Could not delete input file! "); + DisplayMsgLn("Could not delete input file! "); // Read length of current timestep and recalculate it to days if (m_pcs->Tim->time_unit == "DAY") @@ -1467,7 +1468,7 @@ void CDUMUXData::ExecuteDuMux(CRFProcess* m_pcs, string folder) cout << tempstring << "\n"; if (system(tempstring.c_str())) { - Display::DisplayMsgLn("Warnung: DuMux doesn't run properly!!! "); + DisplayMsgLn("Warnung: DuMux doesn't run properly!!! "); exit(0); } } @@ -1550,7 +1551,7 @@ int CDUMUXData::RunDuMux(long Timestep, CRFProcess* m_pcs) DOScommand = "rm " + folder + "dataForGeoSys*.dat"; if (system(DOScommand.c_str())) - Display::DisplayMsgLn("Could not delete input file! "); + DisplayMsgLn("Could not delete input file! "); } // check if dumux folder is subfolder of the geosys folder diff --git a/FEM/Eclipse.cpp b/FEM/Eclipse.cpp index c552f2cec..74a975e2d 100644 --- a/FEM/Eclipse.cpp +++ b/FEM/Eclipse.cpp @@ -42,6 +42,7 @@ #include //for check if files exist using namespace std; +using namespace Display; CECLIPSEBlock::CECLIPSEBlock(long Nodelength, long Facelength) { @@ -5448,7 +5449,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring << "\n"; if (system(tempstring.c_str())) { - Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5461,7 +5462,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring = EclipseExe + " " + projectname; if (system(tempstring.c_str())) { - Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5529,7 +5530,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring << "\n"; if (system(tempstring.c_str())) { - Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5544,7 +5545,7 @@ std::string CECLIPSEData::ExecuteEclipse(long Timestep, CRFProcess* m_pcs, // tempstring = EclipseExe + " " + projectname; //WTP if (system(tempstring.c_str())) { - Display::DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); + DisplayMsgLn("Warnung: Eclipse doesn't run properly!!! "); return 0; } } @@ -5586,13 +5587,13 @@ bool CECLIPSEData::CleanUpEclipseFiles(std::string folder, systemcommand = system_delete + folder + "TEMPORARYRESULTS.*"; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not delete temporary result files! "); + DisplayMsgLn("Could not delete temporary result files! "); // SB why return return 0; } /* systemcommand = system_delete + projectname + ".FSAVE" + system_noquery; if (system(systemcommand.c_str())){ - // Display::DisplayMsgLn("Could not delete result .FSAVE files! "); + // DisplayMsgLn("Could not delete result .FSAVE files! "); //SB ?? why return return 0; } */ @@ -5623,7 +5624,7 @@ bool CECLIPSEData::CleanUpEclipseFiles(std::string folder, } if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not rename the temporary result files .F*! "); + DisplayMsgLn("Could not rename the temporary result files .F*! "); // return 0; } if (this->Windows_System == false) @@ -5631,44 +5632,44 @@ bool CECLIPSEData::CleanUpEclipseFiles(std::string folder, systemcommand = "rm " + projectname + extension; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn( + DisplayMsgLn( "Could not delete the temporary result files basename.F*! "); // return 0; } } // systemcommand = system_delete + projectname + ".F*" + system_noquery; // if (system(systemcommand.c_str())){ - // Display::DisplayMsgLn("Could not delete result files! "); + // DisplayMsgLn("Could not delete result files! "); // return 0; //} systemcommand = system_delete + projectname + ".A*" + system_noquery; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not delete result files .A*! "); + DisplayMsgLn("Could not delete result files .A*! "); // return 0; } systemcommand = system_delete + projectname + ".P*" + system_noquery; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not delete result files .P*! "); + DisplayMsgLn("Could not delete result files .P*! "); // return 0; } systemcommand = system_delete + projectname + ".R*" + system_noquery; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not delete result files .R*! "); + DisplayMsgLn("Could not delete result files .R*! "); // return 0; } systemcommand = system_delete + projectname + ".M*" + system_noquery; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not delete result files .M*! "); + DisplayMsgLn("Could not delete result files .M*! "); // return 0; } systemcommand = system_delete + projectname + ".DB*" + system_noquery; if (system(systemcommand.c_str())) { - Display::DisplayMsgLn("Could not delete result files .DB*! "); + DisplayMsgLn("Could not delete result files .DB*! "); // return 0; } diff --git a/FEM/mathlib.cpp b/FEM/mathlib.cpp index f025dd497..d51089f83 100644 --- a/FEM/mathlib.cpp +++ b/FEM/mathlib.cpp @@ -179,6 +179,8 @@ #include "prototyp.h" +using namespace Display; + double pai = 4.0 * atan(1.0); VoidFuncDXCDX ShapeFunction; VoidFuncDXCDX ShapeFunctionHQ; @@ -682,7 +684,7 @@ double* MMachVec(long g) zwerg = (double*)Malloc(sizeof(double) * g); #ifdef ERROR_CONTROL if (zwerg == NULL) - Display::DisplayErrorMsg("zuwenig Speicher in MMachVec"); + DisplayErrorMsg("zuwenig Speicher in MMachVec"); #endif return zwerg; } /* MMachVec */ @@ -708,7 +710,7 @@ void MNullVec(double* zwerg, long g) zwerg = (double*)Malloc(sizeof(double) * g); #ifdef ERROR_CONTROL if (zwerg == NULL) - Display::DisplayErrorMsg("Fehler in MNullVec"); + DisplayErrorMsg("Fehler in MNullVec"); #endif #ifdef SX #pragma cdir nodep @@ -742,7 +744,7 @@ void MKopierVec(double* vecquelle, double* vecziel, long g) register long i; #ifdef ERROR_CONTROL if ((vecquelle == NULL) || (vecziel == NULL)) - Display::DisplayErrorMsg("Fehler in MLoeschVec"); + DisplayErrorMsg("Fehler in MLoeschVec"); #endif #ifdef SX #pragma cdir nodep @@ -861,10 +863,10 @@ int MMultVecVec(double* vec1, long gv1, double* vec2, long gv2, double* mato, if (check_err) { if (gv1 != mo) - Display::DisplayErrorMsg( + DisplayErrorMsg( "MMultVecVec: Groesse von Matrix und Vektor 1 passen nicht"); if (gv2 != no) - Display::DisplayErrorMsg( + DisplayErrorMsg( "MMultVecVec: Groesse von Matrix und Vektor 2 passen nicht"); } @@ -920,10 +922,10 @@ int MMultVecMat(double* vec, long gv, double* mat, long m, long n, double* veco, if (check_err) { if (gv != m) - Display::DisplayErrorMsg( + DisplayErrorMsg( "MMultVecMat: Groesse von Matrix und Vektor passen nicht"); if (go != n) - Display::DisplayErrorMsg( + DisplayErrorMsg( "MMultVecMat: Groesse von Ergebnis-Vektor stimmt nicht"); } @@ -982,10 +984,10 @@ int MMultMatVec(/* Matrix */ if (check_err) { if (g != n) - Display::DisplayErrorMsg( + DisplayErrorMsg( "MMultMatVec: Groesse von Matrix und Vektor passen nicht"); if (r != m) - Display::DisplayErrorMsg( + DisplayErrorMsg( "MMultMatVec: Groesse von Ergebnis-Vektor stimmt nicht"); } @@ -1058,7 +1060,7 @@ int MMultMatMat(double* mat1, long m1, long n1, double* mat2, long m2, long n2, #ifdef ERROR_CONTROL if ((m1 != mo) || (n2 != no) || (n1 != m2)) { - Display::DisplayErrorMsg("MMultMatMat:Die Matrizen passen nicht zueinander !"); + DisplayErrorMsg("MMultMatMat:Die Matrizen passen nicht zueinander !"); return 0; } #endif diff --git a/FEM/matrix_routines.cpp b/FEM/matrix_routines.cpp index 90c4101aa..9dfa94611 100644 --- a/FEM/matrix_routines.cpp +++ b/FEM/matrix_routines.cpp @@ -102,6 +102,7 @@ extern MeshLib::CFEMesh* FEMGet(const std::string&); using MeshLib::CNode; +using namespace Display; #ifdef _OPENMP #include @@ -317,7 +318,7 @@ void MX_Exit(const char* caller, int errcode) strcat(text, "Argumente falsch"); break; } - Display::DisplayErrorMsg(strcat(text, " -> Abbruch!")); + DisplayErrorMsg(strcat(text, " -> Abbruch!")); exit(1); } @@ -725,25 +726,25 @@ void* M2DestroyMatrix(void) zaehler += ((Zeil2(j).max_anz - sp2_start) / sp2_inc); } } - Display::DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); - Display::DisplayMsg(" - max. Dimension des Gleichungssystems: "); - Display::DisplayLong(w->max_size); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); - Display::DisplayLong((long)sp2_start); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); - Display::DisplayLong((long)sp2_inc); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); - Display::DisplayLong(anz_inc); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); - Display::DisplayLong(max_inc); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); - Display::DisplayLong(zaehler); - Display::DisplayMsgLn(""); + DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); + DisplayMsg(" - max. Dimension des Gleichungssystems: "); + DisplayLong(w->max_size); + DisplayMsgLn(""); + DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); + DisplayLong((long)sp2_start); + DisplayMsgLn(""); + DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); + DisplayLong((long)sp2_inc); + DisplayMsgLn(""); + DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); + DisplayLong(anz_inc); + DisplayMsgLn(""); + DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); + DisplayLong(max_inc); + DisplayMsgLn(""); + DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); + DisplayLong(zaehler); + DisplayMsgLn(""); } #endif @@ -777,25 +778,25 @@ void* M34DestroyMatrix(void) zaehler += (Sp34(j).max_anz - sp2_start) / sp2_inc; } } - Display::DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); - Display::DisplayMsg(" - max. Dimension des Gleichungssystems: "); - Display::DisplayLong(w->max_size); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); - Display::DisplayLong((long)sp2_start); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); - Display::DisplayLong((long)sp2_inc); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); - Display::DisplayLong(anz_inc); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); - Display::DisplayLong(max_inc); - Display::DisplayMsgLn(""); - Display::DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); - Display::DisplayLong(zaehler); - Display::DisplayMsgLn(""); + DisplayMsgLn("Statistische Auswertung der Speicherstruktur:"); + DisplayMsg(" - max. Dimension des Gleichungssystems: "); + DisplayLong(w->max_size); + DisplayMsgLn(""); + DisplayMsg(" - Ausgangsgroesse der Zeileneintraege sp2_start: "); + DisplayLong((long)sp2_start); + DisplayMsgLn(""); + DisplayMsg(" - Erhoehung der Zeileneintraege sp2_inc: "); + DisplayLong((long)sp2_inc); + DisplayMsgLn(""); + DisplayMsg(" - Anzahl der erhoehten Zeileneintraege: "); + DisplayLong(anz_inc); + DisplayMsgLn(""); + DisplayMsg(" - Groesste Groesse eines Zeileneintrages: "); + DisplayLong(max_inc); + DisplayMsgLn(""); + DisplayMsg(" - Gesamtzahl der Erhoehungen aller Zeileneintraege: "); + DisplayLong(zaehler); + DisplayMsgLn(""); } #endif @@ -3079,11 +3080,11 @@ void M1Vorkond(int aufgabe, double* x, double* b) } else { - Display::DisplayMsg("!!! Equation system: Line: "); - Display::DisplayLong(i); - Display::DisplayMsg(" Value: "); - Display::DisplayDouble(Aik1(i, i), 0, 0); - Display::DisplayMsgLn( + DisplayMsg("!!! Equation system: Line: "); + DisplayLong(i); + DisplayMsg(" Value: "); + DisplayDouble(Aik1(i, i), 0, 0); + DisplayMsgLn( "!!! Diagonal near zero! Disable diagonal " "preconditioner!"); exit(1); @@ -3230,12 +3231,12 @@ void M2Vorkond(int aufgabe, double* x, double* b) } else { - Display::DisplayMsg("!!! Equation system: Line: "); - Display::DisplayLong(k); - Display::DisplayMsg(" Value: "); - Display::DisplayDouble(Diag2(k), 0, 0); - Display::DisplayMsgLn(""); - Display::DisplayMsgLn( + DisplayMsg("!!! Equation system: Line: "); + DisplayLong(k); + DisplayMsg(" Value: "); + DisplayDouble(Diag2(k), 0, 0); + DisplayMsgLn(""); + DisplayMsgLn( "!!! Diagonal near zero! Disable diagonal " "preconditioner!"); exit(1); @@ -3259,7 +3260,7 @@ void M2Vorkond(int aufgabe, double* x, double* b) case 3: /* Linkstransformationen */ if VK_Modus(VK_iLDU) /* incomplete L(D)U-Zerlegung geht nicht! */ - Display::DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); + DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); //-------------------------------------------------------------------- } //====================================================================== @@ -3309,12 +3310,12 @@ void M34Vorkond(int aufgabe, double* x, double* b) } /* else { - Display::DisplayMsg("!!! Equation system: Line: "); - Display::DisplayLong(k); - Display::DisplayMsg(" Value: "); - Display::DisplayDouble(w -> Diag[k], 0, 0); - Display::DisplayMsgLn(""); - Display::DisplayMsgLn("!!! Diagonal near zero! Disable diagonal + DisplayMsg("!!! Equation system: Line: "); + DisplayLong(k); + DisplayMsg(" Value: "); + DisplayDouble(w -> Diag[k], 0, 0); + DisplayMsgLn(""); + DisplayMsgLn("!!! Diagonal near zero! Disable diagonal preconditioner!"); exit(1); }*/ @@ -3470,12 +3471,12 @@ void M5Vorkond(int aufgabe, double* x, double* b) } else { - Display::DisplayMsg("!!! Equation system: Line: "); - Display::DisplayLong(k); - Display::DisplayMsg(" Value: "); - Display::DisplayDouble(Diag2(k), 0, 0); - Display::DisplayMsgLn(""); - Display::DisplayMsgLn( + DisplayMsg("!!! Equation system: Line: "); + DisplayLong(k); + DisplayMsg(" Value: "); + DisplayDouble(Diag2(k), 0, 0); + DisplayMsgLn(""); + DisplayMsgLn( "!!! Diagonal near zero! Disable diagonal " "preconditioner!"); exit(1); @@ -3523,12 +3524,12 @@ void M5Vorkond(int aufgabe, double* x, double* b) for (i = 0; i < Zeil2(k).anz; i++) Aik2(k, i) *= h; } else { - Display::DisplayMsg("!!! Equation system: Line: "); - Display::DisplayLong(k); - Display::DisplayMsg(" Value: "); - Display::DisplayDouble(Diag2(k), 0, 0); - Display::DisplayMsgLn(""); - Display::DisplayMsgLn("!!! Diagonal near zero! Disable diagonal + DisplayMsg("!!! Equation system: Line: "); + DisplayLong(k); + DisplayMsg(" Value: "); + DisplayDouble(Diag2(k), 0, 0); + DisplayMsgLn(""); + DisplayMsgLn("!!! Diagonal near zero! Disable diagonal preconditioner!"); exit(1); } } @@ -3551,7 +3552,7 @@ void M5Vorkond(int aufgabe, double* x, double* b) case 3: /* Linkstransformationen */ if VK_Modus(VK_iLDU) /* incomplete L(D)U-Zerlegung geht nicht! */ - Display::DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); + DisplayMsgLn("Modell 2: kein ILU-Vorkonditionierer!"); //-------------------------------------------------------------------- } //====================================================================== diff --git a/FEM/par_ddc.cpp b/FEM/par_ddc.cpp index 0a13785df..557aac5a0 100644 --- a/FEM/par_ddc.cpp +++ b/FEM/par_ddc.cpp @@ -66,6 +66,7 @@ vector node_connected_doms; // This will be removed after sparse class is using namespace std; using FiniteElement::CFiniteElementVec; using process::CRFProcessDeformation; +using namespace Display; #ifdef NEW_EQS using Math_Group::Linear_EQS; @@ -117,7 +118,7 @@ bool SubKeywordFound(string line) void DOMRead(string file_base_name) { //---------------------------------------------------------------------- - Display::ScreenMessage("DOMRead: "); + ScreenMessage("DOMRead: "); //---------------------------------------------------------------------- CPARDomain* m_dom = NULL; char line[MAX_ZEILE]; @@ -131,7 +132,7 @@ void DOMRead(string file_base_name) ifstream ddc_file(ddc_file_name.data(), ios::in); if (!ddc_file.good()) { - Display::ScreenMessage("no DDC file\n"); + ScreenMessage("no DDC file\n"); return; } ddc_file.seekg(0L, ios::beg); @@ -152,7 +153,7 @@ void DOMRead(string file_base_name) } // keyword found } // eof //---------------------------------------------------------------------- - Display::ScreenMessage("%d domains\n", dom_vector.size()); + ScreenMessage("%d domains\n", dom_vector.size()); //---------------------------------------------------------------------- } @@ -251,7 +252,7 @@ void DOMCreate() //---------------------------------------------------------------------- // Create domain nodes - Display::ScreenMessage("->Create Sub-Domains\n"); + ScreenMessage("->Create Sub-Domains\n"); /* // Comment by WW for(i=0;im_msh = m_pcs->m_msh; - //Display::ScreenMessageNoMPIRank(" Domain: %d\n", m_dom->ID); + //ScreenMessageNoMPIRank(" Domain: %d\n", m_dom->ID); m_dom->CreateNodes(); } //---------------------------------------------------------------------- // Create domain elements - Display::ScreenMessage(" Create domain elements\n"); + ScreenMessage(" Create domain elements\n"); for (i = 0; i < no_domains; i++) { m_dom = dom_vector[i]; - //Display::ScreenMessageNoMPIRank(" Domain: %d\n", m_dom->ID); + //ScreenMessageNoMPIRank(" Domain: %d\n", m_dom->ID); m_dom->CreateElements(quadr); } // For find nodes connected to node WW @@ -294,10 +295,10 @@ void DOMCreate() // // Find nodes of all neighbors of each node. // WW // Local topology. WW - Display::ScreenMessage(" Find nodes on borders\n"); + ScreenMessage(" Find nodes on borders\n"); FindNodesOnInterface(m_pcs->m_msh, quadr); - Display::ScreenMessage(" Find the connected nodes for each node\n"); + ScreenMessage(" Find the connected nodes for each node\n"); #ifndef USE_MPI // WW for (i = 0; i < no_domains; i++) { @@ -311,7 +312,7 @@ void DOMCreate() #endif //---------------------------------------------------------------------- // Create domain EQS - Display::ScreenMessage(" Create domain EQS\n"); + ScreenMessage(" Create domain EQS\n"); #ifdef USE_MPI i = myrank; @@ -321,7 +322,7 @@ void DOMCreate() #endif m_dom = dom_vector[i]; - //Display::ScreenMessage(" Domain: %d\n", m_dom->ID); + //ScreenMessage(" Domain: %d\n", m_dom->ID); #ifdef NEW_EQS m_dom->CreateEQS(); diff --git a/FEM/pcs_dm.cpp b/FEM/pcs_dm.cpp index e9121b7a6..b117ec92d 100644 --- a/FEM/pcs_dm.cpp +++ b/FEM/pcs_dm.cpp @@ -87,6 +87,7 @@ using FiniteElement::CFiniteElementVec; using FiniteElement::ElementValue_DM; using Math_Group::Matrix; using SolidProp::CSolidProperties; +using namespace Display; namespace process { @@ -189,7 +190,7 @@ void CRFProcessDeformation::Initialization() if (!msp_vector.size()) { - Display::ScreenMessage("***ERROR: MSP data not found!"); + ScreenMessage("***ERROR: MSP data not found!"); return; } InitialMBuffer(); @@ -366,7 +367,7 @@ void CRFProcessDeformation::InitialMBuffer() { if (!msp_vector.size()) { - Display::ScreenMessage("No .msp file found"); + ScreenMessage("No .msp file found"); abort(); } @@ -413,12 +414,12 @@ void CRFProcessDeformation::InitialMBuffer() **************************************************************************/ double CRFProcessDeformation::Execute(int loop_process_number) { - Display::ScreenMessage( + ScreenMessage( " ================================================\n"); - Display::ScreenMessage(" ->Process %d: %s\n", + ScreenMessage(" ->Process %d: %s\n", loop_process_number, convertProcessTypeToString(getProcessType()).data()); - Display::ScreenMessage( + ScreenMessage( " ================================================\n"); clock_t dm_time; @@ -535,7 +536,7 @@ double CRFProcessDeformation::Execute(int loop_process_number) loading 2 //--------------------------------------------------------------------- // InitializeNewtonSteps(1); // u=0 - Display::DisplayMsgLn("\nEvaluate load ratio: "); + DisplayMsgLn("\nEvaluate load ratio: "); PreLoad = 1; GlobalAssembly(); PreLoad = 0; @@ -631,9 +632,9 @@ double CRFProcessDeformation::Execute(int loop_process_number) Norm = 1.0e+8; NormU = 1.0e+8; - Display::ScreenMessage(" Starting loading step %d/%d\n", l, + ScreenMessage(" Starting loading step %d/%d\n", l, number_of_load_steps); - Display::ScreenMessage(" Load factor: %g\n", LoadFactor); + ScreenMessage(" Load factor: %g\n", LoadFactor); } ite_steps = 0; while (ite_steps < MaxIteration) @@ -670,7 +671,7 @@ double CRFProcessDeformation::Execute(int loop_process_number) #endif */ - Display::ScreenMessage(" Assembling equation system...\n"); + ScreenMessage(" Assembling equation system...\n"); #if defined(USE_MPI) || defined(USE_PETSC) // WW clock_t cpu_time = 0; // WW @@ -696,7 +697,7 @@ double CRFProcessDeformation::Execute(int loop_process_number) // #endif - Display::ScreenMessage(" Calling linear solver...\n"); + ScreenMessage(" Calling linear solver...\n"); // Linear solver #if defined(USE_PETSC) //|| defined(other parallel libs)//03~04.3012. WW @@ -796,26 +797,26 @@ double CRFProcessDeformation::Execute(int loop_process_number) // cpl_max_relative_error and cpl_num_dof_errors; } - Display::ScreenMessage( + ScreenMessage( " -->End of Newton-Raphson iteration: %d/%d\n", ite_steps, MaxIteration); - Display::ScreenMessage( + ScreenMessage( " " "------------------------------------------------\n"); - Display::ScreenMessage( + ScreenMessage( " DeltaU/DeltaU0" " DeltaU" " DeltaF/DeltaF0" " DeltaF" " Damping\n"); - Display::ScreenMessage( + ScreenMessage( " %0.3e " " %0.3e" " %0.3e" " %0.3e" " %0.3e\n", ErrorU, NormU, Error, Norm, damping); - Display::ScreenMessage( + ScreenMessage( " " "------------------------------------------------\n"); @@ -850,7 +851,7 @@ double CRFProcessDeformation::Execute(int loop_process_number) // Load step // // For coupling control - Display::ScreenMessage(" Deformation process converged.\n"); + ScreenMessage(" Deformation process converged.\n"); Error = 0.0; if (type / 10 != 4) // Partitioned scheme @@ -876,9 +877,9 @@ double CRFProcessDeformation::Execute(int loop_process_number) // dm_time += clock(); - Display::ScreenMessage(" CPU time elapsed in deformation: %g s\n", + ScreenMessage(" CPU time elapsed in deformation: %g s\n", (double)dm_time / CLOCKS_PER_SEC); - Display::ScreenMessage( + ScreenMessage( " ------------------------------------------------\n"); // Recovery the old solution. Temp --> u_n for flow process @@ -2678,7 +2679,7 @@ void CRFProcessDeformation::GlobalAssembly() // DDC if (dom_vector.size() > 0) { - Display::ScreenMessage(" Domain Decomposition\n"); + ScreenMessage(" Domain Decomposition\n"); CPARDomain* m_dom = NULL; for (int j = 0; j < (int)dom_vector.size(); j++) { @@ -3090,7 +3091,7 @@ void CRFProcessDeformation::WriteGaussPointStress(const bool last_step) #else const std::string StressFileName = FileName + ".sts"; #endif - Display::ScreenMessage("-> Write initial stress \n"); + ScreenMessage("-> Write initial stress \n"); fstream file_stress(StressFileName.data(), ios::binary | ios::out | ios::trunc); ElementValue_DM* eleV_DM = NULL; @@ -3146,7 +3147,7 @@ void CRFProcessDeformation::ReadGaussPointStress() const std::string StressFileName = FileName + ".sts"; #endif - Display::ScreenMessage("-> Read initial stress \n"); + ScreenMessage("-> Read initial stress \n"); fstream file_stress(StressFileName.data(), ios::binary | ios::in); ElementValue_DM* eleV_DM = NULL; // diff --git a/FEM/problem.cpp b/FEM/problem.cpp index 5715b5ced..31ad47e5b 100644 --- a/FEM/problem.cpp +++ b/FEM/problem.cpp @@ -100,6 +100,9 @@ extern int ReadData(const char*, #if defined(USE_PETSC) // || defined(other parallel libs)//03.3012. WW #include "PETSC/PETScLinearSolver.h" #endif + +using namespace Display; + namespace process { class CRFProcessDeformation; @@ -966,7 +969,7 @@ void Problem::SetActiveProcesses() ***************************************************************************/ void Problem::PCSCreate() { - Display::ScreenMessage("Create PCS processes\n"); + ScreenMessage("Create PCS processes\n"); size_t no_processes = pcs_vector.size(); // OK_MOD if(pcs_deformation>0) Init_Linear_Elements(); @@ -1037,7 +1040,7 @@ void Problem::PCSRestart() if (ok == 0) { - Display::ScreenMessage("RFR: no restart data\n"); + ScreenMessage("RFR: no restart data\n"); return; } @@ -1139,7 +1142,7 @@ void Problem::Euler_TimeDiscretize() // CTimeDiscretization* m_tim = NULL; aktueller_zeitschritt = 0; - Display::ScreenMessage("\n\n***Start time steps\n"); + ScreenMessage("\n\n***Start time steps\n"); // // Output zero time initial values #if defined(USE_MPI) || defined(USE_MPI_KRC) @@ -1186,7 +1189,7 @@ void Problem::Euler_TimeDiscretize() if (!last_dt_accepted && dt == previous_rejected_dt) { - Display::ScreenMessage( + ScreenMessage( "Stop this simulation. New time step size is same as the " "rejected one.\n"); break; @@ -1209,17 +1212,17 @@ void Problem::Euler_TimeDiscretize() current_time += dt; aktuelle_zeit = current_time; - Display::ScreenMessage( + ScreenMessage( "\n\n#################################################" "############\n"); - Display::ScreenMessage("Time step: %g" + ScreenMessage("Time step: %g" "| Time: %g" "| Time step size: %g\n", aktueller_zeitschritt, current_time, dt); if (dt_rec > dt) { - Display::ScreenMessage( + ScreenMessage( "This time step size was modified to match a " "critical time!\n"); } @@ -1231,7 +1234,7 @@ void Problem::Euler_TimeDiscretize() // --------------------------------- last_dt_accepted = true; - Display::ScreenMessage("This step is accepted.\n"); + ScreenMessage("This step is accepted.\n"); PostCouplingLoop(); if (print_result) @@ -1260,7 +1263,7 @@ void Problem::Euler_TimeDiscretize() } else if (isSteadySimulation) { - Display::ScreenMessage( + ScreenMessage( "This time step is rejected. We stop the simulation because " "this is steady state simulation.\n"); break; @@ -1271,7 +1274,7 @@ void Problem::Euler_TimeDiscretize() // TIME STEP FAILED // --------------------------------- last_dt_accepted = false; - Display::ScreenMessage( + ScreenMessage( "This step is rejected: Redo, with a new time step.\n"); rejected_times++; current_time -= dt; @@ -1312,7 +1315,7 @@ void Problem::Euler_TimeDiscretize() } } } - Display::ScreenMessage( + ScreenMessage( "\n#############################################################" "\n"); if (aktueller_zeitschritt >= max_time_steps) @@ -1322,41 +1325,41 @@ void Problem::Euler_TimeDiscretize() // current_time = end_time; } - Display::ScreenMessage( + ScreenMessage( "\n----------------------------------------------------\n"); for (i = 0; i < (int)active_process_index.size(); i++) // JT2012 { m_tim = total_processes[active_process_index[i]]->Tim; - Display::ScreenMessage( + ScreenMessage( "\nFor process: %s\n", convertProcessTypeToString( total_processes[active_process_index[i]] ->getProcessType()).data()); if (m_tim->time_control_type == TimeControlType::FIXED_STEPS) { - Display::ScreenMessage("No time control for this process.\n"); + ScreenMessage("No time control for this process.\n"); } else { - Display::ScreenMessage("Accepted time steps: %d\n", + ScreenMessage("Accepted time steps: %d\n", m_tim->accepted_step_count); - Display::ScreenMessage("Rejected time steps: %d\n", + ScreenMessage("Rejected time steps: %d\n", m_tim->rejected_step_count); } if (total_processes[active_process_index[i]] ->m_num->nls_max_iterations > 1) { - Display::ScreenMessage( + ScreenMessage( "Number of non-converged iterations: %d\n", total_processes[active_process_index[i]] ->num_notsatisfied); - Display::ScreenMessage( + ScreenMessage( "Number of stagnated iterations: %d\n", total_processes[active_process_index[i]]->num_diverged); } } - Display::ScreenMessage( + ScreenMessage( "----------------------------------------------------\n"); #if defined(USE_PETSC) // 05.2014. WW @@ -1541,16 +1544,16 @@ bool Problem::CouplingLoop() max_outer_error = MMax(max_outer_error, max_inner_error); // - Display::ScreenMessage( + ScreenMessage( "\n===========================================" "===========\n"); - Display::ScreenMessage( + ScreenMessage( "Inner coupling loop %d/%d complete.\n", inner_index + 1, inner_max); - Display::ScreenMessage( + ScreenMessage( "Max coupling error (relative to tolerance): %0.3e\n", max_inner_error); - Display::ScreenMessage( + ScreenMessage( "=============================================" "=========\n"); // @@ -1622,7 +1625,7 @@ if(has_constrained_bc > 0) #else const int rank = -1; #endif - Display::ScreenMessage( + ScreenMessage( "this process has constrained BCs. reapply BCs.\n"); a_pcs->IncorporateBoundaryConditions(rank); @@ -1638,15 +1641,15 @@ if(has_constrained_bc > 0) // if (cpl_overall_max_iterations > 1) { - Display::ScreenMessage( + ScreenMessage( "\n======================================================\n"); - Display::ScreenMessage("Outer coupling loop %d/%d complete.\n", + ScreenMessage("Outer coupling loop %d/%d complete.\n", outer_index + 1, cpl_overall_max_iterations); - Display::ScreenMessage( + ScreenMessage( "Max coupling error (relative to tolerance): %0.3e\n", max_outer_error); - Display::ScreenMessage( + ScreenMessage( "======================================================\n"); // update max cpl error variable in all processes diff --git a/FEM/rf_REACT_BRNS.cpp b/FEM/rf_REACT_BRNS.cpp index 7e4155be3..3459e1a9f 100644 --- a/FEM/rf_REACT_BRNS.cpp +++ b/FEM/rf_REACT_BRNS.cpp @@ -8,9 +8,14 @@ */ #include "rf_REACT_BRNS.h" + +#include + +#include "display.h" #include "rf_pcs.h" #include "rfmat_cp.h" -#include + +using namespace Display; #ifdef BRNS @@ -220,7 +225,7 @@ void REACT_BRNS::InitBRNS(Problem* myProblem) AfxMessageBox( "!!! Node number and Components Number must be bigger than zero!"); #endif - Display::DisplayErrorMsg( + DisplayErrorMsg( "!!! Node number and Components Number must be bigger than zero!"); abort(); } @@ -265,7 +270,7 @@ void REACT_BRNS::InitBRNS(Problem* myProblem) // end of if (this_pcs) else // not getting the pointer to the proper PCS. { - Display::DisplayErrorMsg( + DisplayErrorMsg( "!!! In InitBRNS, can not find corresponding PCS!"); abort(); } @@ -339,7 +344,7 @@ void REACT_BRNS::GSRF2Buffer(long i) "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); #endif - Display::DisplayErrorMsg( + DisplayErrorMsg( "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); abort(); @@ -373,7 +378,7 @@ void REACT_BRNS::Buffer2GSRF(long i) "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); #endif - Display::DisplayErrorMsg( + DisplayErrorMsg( "!!! In Data transfer for BRNS, can not find corresponding " "PCS!"); abort(); @@ -689,7 +694,7 @@ int REACT_BRNS::SetPorosityValue_MT(long ele_Index, #ifdef USE_MPI_BRNS if (myrank == 0 /*should be set to root*/) #endif - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: Not implemented for the flow in BRNS case!!!"); break; } diff --git a/FEM/rf_bc_new.cpp b/FEM/rf_bc_new.cpp index 4bd995dfb..bdeb0d4c5 100644 --- a/FEM/rf_bc_new.cpp +++ b/FEM/rf_bc_new.cpp @@ -82,6 +82,8 @@ double cputime(double x) } #endif +using namespace Display; + CBoundaryConditionNode::CBoundaryConditionNode() : node_value_offset(0.0) { conditional = false; @@ -276,7 +278,7 @@ std::ios::pos_type CBoundaryCondition::Read(std::ifstream* bc_file, } else { - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: In reading BC file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -309,7 +311,7 @@ std::ios::pos_type CBoundaryCondition::Read(std::ifstream* bc_file, } else { - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: In reading BC file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -851,20 +853,20 @@ bool BCRead(std::string const& file_base_name, std::ifstream bc_file(bc_file_name.data(), std::ios::in); if (!bc_file.good()) { - Display::ScreenMessage( + ScreenMessage( "! Error in BCRead: No boundary conditions !\n"); return false; } // Keyword loop - Display::ScreenMessage("BCRead ... "); + ScreenMessage("BCRead ... "); while (!bc_file.eof()) { bc_file.getline(line, MAX_ZEILE); line_string = line; if (line_string.find("#STOP") != std::string::npos) { - Display::ScreenMessage("done, read %d boundary conditions.\n", + ScreenMessage("done, read %d boundary conditions.\n", bc_list.size()); return true; } @@ -1764,7 +1766,7 @@ void CBoundaryConditionsGroup::Set(CRFProcess* pcs, clock_t end_time(clock()); - Display::ScreenMessage( + ScreenMessage( "\t[BC] set BC took %0.3e\n", (end_time - start_time) / (double)(CLOCKS_PER_SEC)); @@ -1851,7 +1853,7 @@ void CBoundaryConditionsGroup::Set(CRFProcess* pcs, } end_time = clock(); - Display::ScreenMessage( + ScreenMessage( "\t[BC] set transient BC took %0.3e\n", (end_time - start_time) / (double)(CLOCKS_PER_SEC)); } diff --git a/FEM/rf_ic_new.cpp b/FEM/rf_ic_new.cpp index 50fe7d50b..620492a87 100644 --- a/FEM/rf_ic_new.cpp +++ b/FEM/rf_ic_new.cpp @@ -41,6 +41,8 @@ using namespace std; #include "InitialCondition.h" +using namespace Display; + //========================================================================== vector ic_group_vector; vector ic_vector; @@ -134,7 +136,7 @@ bool ICRead(const std::string& file_base_name, std::ifstream ic_file(ic_file_name.data(), std::ios::in); if (!ic_file.good()) { - Display::ScreenMessage("WARNING: ICRead: No initial conditions !\n"); + ScreenMessage("WARNING: ICRead: No initial conditions !\n"); return false; } @@ -143,7 +145,7 @@ bool ICRead(const std::string& file_base_name, std::ios::pos_type position; // Keyword loop - Display::ScreenMessage("ICRead\n"); + ScreenMessage("ICRead\n"); while (!ic_file.eof()) { ic_file.getline(line, MAX_ZEILE); @@ -276,7 +278,7 @@ ios::pos_type CInitialCondition::Read(std::ifstream* ic_file, } else { - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: In reading IC file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -307,7 +309,7 @@ ios::pos_type CInitialCondition::Read(std::ifstream* ic_file, } else { - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: In reading BC file, the input component names are " "not found in MCP file!!!"); exit(1); diff --git a/FEM/rf_kinreact.cpp b/FEM/rf_kinreact.cpp index bf95ba414..4064dfd73 100644 --- a/FEM/rf_kinreact.cpp +++ b/FEM/rf_kinreact.cpp @@ -60,6 +60,7 @@ using namespace std; using SolidProp::CSolidProperties; using namespace Math_Group; +using namespace Display; const double residual = 1.e-20; @@ -290,7 +291,7 @@ bool MicrobeData::Read(ifstream* rfd_file) _drmc_ = true; else { - Display::DisplayMsgLn(" ERROR reading Microbe _drmc_ Terms - skipping"); + DisplayMsgLn(" ERROR reading Microbe _drmc_ Terms - skipping"); return false; } in.clear(); @@ -1760,7 +1761,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, monod.push_back(m_monod); else { - Display::DisplayMsgLn(" ERROR reading Monod Terms - skipping"); + DisplayMsgLn(" ERROR reading Monod Terms - skipping"); number_monod--; delete m_monod; } @@ -1809,7 +1810,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, } } else - Display::DisplayMsgLn(" ERROR reading Threshhold Terms - skipping"); + DisplayMsgLn(" ERROR reading Threshhold Terms - skipping"); in.clear(); } //.................................................................... @@ -1842,7 +1843,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, else { delete m_inhibit; // CB_merge_0513 ?? - Display::DisplayMsgLn(" ERROR reading Inhibition Terms - skipping"); + DisplayMsgLn(" ERROR reading Inhibition Terms - skipping"); number_inhibit--; } @@ -1877,7 +1878,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, production.push_back(m_production); else { - Display::DisplayMsgLn(" ERROR reading Production Terms - skipping"); + DisplayMsgLn(" ERROR reading Production Terms - skipping"); number_production--; } in.clear(); @@ -2231,7 +2232,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, speciesname = "NIX"; } else - Display::DisplayMsgLn( + DisplayMsgLn( " ERROR reading Mechanism Species - skipping"); in.clear(); } @@ -2240,7 +2241,7 @@ bool CKinReact::Read(std::ifstream* rfd_file, const GEOLIB::GEOObjects& geo_obj, } // successfull read else { - Display::DisplayMsgLn(" ERROR reading Mechanism Terms - skipping"); + DisplayMsgLn(" ERROR reading Mechanism Terms - skipping"); number_Mech--; delete m_mech; } @@ -2628,7 +2629,7 @@ void CKinReact::ReadReactionEquation(string line_string_all) partners = 0; ih1 = (int)line_string.find(" = "); if (ih1 < 0) - Display::DisplayMsgLn(" Error in keyword REACTION"); + DisplayMsgLn(" Error in keyword REACTION"); // Exception handling while (indexhigh < linelength) { @@ -8421,14 +8422,14 @@ void CKinReactData::PreprocessMinKin() break; case 1: /* DH*/ if (Imax > 0.1) - Display::DisplayMsgLn( + DisplayMsgLn( "Warning in CKinReactData::PreprocessMinkin(): I > 0.1 " "--> use of DH activity model is not " "recomended!"); break; case 2: /* Davies*/ if (Imin < 0.1) - Display::DisplayMsgLn( + DisplayMsgLn( "Warning in CKinReactData::PreprocessMinkin(): I < 0.1 " "--> use of Davies activity model is not " "recomended!"); @@ -8436,7 +8437,7 @@ void CKinReactData::PreprocessMinKin() case 3: /* CHEMAPP*/ break; default: - Display::DisplayMsgLn( + DisplayMsgLn( "Unknown activity model in " "CKinReactData::PreprocessMinkin()!"); break; @@ -8605,7 +8606,7 @@ void CKinReactData::PreprocessMinKin() #endif break; default: - Display::DisplayMsgLn( + DisplayMsgLn( "Unknown activity model in CKinReactData::PreprocessMinkin()!"); break; } /* switch */ diff --git a/FEM/rf_mfp_new.cpp b/FEM/rf_mfp_new.cpp index 53d975703..2f97cc5d8 100644 --- a/FEM/rf_mfp_new.cpp +++ b/FEM/rf_mfp_new.cpp @@ -50,6 +50,7 @@ double gravity_constant = 9.81; // TEST for FEBEX OK 9.81; using namespace PhysicalConstant; using namespace std; +using namespace Display; //========================================================================== std::vector mfp_vector; @@ -207,7 +208,7 @@ std::ios::pos_type CFluidProperties::Read(std::ifstream* mfp_file) break; // OXYGEN default: { - Display::ScreenMessage( + ScreenMessage( "Fluid type of %s " " is not valid. Take the default type of WATER", name.data()); @@ -870,7 +871,7 @@ bool MFPRead(std::string file_base_name) mfp_file.seekg(0L, std::ios::beg); //======================================================================== // Keyword loop - Display::ScreenMessage("MFPRead\n"); + ScreenMessage("MFPRead\n"); while (!mfp_file.eof()) { mfp_file.getline(line, MAX_ZEILE); @@ -910,7 +911,7 @@ bool MFPRead(std::string file_base_name) // Test if (mfp_vector.size() == 0) { - Display::ScreenMessage("Error in MFPRead: no MFP data\n"); + ScreenMessage("Error in MFPRead: no MFP data\n"); abort(); } //---------------------------------------------------------------------- diff --git a/FEM/rf_mmp_new.cpp b/FEM/rf_mmp_new.cpp index f8d308f7d..6a85729e7 100644 --- a/FEM/rf_mmp_new.cpp +++ b/FEM/rf_mmp_new.cpp @@ -62,6 +62,7 @@ using FiniteElement::CElement; using FiniteElement::CFiniteElementStd; using FiniteElement::ElementValue; using FiniteElement::ElementValue_DM; +using namespace Display; /************************************************************************** FEMLib-Method: CMediumProperties @@ -180,7 +181,7 @@ bool MMPRead(std::string base_file_name) //---------------------------------------------------------------------- // OK MMPDelete(); //---------------------------------------------------------------------- - Display::ScreenMessage("MMPRead ... ");; + ScreenMessage("MMPRead ... ");; CMediumProperties* m_mat_mp = NULL; char line[MAX_ZEILE]; std::string sub_line; @@ -193,7 +194,7 @@ bool MMPRead(std::string base_file_name) std::ifstream mp_file(mp_file_name.data(), std::ios::in); if (!mp_file.good()) { - Display::ScreenMessage("! Error in MMPRead: No material data !\n"); + ScreenMessage("! Error in MMPRead: No material data !\n"); return false; } mp_file.seekg(0L, std::ios::beg); @@ -205,7 +206,7 @@ bool MMPRead(std::string base_file_name) line_string = line; if (line_string.find("#STOP") != string::npos) { - Display::ScreenMessage("done, read %d medium properties\n", + ScreenMessage("done, read %d medium properties\n", mmp_vector.size()); return true; @@ -811,7 +812,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) { if (!PCSGet("DEFORMATION")) { - Display::ScreenMessage( + ScreenMessage( "Error: Porosity model 7 must be combined with " "deformation process"); exit(EXIT_FAILURE); @@ -1153,7 +1154,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) case 2: // krg = 1.0 - krl (only for gas phase) if (k == 0) { - Display::ScreenMessage( + ScreenMessage( "ERROR in MMPRead: Relative permeability model " "2 is only valid for the gas phase.\n"); exit(0); @@ -1307,7 +1308,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) // default: { - Display::ScreenMessage( + ScreenMessage( "Error in MMPRead: no valid permeability " "saturation model.\n"); abort(); @@ -1684,7 +1685,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) if (capillary_pressure_values[2] >= 0.0) { // Then a constant saturation value has been entered. // This is model #2. - Display::ScreenMessage( + ScreenMessage( "WARNING in MMPRead. Capillary pressure model 1 " "used for a constant saturation. THIS IS " "NOW MODEL #2. PLEASE SWITCH TO MODEL #2.\n"); @@ -1771,7 +1772,7 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) in >> capillary_pressure_values[0]; // Pb break; default: - Display::ScreenMessage( + ScreenMessage( "Error in MMPRead: no valid capillary pressure " "model.\n"); exit(1); @@ -1779,13 +1780,13 @@ std::ios::pos_type CMediumProperties::Read(std::ifstream* mmp_file) } if (old_format) { - Display::ScreenMessage( + ScreenMessage( "\n--\n Adopting capillary pressure saturation parameters " "from the\n"); - Display::ScreenMessage( + ScreenMessage( " relative permeability function for phase 0. " "Alternatively, you\n"); - Display::ScreenMessage( + ScreenMessage( " may enter capillary pressure specific parameters " "directly.\n--/n"); } @@ -2505,7 +2506,7 @@ double CMediumProperties::PermeabilitySaturationFunction( switch (model) { default: - Display::ScreenMessage( + ScreenMessage( "ERROR in PermeabilitySaturationFunction(): Unrecognized " "relative permeability method.\n"); exit(0); @@ -2525,7 +2526,7 @@ double CMediumProperties::PermeabilitySaturationFunction( case 2: // krg = 1.0 - krl // No need to come here. Method will have been shifted to the liquid // phase. - Display::ScreenMessage( + ScreenMessage( "ERROR in PermeabilitySaturationFunction(). Shouldn't be " "here.\n"); break; @@ -4351,7 +4352,7 @@ double CMediumProperties::Porosity(CElement* assem) #endif default: - Display::DisplayMsgLn("Unknown porosity model!"); + DisplayMsgLn("Unknown porosity model!"); break; } //---------------------------------------------------------------------- @@ -5152,7 +5153,7 @@ double CMediumProperties::CapillaryPressureFunction( switch (capillary_pressure_model) { default: - Display::ScreenMessage( + ScreenMessage( "Error in CFluidProperties::CapillaryPressure: no valid " "material model.\n"); exit(0); @@ -5169,8 +5170,8 @@ double CMediumProperties::CapillaryPressureFunction( // case 2: // Constant saturation for pp models (for WX, from JT) (MUST BE // A PP MODEL, SO WON'T COME HERE) - Display::ScreenMessage("ERROR: in CFluidProperties::CapillaryPressure:"); - Display::ScreenMessage( + ScreenMessage("ERROR: in CFluidProperties::CapillaryPressure:"); + ScreenMessage( "Constant saturation is not possible for a PS model " "(PwSnw).\n"); exit(0); @@ -5231,7 +5232,7 @@ double CMediumProperties::SaturationCapillaryPressureFunction( switch (capillary_pressure_model) { default: - Display::ScreenMessage( + ScreenMessage( "Error in " "CFluidProperties::SaturationCapillaryPressureFunction: no " "valid material model.\n"); @@ -5248,10 +5249,10 @@ double CMediumProperties::SaturationCapillaryPressureFunction( break; // case 1: // Constant capillary pressure for ps models - Display::ScreenMessage( + ScreenMessage( "ERROR: in " "CFluidProperties::SaturationCapillaryPressureFunction:"); - Display::ScreenMessage( + ScreenMessage( "Constant capillary pressure is not possible for a pressure " "model (PcPnw, PwPnw, or Richards).\n"); exit(0); @@ -5340,7 +5341,7 @@ Richard's flow) return 0.0; switch(capillary_pressure_model) { default: - Display::ScreenMessage("Error in + ScreenMessage("Error in CFluidProperties::SaturationPressureDependency: no valid material model.\n"); exit(0); break; @@ -5412,7 +5413,7 @@ double CMediumProperties::PressureSaturationDependency( switch (capillary_pressure_model) { default: - Display::ScreenMessage( + ScreenMessage( "Error in CFluidProperties::PressureSaturationDependency: no " "valid material model.\n"); exit(0); @@ -6301,7 +6302,7 @@ double GetAverageHetVal2(long EleIndex, { ihet = GetNearestHetVal2(EleIndex, m_msh, xvals, yvals, zvals, mmpvals); if (ihet < 0) - Display::DisplayMsgLn(" Error getting nearest het_value location"); + DisplayMsgLn(" Error getting nearest het_value location"); else average = mmpvals[ihet]; } @@ -7315,7 +7316,7 @@ double CMediumProperties::TortuosityFunction(long number, double* gp, tortuosity = Porosity(number, theta) * tortuosity_model_values[0]; break; default: - Display::DisplayMsgLn("Unknown tortuosisty model!"); + DisplayMsgLn("Unknown tortuosisty model!"); break; } return tortuosity; @@ -7993,7 +7994,7 @@ double CMediumProperties::StorageFunction(long index, double* gp, double theta) << std::endl; break; default: - storage = 0.0; // OK Display::DisplayMsgLn("The requested storativity model + storage = 0.0; // OK DisplayMsgLn("The requested storativity model // is unknown!!!"); break; } @@ -8145,8 +8146,8 @@ double CMediumProperties::PermeabilityPressureFunction(long index, double* gp, switch (ElGetElementType(index)) { default: - Display::DisplayMsgLn("Error in GetSoilRelPermPress!"); - Display::DisplayMsgLn(" Nonlinear permeability not available!"); + DisplayMsgLn("Error in GetSoilRelPermPress!"); + DisplayMsgLn(" Nonlinear permeability not available!"); abort(); case 2: Calc2DElementJacobiMatrix(index, 0.0, 0.0, invjac, &detjac); diff --git a/FEM/rf_msp_new.cpp b/FEM/rf_msp_new.cpp index 40b1b8c08..fb0328b5c 100644 --- a/FEM/rf_msp_new.cpp +++ b/FEM/rf_msp_new.cpp @@ -53,6 +53,8 @@ std::vector msp_vector; std::vector msp_key_word_vector; // OK +using namespace Display; + namespace SolidProp { using namespace std; @@ -8817,7 +8819,7 @@ bool MSPRead(const std::string& given_file_base_name) msp_file.seekg(0L, std::ios::beg); //======================================================================== // Keyword loop - Display::ScreenMessage("MSPRead ... \n"); + ScreenMessage("MSPRead ... \n"); while (!msp_file.eof()) { @@ -8825,7 +8827,7 @@ bool MSPRead(const std::string& given_file_base_name) line_string = line; if (line_string.find("#STOP") != string::npos) { - Display::ScreenMessage( + ScreenMessage( "done, read %d sets of solid properties terms\n", msp_vector.size()); return true; diff --git a/FEM/rf_num_new.cpp b/FEM/rf_num_new.cpp index 8935ae9ce..1139bd030 100644 --- a/FEM/rf_num_new.cpp +++ b/FEM/rf_num_new.cpp @@ -59,6 +59,7 @@ // GeoSys-MSHLib using namespace std; +using namespace Display; extern std::ios::pos_type GetNextSubKeyword(ifstream* file, string* line, bool* keyword); @@ -206,7 +207,7 @@ bool NUMRead(string file_base_name) num_file.seekg(0L, ios::beg); //======================================================================== // Keyword loop - Display::ScreenMessage("NUMRead ...\n"); + ScreenMessage("NUMRead ...\n"); int max_num_integration_pnts = 0; while (!num_file.eof()) @@ -223,7 +224,7 @@ bool NUMRead(string file_base_name) num_vector[i]->ele_gauss_points = max_num_integration_pnts; } - Display::ScreenMessage("done, read %d numerical properties\n", + ScreenMessage("done, read %d numerical properties\n", num_vector.size()); return true; } @@ -455,7 +456,7 @@ ios::pos_type CNumerics::Read(ifstream* num_file) break; // default: - Display::ScreenMessage( + ScreenMessage( "ERROR in NUMRead. Invalid non-linear iteration error " "method selected.\n"); exit(1); @@ -474,13 +475,13 @@ ios::pos_type CNumerics::Read(ifstream* num_file) } else if (line_string.find("$NON_LINEAR_SOLVER") != string::npos) { - Display::ScreenMessage(" --\n Using old $NON_LINEAR_SOLVER keyword.\n"); - Display::ScreenMessage( + ScreenMessage(" --\n Using old $NON_LINEAR_SOLVER keyword.\n"); + ScreenMessage( " Eventually this will be obsolete. Consider switching to\n"); - Display::ScreenMessage( + ScreenMessage( " $NON_LINEAR_ITERATIONS for better results and greater " "flexibility.\n"); - Display::ScreenMessage(" --\n"); + ScreenMessage(" --\n"); // // JT: in >> method_name // in >> tolerance @@ -553,8 +554,8 @@ ios::pos_type CNumerics::Read(ifstream* num_file) // JT subkeyword found if (line_string.find("$COUPLING_ITERATIONS") != string::npos) { - Display::ScreenMessage("$COUPLING_ITERATIONS keyword obsolete.\n"); - Display::ScreenMessage( + ScreenMessage("$COUPLING_ITERATIONS keyword obsolete.\n"); + ScreenMessage( "Use $COUPLING_CONTROL and $COUPLED_PROCESS for process " "couplings.\n"); exit(1); @@ -601,17 +602,17 @@ ios::pos_type CNumerics::Read(ifstream* num_file) break; // case FiniteElement::BNORM: - Display::ScreenMessage( + ScreenMessage( "ERROR in NUMRead. BNORM not configured for process " "couplings.\n"); - Display::ScreenMessage( + ScreenMessage( "We suggest ENORM as a valid companion for NEWTON " "couplings.\n"); exit(1); break; // default: - Display::ScreenMessage( + ScreenMessage( "ERROR in NUMRead. Invalid coupling error method " "selected.\n"); exit(1); @@ -649,7 +650,7 @@ ios::pos_type CNumerics::Read(ifstream* num_file) } else { - Display::ScreenMessage( + ScreenMessage( "WARNING. $COUPLED_PROCESS keyword encountered, but a " "valid process OR primary variable was not " "found.\n"); @@ -768,7 +769,7 @@ ios::pos_type CNumerics::Read(ifstream* num_file) // step will be dampened line >> newton_damping_factor; // dampened by this factor line.clear(); - Display::ScreenMessage( + ScreenMessage( "NR step will be damped by %g" " if relative residual or relative unknown increment " " decrease by less than %g" diff --git a/FEM/rf_out_new.cpp b/FEM/rf_out_new.cpp index c6c2b01a7..97c87baab 100644 --- a/FEM/rf_out_new.cpp +++ b/FEM/rf_out_new.cpp @@ -89,6 +89,8 @@ extern size_t max_dim; // OK411 todo #include "rf_REACT_GEM.h" #endif using MeshLib::CFEMesh; +using namespace Display; + //========================================================================== vector out_vector; @@ -143,7 +145,7 @@ bool OUTRead(const std::string& file_base_name, out_file.seekg(0L, ios::beg); // Keyword loop - Display::ScreenMessage("OUTRead ... "); + ScreenMessage("OUTRead ... "); while (!out_file.eof()) { @@ -151,7 +153,7 @@ bool OUTRead(const std::string& file_base_name, line_string = line; if (line_string.find("#STOP") != string::npos) { - Display::ScreenMessage("done, read %d output definitions\n", + ScreenMessage("done, read %d output definitions\n", out_vector.size()); return true; } @@ -776,7 +778,7 @@ COutput* OUTGetRWPT(const std::string& out_name) *****************************************************************************************/ void OUTCheck() { - Display::ScreenMessage("Checking output data\n"); + ScreenMessage("Checking output data\n"); // Go through all out objects (#OUTPUT-section in input file) for (size_t i = 0; i < out_vector.size(); i++) diff --git a/FEM/rf_pcs.cpp b/FEM/rf_pcs.cpp index 8f69c58f9..460166b2e 100644 --- a/FEM/rf_pcs.cpp +++ b/FEM/rf_pcs.cpp @@ -137,6 +137,7 @@ REACT_BRNS* m_vec_BRNS; using namespace std; using namespace MeshLib; using namespace Math_Group; +using namespace Display; /*-------------------- ITPACKV ---------------------------*/ extern void transM2toM6(void); @@ -573,10 +574,10 @@ CRFProcess::~CRFProcess(void) #endif if (_init_domain_data_type == FiniteElement::READ) { - Display::ScreenMessage( + ScreenMessage( "!!!Waning: Reading and writing solutions (reload=3)\ are selected in this computation.\n"); - Display::ScreenMessage( + ScreenMessage( "\t Please make sure that the original initial\ data files are used.\n"); } @@ -618,11 +619,11 @@ void CRFProcess::Create() std::string pcs_type_name( convertProcessTypeToString(this->getProcessType())); - Display::ScreenMessage("Create: %s \n", pcs_type_name.data()); + ScreenMessage("Create: %s \n", pcs_type_name.data()); if (getProcessType() == FiniteElement::MASS_TRANSPORT) // SB { - Display::ScreenMessage(" for %s process with component number %d\n", + ScreenMessage(" for %s process with component number %d\n", pcs_primary_function_name[0], pcs_component_number); } @@ -633,7 +634,7 @@ void CRFProcess::Create() // Element matrix output. WW if (Write_Matrix) { - Display::ScreenMessage("->Write Matrix'\n"); + ScreenMessage("->Write Matrix'\n"); #if defined(USE_MPI) || defined(USE_PETSC) char stro[32]; @@ -661,7 +662,7 @@ void CRFProcess::Create() //---------------------------------------------------------------------------- // MMP - create mmp groups for each process //YD - Display::ScreenMessage("->Create MMP\n"); + ScreenMessage("->Create MMP\n"); CMediumPropertiesGroup* m_mmp_group = NULL; int continua = 1; // WW if (RD_Process) @@ -678,7 +679,7 @@ void CRFProcess::Create() m_mmp_group = NULL; //---------------------------------------------------------------------------- // NUM_NEW - Display::ScreenMessage("->Create NUM\n"); + ScreenMessage("->Create NUM\n"); // if (pcs_type_name.compare("RANDOM_WALK")) { // PCH RWPT does not need // this. @@ -702,7 +703,7 @@ void CRFProcess::Create() } if (!m_num) { - Display::ScreenMessage( + ScreenMessage( "Warning in CRFProcess::Create() - no NUM data\n"); m_num = new CNumerics(pcs_type_name); // OK // m_num = m_num_tmp; @@ -730,7 +731,7 @@ void CRFProcess::Create() //---------------------------------------------------------------------------- // EQS - create equation system // WW CreateEQS(); - Display::ScreenMessage("->Create EQS\n"); + ScreenMessage("->Create EQS\n"); #if !defined(USE_PETSC) // && !defined(other parallel solver lib). 04.2012 WW #if defined(NEW_EQS) @@ -834,7 +835,7 @@ void CRFProcess::Create() //---------------------------------------------------------------------------- // Time unit factor //WW - Display::ScreenMessage("->Create TIM\n"); + ScreenMessage("->Create TIM\n"); // CTimeDiscretization* Tim = TIMGet(_pcs_type_name); Tim = TIMGet(pcs_type_name); if (!Tim) @@ -875,12 +876,12 @@ void CRFProcess::Create() m_msh->SwitchOnQuadraticNodes(false); // ELE - config and create element values - Display::ScreenMessage("->Config ELE values\n"); + ScreenMessage("->Config ELE values\n"); AllocateMemGPoint(); // ELE - config element matrices // NOD - config and create node values - Display::ScreenMessage("->Config NOD values\n"); + ScreenMessage("->Config NOD values\n"); double* nod_values = NULL; double* ele_values = NULL; // PCH @@ -942,7 +943,7 @@ void CRFProcess::Create() type != 4 && type / 10 != 4) // Modified at 03.08.2010. WW { // PCH - Display::ScreenMessage("Reloading the primary variables...\n"); + ScreenMessage("Reloading the primary variables...\n"); ReadSolution(); // WW } @@ -951,12 +952,12 @@ void CRFProcess::Create() FiniteElement::WRITE) // PCH: If reload is set, no need to have ICs { // IC - Display::ScreenMessage("->Assign IC\n"); + ScreenMessage("->Assign IC\n"); SetIC(); } else // Bypassing IC - Display::ScreenMessage("RELOAD is set to be %d. So, bypassing IC's\n", + ScreenMessage("RELOAD is set to be %d. So, bypassing IC's\n", _init_domain_data_type); if (pcs_type_name_vector.size() && @@ -1095,7 +1096,7 @@ void CRFProcess::SetBoundaryConditionAndSourceTerm() { const int DOF = GetPrimaryVNumber(); // BC - create BC groups for each process - Display::ScreenMessage("-> Create BC\n"); + ScreenMessage("-> Create BC\n"); CBoundaryConditionsGroup* m_bc_group = NULL; // 25.08.2011. WW @@ -1139,7 +1140,7 @@ void CRFProcess::SetBoundaryConditionAndSourceTerm() Write_Processed_BC(); } // ST - create ST groups for each process - Display::ScreenMessage("-> Create ST\n"); + ScreenMessage("-> Create ST\n"); CSourceTermGroup* m_st_group = NULL; if (WriteSourceNBC_RHS == 2) // Read from file @@ -1775,7 +1776,7 @@ bool PCSRead(std::string file_base_name) pcs_file.seekg(0, std::ios::beg); //======================================================================== // Keyword loop - Display::ScreenMessage("PCSRead ... "); + ScreenMessage("PCSRead ... "); while (!pcs_file.eof()) { pcs_file.getline(line, MAX_ZEILE); @@ -1815,7 +1816,7 @@ bool PCSRead(std::string file_base_name) } // keyword found } // eof - Display::ScreenMessage("done, read %d processes\n", + ScreenMessage("done, read %d processes\n", pcs_vector.size()); return true; @@ -2555,7 +2556,7 @@ void CRFProcess::Config(void) if (this->getProcessType() == FiniteElement::LIQUID_FLOW || this->getProcessType() == FiniteElement::FLUID_FLOW) { - Display::ScreenMessage("CRFProcess::Config LIQUID_FLOW\n"); + ScreenMessage("CRFProcess::Config LIQUID_FLOW\n"); type = 1; ConfigLiquidFlow(); @@ -4708,7 +4709,7 @@ double CRFProcess::Execute() const_val = GetCurveValue(_pcs_constant_curve, 0, aktuelle_zeit, &valid); } - Display::ScreenMessage( + ScreenMessage( "-> set given constant value. no need to solve a linear system.\n"); for (int ii = 0; ii < pcs_number_of_primary_nvals; ii++) @@ -4812,7 +4813,7 @@ double CRFProcess::Execute() cpu_time = -clock(); #endif - Display::ScreenMessage(" Assembling equation system...\n"); + ScreenMessage(" Assembling equation system...\n"); GlobalAssembly(); #if defined(USE_MPI) || defined(USE_PETSC) // WW @@ -4820,7 +4821,7 @@ double CRFProcess::Execute() cpu_time_assembly += cpu_time; #endif - Display::ScreenMessage(" Calling linear solver...\n"); + ScreenMessage(" Calling linear solver...\n"); #ifdef CHECK_EQS std::string eqs_name = @@ -4862,8 +4863,8 @@ double CRFProcess::Execute() true, false); // JT #endif - Display::ScreenMessage(" Relative PCS error: %0.3e\n", pcs_error); - Display::ScreenMessage(" Start FCT calculation\n"); + ScreenMessage(" Relative PCS error: %0.3e\n", pcs_error); + ScreenMessage(" Start FCT calculation\n"); // Set u^H: use the solution as the higher-order solution for (int ii = 0; ii < pcs_number_of_primary_nvals; ii++) @@ -5220,7 +5221,7 @@ void CRFProcess::CalculateElementMatrices(void) case 66: // OF break; default: - Display::DisplayMsgLn( + DisplayMsgLn( "CalculateElementMatrices: no CalculateElementMatrices " "specified"); abort(); @@ -5673,7 +5674,7 @@ void CRFProcess::GlobalAssembly() // DDC if (dom_vector.size() > 0) { - Display::ScreenMessage(" Domain Decomposition\n"); + ScreenMessage(" Domain Decomposition\n"); CPARDomain* m_dom = NULL; size_t j = 0; #if defined(USE_MPI) // WW @@ -5946,7 +5947,7 @@ void CRFProcess::CalIntegrationPointValue() return; } - Display::ScreenMessage("->Calculate velocity\n"); + ScreenMessage("->Calculate velocity\n"); // check linear flow or not bool isLinearFlow = true; @@ -6377,7 +6378,7 @@ void CRFProcess::AssembleSystemMatrixNew(void) // SMAssembleMatrix(eqs->b,eqs->x,ddummy,this); break; default: - Display::DisplayMsgLn( + DisplayMsgLn( "CalculateElementMatrices: no CalculateElementMatrices " "specified"); abort(); @@ -8627,7 +8628,7 @@ int CRFProcess::ExecuteLinearSolver(LINEAR_SOLVER* eqs) eqs->master_iter = iter_count; if (iter_count >= cg_maxiter) { - Display::ScreenMessage( + ScreenMessage( "Warning in CRFProcess::ExecuteLinearSolver() - Maximum " "iteration number reached\n"); return -1; @@ -8693,7 +8694,7 @@ void CRFProcess::PCSMoveNOD(void) MSHMoveNODUcFlow(this); break; default: - Display::DisplayMsgLn("PCSMoveNOD: no valid process"); + DisplayMsgLn("PCSMoveNOD: no valid process"); abort(); } } @@ -8867,14 +8868,14 @@ string GetPFNamebyCPName(string inname) int GetRFProcessNumPhases(void) { - // Display::DisplayMsgLn("GetRFProcessNumPhases - to be removed"); + // DisplayMsgLn("GetRFProcessNumPhases - to be removed"); int no_phases = (int)mfp_vector.size(); return no_phases; } long GetRFProcessNumComponents(void) { - // Display::DisplayMsgLn("GetRFProcessNumComponents - to be removed"); + // DisplayMsgLn("GetRFProcessNumComponents - to be removed"); int no_components = (int)cp_vec.size(); return no_components; } @@ -9470,7 +9471,7 @@ double CRFProcess::CalcIterationNODError(FiniteElement::ErrorMethod method, break; // default: - Display::ScreenMessage( + ScreenMessage( "ERROR: Invalid error method for Iteration or Coupling Node " "error.\n"); return 0.0; @@ -9730,7 +9731,7 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) last_error = 1.0; for (iter_nlin = 0; iter_nlin < m_num->nls_max_iterations; iter_nlin++) { - Display::ScreenMessage(" PCS non-linear iteration: %d/%d\n", + ScreenMessage(" PCS non-linear iteration: %d/%d\n", iter_nlin, m_num->nls_max_iterations); nonlinear_iteration_error = Execute(); // @@ -9837,7 +9838,7 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) } else { - Display::ScreenMessage( + ScreenMessage( "Attention: Newton-Raphson step is " "diverged. Program halt! \n"); #if defined(USE_PETSC) // || defined(other parallel libs)//08.3012. WW @@ -9872,12 +9873,12 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) } } - Display::ScreenMessage( + ScreenMessage( " NR-Error |" " RHS Norm|" " Unknowns Norm|" " Damping\n"); - Display::ScreenMessage( + ScreenMessage( " %0.3e |" " %0.3e|" " %0.3e|" @@ -9975,7 +9976,7 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) { if (accepted) // only increment if not fixed by a failed time step. num_diverged++; - Display::ScreenMessage("\nNon-linear iteration stabilized.\n"); + ScreenMessage("\nNon-linear iteration stabilized.\n"); } else if (!converged) { @@ -9984,7 +9985,7 @@ double CRFProcess::ExecuteNonLinear(int loop_process_number, bool print_pcs) if (Tim->GetPITimeStepCrtlType() < 1) // PI has the intrinsic property of doing this. So don't // print it. - Display::ScreenMessage( + ScreenMessage( "\nMax number of non-linear iterations reached.\n"); } } @@ -10021,13 +10022,13 @@ void CRFProcess::PrintStandardIterationInformation(bool write_std_errors) // LINEAR SOLUTION if (m_num->nls_method < 0) { - Display::ScreenMessage(" -->LINEAR solution complete.\n"); + ScreenMessage(" -->LINEAR solution complete.\n"); if (write_std_errors) { for (ii = 0; ii < pcs_number_of_primary_nvals; ii++) { - Display::ScreenMessage( + ScreenMessage( " PCS error DOF[%d] %0.3e\n", ii, pcs_absolute_error[ii]); } @@ -10037,10 +10038,10 @@ void CRFProcess::PrintStandardIterationInformation(bool write_std_errors) // // NON-LINEAR METHODS if (m_num->nls_method == 0) - Display::ScreenMessage(" -->End of PICARD iteration: %d/%d\n", + ScreenMessage(" -->End of PICARD iteration: %d/%d\n", iter_nlin, m_num->nls_max_iterations); else - Display::ScreenMessage( + ScreenMessage( " -->End of NEWTON-RAPHSON iteration: %d/%d\n", iter_nlin, m_num->nls_max_iterations); // @@ -10050,19 +10051,19 @@ void CRFProcess::PrintStandardIterationInformation(bool write_std_errors) { if (pcs_num_dof_errors == 1) { - Display::ScreenMessage( + ScreenMessage( " PCS error: %0.3e\n", pcs_absolute_error[0]); } else { for (ii = 0; ii < pcs_number_of_primary_nvals; ii++) { - Display::ScreenMessage( + ScreenMessage( " PCS error DOF[%d]: %0.3e\n", ii, pcs_absolute_error[ii]); } } - Display::ScreenMessage( + ScreenMessage( " ->Euclidian norm of unknowns: %0.3e\n", pcs_unknowns_norm); } @@ -13699,7 +13700,7 @@ void CRFProcess::PI_TimeStepSize() // DDC if (dom_vector.size() > 0) { - Display::ScreenMessage(" Domain Decomposition\n"); + ScreenMessage(" Domain Decomposition\n"); CPARDomain* m_dom = NULL; int j = 0; // diff --git a/FEM/rf_react.cpp b/FEM/rf_react.cpp index 8dc17a3d1..8bbb3e61b 100644 --- a/FEM/rf_react.cpp +++ b/FEM/rf_react.cpp @@ -43,6 +43,7 @@ #include using namespace std; +using namespace Display; void destroy_react(void* item); @@ -100,7 +101,7 @@ void REACT::ExecuteReactionsPHREEQC(void) FILE *indatei, *fphinp, *fsel_out = NULL; char fsout[80]; - Display::DisplayMsgLn("ExecuteReactionsPHREEQC:"); + DisplayMsgLn("ExecuteReactionsPHREEQC:"); /* Initialize arrays of concentrations and array for reaction rates (list, * in pretimeloop)*/ @@ -142,7 +143,7 @@ void REACT::ExecuteReactionsPHREEQC(void) } else { - Display::DisplayMsgLn("The file phinput.dat could not be opened !"); + DisplayMsgLn("The file phinput.dat could not be opened !"); exit(1); } @@ -156,14 +157,14 @@ void REACT::ExecuteReactionsPHREEQC(void) fsel_out = fopen(fsout, "r"); if ((ok) && !fsel_out) { - Display::DisplayMsgLn("The selected output file doesn't exist!!!"); + DisplayMsgLn("The selected output file doesn't exist!!!"); exit(1); } else if (ok) { ok = ReadOutputPhreeqc(fsout); if (!ok) - Display::DisplayMsgLn(" Error in call to PHREEQC !!!"); + DisplayMsgLn(" Error in call to PHREEQC !!!"); fclose(fsel_out); } } /* if flag */ @@ -182,24 +183,24 @@ void REACT::ExecuteReactionsPHREEQC(void) /* test output*/ /* for(comp=0; compnumber_of_comp;comp++){ - Display::DisplayMsg("component : "); Display::DisplayLong(comp);Display::DisplayMsg(", name = "); - Display::DisplayMsg(this->name[comp]);Display::DisplayMsgLn(". "); - Display::DisplayMsgLn("val_in: "); + DisplayMsg("component : "); DisplayLong(comp);DisplayMsg(", name = "); + DisplayMsg(this->name[comp]);DisplayMsgLn(". "); + DisplayMsgLn("val_in: "); for(i=0;inodenumber;i++){ - Display::DisplayDouble(this->val_in[comp][i],0,0); Display::DisplayMsg(", ");} - Display::DisplayMsgLn(" "); - Display::DisplayMsgLn("val_out: "); + DisplayDouble(this->val_in[comp][i],0,0); DisplayMsg(", ");} + DisplayMsgLn(" "); + DisplayMsgLn("val_out: "); for(i=0;inodenumber;i++){ - Display::DisplayDouble(this->val_out[comp][i],0,0); Display::DisplayMsg(", ");} - Display::DisplayMsgLn(" "); + DisplayDouble(this->val_out[comp][i],0,0); DisplayMsg(", ");} + DisplayMsgLn(" "); - Display::DisplayMsgLn("rate : "); - for(i=0;inodenumber;i++){ Display::DisplayDouble(this->rate[comp][i],0,0); - Display::DisplayMsg(", ");} Display::DisplayMsgLn(" "); + DisplayMsgLn("rate : "); + for(i=0;inodenumber;i++){ DisplayDouble(this->rate[comp][i],0,0); + DisplayMsg(", ");} DisplayMsgLn(" "); } - Display::DisplayMsgLn("rateflag : "); - for(i=0;inodenumber;i++){ Display::DisplayDouble((double) - this->rateflag[i],0,0); Display::DisplayMsg(", ");} Display::DisplayMsgLn(" "); + DisplayMsgLn("rateflag : "); + for(i=0;inodenumber;i++){ DisplayDouble((double) + this->rateflag[i],0,0); DisplayMsg(", ");} DisplayMsgLn(" "); */ } /* End of ExecuteReactionsPHREEQC */ @@ -1739,13 +1740,13 @@ void REACT::InitREACT(void) { if (abs(this->val_in[comp][i]) > MKleinsteZahl) { - Display::DisplayMsg(" Neg. conc for component "); - Display::DisplayLong((long)comp); - Display::DisplayMsg(" at node "); - Display::DisplayLong((long)i); - Display::DisplayMsg("; conc = "); - Display::DisplayDouble(this->val_in[comp][i], 0, 0); - Display::DisplayMsgLn(" "); + DisplayMsg(" Neg. conc for component "); + DisplayLong((long)comp); + DisplayMsg(" at node "); + DisplayLong((long)i); + DisplayMsg("; conc = "); + DisplayDouble(this->val_in[comp][i], 0, 0); + DisplayMsgLn(" "); } this->val_in[comp][i] = 0.0 * this->val_in[comp][i]; } @@ -1834,13 +1835,13 @@ void REACT::InitREACT0() { if (abs(this->val_in[comp][i]) > MKleinsteZahl) { - Display::DisplayMsg(" Neg. conc for component "); - Display::DisplayLong((long)comp); - Display::DisplayMsg(" at node "); - Display::DisplayLong((long)i); - Display::DisplayMsg("; conc = "); - Display::DisplayDouble(this->val_in[comp][i], 0, 0); - Display::DisplayMsgLn(" "); + DisplayMsg(" Neg. conc for component "); + DisplayLong((long)comp); + DisplayMsg(" at node "); + DisplayLong((long)i); + DisplayMsg("; conc = "); + DisplayDouble(this->val_in[comp][i], 0, 0); + DisplayMsgLn(" "); } this->val_in[comp][i] = 0.0 * this->val_in[comp][i]; } @@ -2173,8 +2174,8 @@ int REACT::ReadReactionModel(FILE* File) /* Open input file and read the reaction model values*/ if (indatei == NULL) /*input dateien does not exist*/ { - Display::DisplayMsgLn(""); - Display::DisplayMsgLn(" The input file *.pqc does not exist!!!"); + DisplayMsgLn(""); + DisplayMsgLn(" The input file *.pqc does not exist!!!"); exit(1); } /*end if*/ @@ -2246,7 +2247,7 @@ int REACT::ReadReactionModel(FILE* File) while (fgets(str, 256, indatei) && (!strstr(str, "#ende"))) if (strstr(str, "-file")) { - Display::DisplayMsgLn("-file in *.pqc found"); + DisplayMsgLn("-file in *.pqc found"); p = 0; StringReadStr(&sub, str, &p); StringReadStr(&sub1, &str[p], &p); @@ -2267,7 +2268,7 @@ int REACT::ReadReactionModel(FILE* File) nj = rcml_number_of_master_species + rcml_number_of_equi_phases + rcml_number_of_ion_exchanges; if (nj + 2 != this->number_of_comp) - Display::DisplayMsgLn( + DisplayMsgLn( "!!!Error:Number of components in file *.pqc is not equal to that " "in file *.rfd!"); // fclose(indatei); @@ -2742,15 +2743,15 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) if (indatei == NULL) { - Display::DisplayMsgLn("Erro:The input file *.pqc doesn't exist!!!"); + DisplayMsgLn("Erro:The input file *.pqc doesn't exist!!!"); return 0; } /* zeilenweise lesen */ while (fgets(str, 256, indatei)) { - // Display::DisplayMsgLn(""); - // Display::DisplayMsgLn(str); + // DisplayMsgLn(""); + // DisplayMsgLn(str); pos = 0; // WW beginn=1; @@ -2779,12 +2780,12 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) while (fgets(str, 256, indatei) && (!strstr(str, "#ende"))) { if ((!strstr(str, "# comp")) && (!strstr(str, "# temp"))) - // Display::DisplayMsgLn(" #ende and # not found"); + // DisplayMsgLn(" #ende and # not found"); FilePrintString(f, str); else { - // Display::DisplayMsgLn(" # comp found "); + // DisplayMsgLn(" # comp found "); // sscanf(str, "%s"); StrReadStr(s, str, f, /*TFString,*/ &pos); @@ -2886,7 +2887,7 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) if (pH_flag < 0) { - Display::DisplayMsgLn( + DisplayMsgLn( "pH is not included in the transport " "but will be calculated in the " "reaction"); @@ -2940,7 +2941,7 @@ int REACT::ReadInputPhreeqc(long index, FILE* fpqc, FILE* Fphinp) if (pe_flag < 0) { - Display::DisplayMsgLn( + DisplayMsgLn( "pe is not included in the transport " "but will be calculated in the " "reaction"); @@ -4128,11 +4129,11 @@ int REACT::Call_Phreeqc(void) strcpy(m_phreeqc, mm_phreeqc.c_str()); #ifdef PHREEQC if (!system(m_phreeqc)) - // Display::DisplayMsgLn("Phreeqc runs succesfully! "); + // DisplayMsgLn("Phreeqc runs succesfully! "); return 1; else { - Display::DisplayMsgLn("Warnung: Phreeqc doesn't run properly!!! "); + DisplayMsgLn("Warnung: Phreeqc doesn't run properly!!! "); exit(1); } #endif @@ -4174,7 +4175,7 @@ int REACT::ReadOutputPhreeqc(char* fout) ein.open(fout); if (!ein) { - Display::DisplayMsgLn("The selected output file doesn't exist!!!"); + DisplayMsgLn("The selected output file doesn't exist!!!"); return 0; } /* get total number of species in PHREEQC output file */ @@ -4639,7 +4640,7 @@ void REACT::CalculateReactionRateFlag(void) else { // determine for each node separately - Display::DisplayMsgLn(" sum of rates "); + DisplayMsgLn(" sum of rates "); helprates = (double*)Malloc(np * sizeof(double)); for (j = 0; j < np; j++) @@ -4651,17 +4652,17 @@ void REACT::CalculateReactionRateFlag(void) rate = 0.0; for (comp = 0; comp < np; comp++) rate = rate + fabs(this->rate[comp][i] * this->val_in[comp][i]); - Display::DisplayLong(i); - Display::DisplayMsg(": "); - Display::DisplayDouble(rate, 0, 0); - Display::DisplayMsgLn(" "); + DisplayLong(i); + DisplayMsg(": "); + DisplayDouble(rate, 0, 0); + DisplayMsgLn(" "); if (rate > schwellwert) this->rateflag[i] = 1; else this->rateflag[i] = 0; } // end for(irf[i]: "); - Display::DisplayLong(this->rateflag[i]); - Display::DisplayMsg(", this->rate[i]: "); - Display::DisplayDouble(this->rate[0][i], 0, 0); - Display::DisplayMsg(", help[i]: "); - Display::DisplayLong(help[i]); - Display::DisplayMsgLn(" "); + DisplayMsg(" i: "); + DisplayLong(i); + DisplayMsg(", this->rf[i]: "); + DisplayLong(this->rateflag[i]); + DisplayMsg(", this->rate[i]: "); + DisplayDouble(this->rate[0][i], 0, 0); + DisplayMsg(", help[i]: "); + DisplayLong(help[i]); + DisplayMsgLn(" "); if (help[i] > 0) { this->rateflag[i] = 1; j++; } } - Display::DisplayMsg("Total number of nodes, at which chemistry is calculated: "); - Display::DisplayLong(j); - Display::DisplayMsgLn(" "); + DisplayMsg("Total number of nodes, at which chemistry is calculated: "); + DisplayLong(j); + DisplayMsgLn(" "); // give back storage help = (int*)Free(help); @@ -4740,13 +4741,13 @@ void REACT::GetTransportResults(void) { if (abs(val_in[comp][i]) > MKleinsteZahl) { - Display::DisplayMsg(" Neg. conc for component "); - Display::DisplayLong((long)comp); - Display::DisplayMsg(" at node "); - Display::DisplayLong((long)i); - Display::DisplayMsg("; conc = "); - Display::DisplayDouble(val_in[comp][i], 0, 0); - Display::DisplayMsgLn(" "); + DisplayMsg(" Neg. conc for component "); + DisplayLong((long)comp); + DisplayMsg(" at node "); + DisplayLong((long)i); + DisplayMsg("; conc = "); + DisplayDouble(val_in[comp][i], 0, 0); + DisplayMsgLn(" "); } val_in[comp][i] = 0.0 * val_in[comp][i]; } @@ -4782,13 +4783,13 @@ void REACT::SetNeighborNodesActive(long startnode, long level, int* help) long *elems1d,*elems2d,*elems3d; int num_elems1d,num_elems2d,num_elems3d,num_elems; - // Display::DisplayMsg(" RSNNA: startnode: "); Display::DisplayLong(startnode); - Display::DisplayMsg(", level: "); Display::DisplayLong(level); Display::DisplayMsgLn(""); + // DisplayMsg(" RSNNA: startnode: "); DisplayLong(startnode); + DisplayMsg(", level: "); DisplayLong(level); DisplayMsgLn(""); // Ende rekursiv if(level == 0) { help[startnode] = 1; - // Display::DisplayMsg(" Knoten, Level 0 "); Display::DisplayLong(startnode); - Display::DisplayMsgLn(" "); + // DisplayMsg(" Knoten, Level 0 "); DisplayLong(startnode); + DisplayMsgLn(" "); } else { @@ -4806,7 +4807,7 @@ void REACT::SetNeighborNodesActive(long startnode, long level, int* help) anz_n = ElGetElementNodesNumber(elems1d[j]); for(k=0;k 0) GetTransportResults2Element(); @@ -4952,7 +4953,7 @@ void REACT::ExecuteReactionsPHREEQC0(void) } else { - Display::DisplayMsgLn("The file phinput.dat could not be opened !"); + DisplayMsgLn("The file phinput.dat could not be opened !"); exit(1); } @@ -4966,14 +4967,14 @@ void REACT::ExecuteReactionsPHREEQC0(void) fsel_out = fopen(fsout, "r"); if ((ok) && !fsel_out) { - Display::DisplayMsgLn("The selected output file doesn't exist!!!"); + DisplayMsgLn("The selected output file doesn't exist!!!"); exit(1); } else if (ok) { ok = ReadOutputPhreeqc(fsout); if (!ok) - Display::DisplayMsgLn(" Error in call to PHREEQC !!!"); + DisplayMsgLn(" Error in call to PHREEQC !!!"); fclose(fsel_out); } } /* if flag */ @@ -5026,13 +5027,13 @@ void REACT::GetTransportResults2Element() { if (abs(val_in[comp][i]) > MKleinsteZahl) { - Display::DisplayMsg(" Neg. conc for component "); - Display::DisplayLong((long)comp); - Display::DisplayMsg(" at node "); - Display::DisplayLong((long)i); - Display::DisplayMsg("; conc = "); - Display::DisplayDouble(val_in[comp][i], 0, 0); - Display::DisplayMsgLn(" "); + DisplayMsg(" Neg. conc for component "); + DisplayLong((long)comp); + DisplayMsg(" at node "); + DisplayLong((long)i); + DisplayMsg("; conc = "); + DisplayDouble(val_in[comp][i], 0, 0); + DisplayMsgLn(" "); } val_in[comp][i] = 0.0 * val_in[comp][i]; } @@ -5979,7 +5980,7 @@ int REACT::Call_PhreeqcLib( return 1; // ok == 1 for Geosys conventions else { - Display::DisplayMsgLn("Warning: libphreeqc doesn't run properly!!! "); + DisplayMsgLn("Warning: libphreeqc doesn't run properly!!! "); exit(1); } } diff --git a/FEM/rf_react_int.cpp b/FEM/rf_react_int.cpp index 1f2f1af8f..d371b7265 100644 --- a/FEM/rf_react_int.cpp +++ b/FEM/rf_react_int.cpp @@ -42,6 +42,8 @@ #include using namespace std; +using namespace Display; + extern double gravity_constant; vector REACTINT_vec; @@ -133,7 +135,7 @@ bool REACINTRead(string file_base_name) rei_file.seekg(0L, ios::beg); // rewind? //======================================================================== // Keyword loop - Display::ScreenMessage("REIRead ... \n"); + ScreenMessage("REIRead ... \n"); while (!rei_file.eof()) { @@ -154,7 +156,7 @@ bool REACINTRead(string file_base_name) if (!m_rei) { - Display::ScreenMessage( + ScreenMessage( " No keyword #REACTION_INTERFACE specified - setting defaults\n"); m_rei = new REACTINT(); REACTINT_vec.push_back(m_rei); @@ -255,7 +257,7 @@ bool REACTINT::Read(ifstream* rfd_file) speciesname = "NIX"; } else - Display::DisplayMsgLn( + DisplayMsgLn( " ERROR reading Water concentration relevant " "Species - skipping"); in.clear(); diff --git a/FEM/rf_st_new.cpp b/FEM/rf_st_new.cpp index 4a1a4f620..34096d64a 100644 --- a/FEM/rf_st_new.cpp +++ b/FEM/rf_st_new.cpp @@ -88,6 +88,7 @@ using Math_Group::vec; using MeshLib::CEdge; using MeshLib::CElem; using MeshLib::CNode; +using namespace Display; #ifndef GRAVITY_CONSTANT #define GRAVITY_CONSTANT 9.81 @@ -295,7 +296,7 @@ std::ios::pos_type CSourceTerm::Read(std::ifstream* st_file, } else { - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: In reading ST file, the input component names " "are not found in MCP file!!!"); exit(1); @@ -326,7 +327,7 @@ std::ios::pos_type CSourceTerm::Read(std::ifstream* st_file, } else { - Display::DisplayErrorMsg( + DisplayErrorMsg( "Error: In reading ST file, the input component names are " "not found in MCP file!!!"); exit(1); @@ -798,13 +799,13 @@ bool STRead(const std::string& file_base_name, if (!st_file.good()) { - Display::ScreenMessage( + ScreenMessage( "! Warning in STRead: No source terms !\n"); return false; } // Keyword loop - Display::ScreenMessage("STRead ... "); + ScreenMessage("STRead ... "); while (!st_file.eof()) { st_file.getline(line, MAX_ZEILE); @@ -833,7 +834,7 @@ bool STRead(const std::string& file_base_name, } } - Display::ScreenMessage("done, read %d source terms.\n", + ScreenMessage("done, read %d source terms.\n", st_vector.size()); return true; @@ -871,7 +872,7 @@ bool STRead(const std::string& file_base_name, } // keyword found } // eof - Display::ScreenMessage("done, read %d source terms\n", st_vector.size()); + ScreenMessage("done, read %d source terms\n", st_vector.size()); return true; } diff --git a/FEM/rf_tim_new.cpp b/FEM/rf_tim_new.cpp index 93c44bb7f..f50368141 100644 --- a/FEM/rf_tim_new.cpp +++ b/FEM/rf_tim_new.cpp @@ -35,7 +35,9 @@ #include "rfmat_cp.h" #include "tools.h" #include -// WW #include "elements.h" //set functions for stability criteria + +using namespace Display; + // ToDo double aktuelle_zeit; size_t aktueller_zeitschritt = 0; @@ -452,17 +454,17 @@ std::ios::pos_type CTimeDiscretization::Read(std::ifstream* tim_file) break; // case FiniteElement::BNORM: - Display::ScreenMessage( + ScreenMessage( "ERROR in TIMRead. BNORM not configured for " "time control.\n"); - Display::ScreenMessage( + ScreenMessage( "We suggest ENORM as a valid companion for " "NEWTON couplings.\n"); exit(1); break; // default: - Display::ScreenMessage( + ScreenMessage( "ERROR in TIMRead. Invalid error method " "selected for dynamic time control.\n"); exit(1); @@ -715,7 +717,7 @@ std::ios::pos_type CTimeDiscretization::Read(std::ifstream* tim_file) } else { - Display::ScreenMessage("ERROR: Unrecognized time control type.\n"); + ScreenMessage("ERROR: Unrecognized time control type.\n"); exit(1); } } // end of while @@ -759,7 +761,7 @@ bool TIMRead(std::string file_base_name) tim_file.seekg(0L, std::ios::beg); //======================================================================== // Keyword loop - Display::ScreenMessage("TIMRead ... "); + ScreenMessage("TIMRead ... "); while (!tim_file.eof()) { @@ -767,7 +769,7 @@ bool TIMRead(std::string file_base_name) line_string = line; if (line_string.find("#STOP") != std::string::npos) { - Display::ScreenMessage("done, read %d time stepping definitions\n", + ScreenMessage("done, read %d time stepping definitions\n", time_vector.size()); return true; } @@ -791,7 +793,7 @@ bool TIMRead(std::string file_base_name) << "\n"; if (!m_tim->tim_discrete->good()) { - Display::ScreenMessage( + ScreenMessage( "Warning : Time-Discrete files are not found\n"); } } @@ -1554,9 +1556,9 @@ double CTimeDiscretization::StableErrorAdaptive(void) if (!m_pcs) { // does this ever trigger? - Display::ScreenMessage( + ScreenMessage( "-> ERROR in StableErrorAdaptive: PCS not found\n"); - // Display::ScreenMessage("-> ERROR in " + + // ScreenMessage("-> ERROR in " + // convertTimeControlTypeToString(time_control_type).c_str() + // ": PCS not found\n"); //why is this not possible? return 0.0; @@ -1879,7 +1881,7 @@ double CTimeDiscretization::SelfAdaptiveTimeControl(void) } if (!m_pcs) { - Display::ScreenMessage("-> ERROR in SelfAdaptiveTimeControl(): PCS not found\n"); + ScreenMessage("-> ERROR in SelfAdaptiveTimeControl(): PCS not found\n"); return 0.0; } diff --git a/FEM/rfmat_cp.cpp b/FEM/rfmat_cp.cpp index dcdd7700b..dbfd51d15 100644 --- a/FEM/rfmat_cp.cpp +++ b/FEM/rfmat_cp.cpp @@ -49,6 +49,8 @@ using namespace std; #include "rf_REACT_GEM.h" #endif using SolidProp::CSolidProperties; +using namespace Display; + /* Vector auf CompProperties , globale Zugriffe */ // vector cp_vec; // do not need this anymore, use global map structure instead. @@ -142,14 +144,14 @@ bool CPRead(std::string file_base_name) { if (pcs_vector[0]->getProcessType() == FiniteElement::TNEQ) { - Display::DisplayMsgLn( + DisplayMsgLn( "ERROR. TNEQ requires specification of inert and reactive " "components in mcp file."); exit(1); } if (pcs_vector[0]->getProcessType() == FiniteElement::TES) { - Display::DisplayMsgLn( + DisplayMsgLn( "ERROR. TES requires specification of inert and reactive " "components in mcp file."); exit(1); @@ -160,7 +162,7 @@ bool CPRead(std::string file_base_name) //======================================================================== cp_vec.clear(); - Display::ScreenMessage("CPRead\n"); + ScreenMessage("CPRead\n"); // Schleife ueber alle Phasen bzw. Komponenten while (!cp_file.eof()) { @@ -202,7 +204,7 @@ bool CPRead(std::string file_base_name) pcs_vector[0]->getProcessType() != FiniteElement::TNEQ && pcs_vector[0]->getProcessType() != FiniteElement::TES) { - Display::DisplayMsgLn( + DisplayMsgLn( "Mass transport components and Mass transport processes do not " "fit!"); exit(1); @@ -211,7 +213,7 @@ bool CPRead(std::string file_base_name) (pcs_vector[0]->getProcessType() == FiniteElement::TNEQ || pcs_vector[0]->getProcessType() == FiniteElement::TES)) { - Display::DisplayMsgLn( + DisplayMsgLn( "ERROR. TNEQ/TES requires specification of inert and reactive " "components in mcp file."); exit(1); @@ -451,7 +453,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // unknown parameter model if (count_of_diffusion_model_values < 0) { - Display::DisplayMsgLn(" Unknown Diffusion model - program stops !"); + DisplayMsgLn(" Unknown Diffusion model - program stops !"); exit(1); } @@ -490,7 +492,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // diffusion_model_values = read_help; if (diffusion_model < 0) - Display::DisplayMsgLn( + DisplayMsgLn( "Error: Diffusion model must be larger than or 0"); } in.clear(); @@ -510,7 +512,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) if (count_of_decay_model_values < 0) // unknown parameter model { - Display::DisplayMsgLn( + DisplayMsgLn( " Unknown Aqueous Decay model - program stops !"); exit(1); } @@ -538,7 +540,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // decay_model_values = read_help; if (decay_model < -1) - Display::DisplayMsgLn( + DisplayMsgLn( "Error: Aqueous decay model must be larger than or 0"); } in.clear(); @@ -558,7 +560,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) if (count_of_isotherm_model_values < 0) // unknown parameter model { - Display::DisplayMsgLn(" Unknown Isotherm model - program stops !"); + DisplayMsgLn(" Unknown Isotherm model - program stops !"); exit(1); } @@ -584,7 +586,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) // isotherm_model_values = read_help; if (isotherm_model < 0) - Display::DisplayMsgLn( + DisplayMsgLn( "Error: Isotherm model must be larger than or 0"); } in.clear(); @@ -612,7 +614,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (molar_density <= 0) // unphysical entry { - Display::DisplayMsgLn( + DisplayMsgLn( "Error in MOLAR_DENSITY - setting molar_density to 1.0!"); molar_density = 1.0; } @@ -625,7 +627,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (molar_weight <= 0) // unphysical entry { - Display::DisplayMsgLn( + DisplayMsgLn( "Error in MOLAR_WEIGHT - setting molar_weight to 1.0!"); molar_weight = 1.0; } @@ -639,7 +641,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (max_solubility <= 0) // unphysical entry { - Display::DisplayMsgLn( + DisplayMsgLn( ": Error in MAXIMUM_AQUEOUS_SOLUBILITY - setting " "max_solubility to 1.0!"); max_solubility = 1.0; @@ -663,7 +665,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (fabs(double(valence)) >= 7) { // unphysical entry - Display::DisplayMsgLn("Error in VALENCE - setting valence to 0!"); + DisplayMsgLn("Error in VALENCE - setting valence to 0!"); valence = 0; } } @@ -674,7 +676,7 @@ ios::pos_type CompProperties::Read(ifstream* rfd_file) in.clear(); if (a_zero >= 10) { // unphysical entry - // Display::DisplayMsgLn("Error in A_ZERO - setting valence to 0!"); + // DisplayMsgLn("Error in A_ZERO - setting valence to 0!"); // a_zero = 0.0; } } @@ -908,7 +910,7 @@ double CompProperties::CalcDiffusionCoefficientCP(long index, return 0.0; // no diffusion specified case 0: /* curve value */ { - // Display::DisplayMsgLn("Not implemented"); + // DisplayMsgLn("Not implemented"); return 0.0; } case 1: /* Konstanter Diffusionswert */ @@ -1155,7 +1157,7 @@ double CompProperties::CalcDiffusionCoefficientCP(long index, else { Dm = 0; - Display::DisplayMsgLn("Something wrong in diffusion model 10! T = 0."); + DisplayMsgLn("Something wrong in diffusion model 10! T = 0."); } // A = -1.4943; //Daq(T) PCE // B = -1059.0; //Daq(T) PCE @@ -1163,7 +1165,7 @@ double CompProperties::CalcDiffusionCoefficientCP(long index, } default: - Display::DisplayMsgLn("Unknown diffusion model!"); + DisplayMsgLn("Unknown diffusion model!"); break; } /* switch */ @@ -1303,7 +1305,7 @@ double CompProperties::CalcDiffusionCoefficientCP_Method1(long index, 1.e-4; // WW } } - Display::DisplayMsgLn("Unknown diffusion model specified!"); + DisplayMsgLn("Unknown diffusion model specified!"); return 0.; } @@ -1423,7 +1425,7 @@ int CompProperties::GetNumberDecayValuesCompProperties(int decay_model) break; /* Monod or Michaelis-Menten kinetics with constant rate coefficients */ default: - Display::DisplayMsgLn(" Error: Unknown model for decay "); + DisplayMsgLn(" Error: Unknown model for decay "); break; } /* switch */ @@ -1501,7 +1503,7 @@ int CompProperties::GetNumberIsothermValuesCompProperties(int isotherm) n=1; break; */ default: - Display::DisplayMsgLn(" Error - this ISOTHERM model found "); + DisplayMsgLn(" Error - this ISOTHERM model found "); break; } /* switch */ @@ -1556,7 +1558,7 @@ double CompProperties::CalcElementRetardationFactorNew(long index, /* Get mean element concentration from last time step */ conc = CalcElementMeanConcNew(index, m_pcs); - /* Display::DisplayMsg(" Mean conc: "); Display::DisplayDouble(conc,0,0); Display::DisplayMsgLn(" "); + /* DisplayMsg(" Mean conc: "); DisplayDouble(conc,0,0); DisplayMsgLn(" "); */ switch (isotherm_model) @@ -1614,20 +1616,20 @@ double CompProperties::CalcElementRetardationFactorNew(long index, // isotherm = GetCurveDerivative((int) isotherm_model_values[0], 0, // fabs(conc), &gueltig); break; default: - Display::DisplayMsgLn( + DisplayMsgLn( "Unknown sorption isotherm type. Assuming no sorption"); isotherm = 0.0; // CMCD moved here retard = 1. + (1. - porosity) * density_rock * isotherm / porosity; break; } - // Display::DisplayMsg(" conc: "); Display::DisplayDouble(conc,0,0);Display::DisplayMsg(" isotherm: "); - // Display::DisplayDouble(isotherm,0,0); Display::DisplayMsgLn(" "); if(conc < 0.0) isotherm = + // DisplayMsg(" conc: "); DisplayDouble(conc,0,0);DisplayMsg(" isotherm: "); + // DisplayDouble(isotherm,0,0); DisplayMsgLn(" "); if(conc < 0.0) isotherm = // 0.0; // retard = 1. + (1.-porosity)*density_rock*isotherm/porosity; Case 4 - // doesn't use this function. if(index < 1) {Display::DisplayMsg(" Retardation - // factor: "); Display::DisplayDouble(retard,0,0); Display::DisplayMsgLn(" ");} + // doesn't use this function. if(index < 1) {DisplayMsg(" Retardation + // factor: "); DisplayDouble(retard,0,0); DisplayMsgLn(" ");} return retard; } @@ -1699,9 +1701,9 @@ double CompProperties::CalcElementMeanConcNew(long index, CRFProcess* m_pcs) val2 /= (double)nn; /* calculate mean value */ - // Display::DisplayMsgLn(" "); Display::DisplayMsg(" val1: "); - // Display::DisplayDouble(val1,0,0);Display::DisplayMsg(", val2: "); - // Display::DisplayDouble(val2,0,0); Display::DisplayMsgLn(""); + // DisplayMsgLn(" "); DisplayMsg(" val1: "); + // DisplayDouble(val1,0,0);DisplayMsg(", val2: "); + // DisplayDouble(val2,0,0); DisplayMsgLn(""); val = theta * val1 + (1.0 - theta) * val2; return val; @@ -1730,7 +1732,7 @@ double CompProperties::CalcElementDecayRateNew(long index, CRFProcess* m_pcs) static double conc, lambda = 0.0; int gueltig; - // if(index >= anz_active_elements){Display::DisplayMsgLn(" Too many elements "); + // if(index >= anz_active_elements){DisplayMsgLn(" Too many elements "); // return 0.0; } /* Get mean element concentration from last time step */ conc = CalcElementMeanConcNew(index, m_pcs); @@ -1777,8 +1779,8 @@ double CompProperties::CalcElementDecayRateNew(long index, CRFProcess* m_pcs) lambda = 0.0; break; } - // if(index < 0){Display::DisplayMsg(" Decay Rate lambda: "); - // Display::DisplayDouble(lambda,0,0); Display::DisplayMsgLn(" ");} + // if(index < 0){DisplayMsg(" Decay Rate lambda: "); + // DisplayDouble(lambda,0,0); DisplayMsgLn(" ");} return lambda; } @@ -1792,12 +1794,12 @@ int CPGetMobil(long comp) cp_single = cp_vec[comp]; if (cp_single == NULL) { - Display::DisplayMsgLn("The requested component properties are not defined!"); + DisplayMsgLn("The requested component properties are not defined!"); return 0; } mobil = cp_single->mobil; if (mobil < 0) - Display::DisplayMsgLn("Error getting component property"); + DisplayMsgLn("Error getting component property"); return mobil; } diff --git a/FEM/solver.cpp b/FEM/solver.cpp index 966d6840f..30b95957f 100644 --- a/FEM/solver.cpp +++ b/FEM/solver.cpp @@ -56,6 +56,9 @@ using namespace std; #ifdef UMFPACK #include #endif + +using namespace Display; + /**** Definitionen fuer Preconditioner (Ra, 3/2000) */ #define VK_Skalierung 1 #define VK_Extraktion 10 @@ -285,7 +288,7 @@ int SpRichardson(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES1 - Display::DisplayMsgLn("SpRichard"); + DisplayMsgLn("SpRichard"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -356,11 +359,11 @@ int SpRichardson(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif } @@ -418,7 +421,7 @@ int SpJOR(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES1 - Display::DisplayMsgLn("SpJacobi"); + DisplayMsgLn("SpJacobi"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -478,8 +481,8 @@ int SpJOR(double* b, double* x, long n) { /* Eventuell Zeilenvertauschen */ #ifdef TESTLOES1 - Display::DisplayMsg("Fehler im Jacobi-Loser: Diagonalelement = 0.0 !!"); - Display::DisplayMsgLn(""); + DisplayMsg("Fehler im Jacobi-Loser: Diagonalelement = 0.0 !!"); + DisplayMsgLn(""); #endif k = -1; break; @@ -510,11 +513,11 @@ int SpJOR(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif } @@ -576,7 +579,7 @@ int SpSOR(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES1 - Display::DisplayMsgLn("SpGaussSeidel"); + DisplayMsgLn("SpGaussSeidel"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -641,9 +644,9 @@ int SpSOR(double* b, double* x, long n) { /* Eventuell Zeilenvertauschen */ #ifdef TESTLOES1 - Display::DisplayMsg( + DisplayMsg( "Fehler im Gauss-Seidel-Loeser: Diagonalelement = 0.0 !!"); - Display::DisplayMsgLn(""); + DisplayMsgLn(""); #endif k = -1; break; @@ -670,11 +673,11 @@ int SpSOR(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif } @@ -1006,8 +1009,8 @@ int SpAMG1R5(double* b, double* x, long n) n = n; *x = *x; *b = *b; - Display::DisplayMsg("!!!! Error: AMG1R5-Solver not included in this version!"); - Display::DisplayMsgLn(" "); + DisplayMsg("!!!! Error: AMG1R5-Solver not included in this version!"); + DisplayMsgLn(" "); exit(1); #endif } @@ -1096,9 +1099,9 @@ int SpUMF(double* b, double* x, long n) } /* Fehler ausgeben */ - Display::DisplayMsg(" Relativer UMF-Anfangsfehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); - Display::DisplayMsgLn(""); + DisplayMsg(" Relativer UMF-Anfangsfehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); + DisplayMsgLn(""); if (VEKNORM_BICGSTAB(r, n) <= EPS) { @@ -1158,10 +1161,10 @@ int SpUMF(double* b, double* x, long n) #ifdef UMFPACK31 umfpack_i_symbolic(n, Ap, Ai, &Symbolic, Control, Info); if (Symbolic == NULL) - Display::DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); + DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); umfpack_i_numeric(Ap, Ai, Ax, Symbolic, &Numeric, Control, Info); if (Numeric == NULL) - Display::DisplayMsgLn("UMFPACK: Numeric ist NULL!"); + DisplayMsgLn("UMFPACK: Numeric ist NULL!"); status = umfpack_i_solve("Ax=b", Ap, Ai, Ax, x, b, Numeric, Control, Info); umfpack_i_report_info(Control, Info); umfpack_i_report_status(Control, status); @@ -1179,25 +1182,25 @@ int SpUMF(double* b, double* x, long n) } if (status != UMFPACK_OK) { - Display::DisplayMsgLn("UMFPACK wird abgebrochen!"); - Display::DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); + DisplayMsgLn("UMFPACK wird abgebrochen!"); + DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); MXDumpGLS("ERROR.GLS", 1, b, NULL); exit(1); } if (Symbolic == NULL) - Display::DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); + DisplayMsgLn("UMFPACK: Symbolic ist NULL!"); status = umfpack_di_numeric(Ap, Ai, Ax, Symbolic, &Numeric, Control, Info); umfpack_di_report_status(Control, status); if (status != UMFPACK_OK) { - Display::DisplayMsgLn("UMFPACK wird abgebrochen!"); - Display::DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); + DisplayMsgLn("UMFPACK wird abgebrochen!"); + DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); MXDumpGLS("ERROR.GLS", 1, b, NULL); exit(1); } if (Numeric == NULL) - Display::DisplayMsgLn("UMFPACK: Numeric ist NULL!"); + DisplayMsgLn("UMFPACK: Numeric ist NULL!"); status = umfpack_di_solve(UMFPACK_A, Ap, Ai, Ax, x, b, Numeric, Control, Info); @@ -1205,8 +1208,8 @@ int SpUMF(double* b, double* x, long n) umfpack_di_report_status(Control, status); if (status != UMFPACK_OK) { - Display::DisplayMsgLn("UMFPACK wird abgebrochen!"); - Display::DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); + DisplayMsgLn("UMFPACK wird abgebrochen!"); + DisplayMsgLn("GLS wird in ERROR.GLS gespeichert."); MXDumpGLS("ERROR.GLS", 1, b, NULL); exit(1); } @@ -1222,9 +1225,9 @@ int SpUMF(double* b, double* x, long n) #endif MXResiduum(x, b, r); - Display::DisplayMsg(" Relativer UMF-Endfehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); - Display::DisplayMsgLn(""); + DisplayMsg(" Relativer UMF-Endfehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / EPS, 8, 3); + DisplayMsgLn(""); /* Ggf. abschliessen der Vorkonditionierung */ if (vorkond) @@ -1242,8 +1245,8 @@ int SpUMF(double* b, double* x, long n) n = n; *x = *x; *b = *b; - Display::DisplayMsg("!!!! Error: UMF-Solver not included in this version!"); - Display::DisplayMsgLn(" "); + DisplayMsg("!!!! Error: UMF-Solver not included in this version!"); + DisplayMsgLn(" "); exit(1); #endif } @@ -1298,7 +1301,7 @@ int SpBICG(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - Display::DisplayMsgLn("SpBICG"); + DisplayMsgLn("SpBICG"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -1338,9 +1341,9 @@ int SpBICG(double* b, double* x, long n) } #ifdef TESTLOES4 - Display::DisplayMsg("eps = "); - Display::DisplayDouble(eps, 22, 20); - Display::DisplayMsgLn(""); + DisplayMsg("eps = "); + DisplayDouble(eps, 22, 20); + DisplayMsgLn(""); #endif if (VEKNORM_BICG(r, n) <= eps) @@ -1415,11 +1418,11 @@ int SpBICG(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif @@ -1519,7 +1522,7 @@ int SpBICGSTAB(double* b, double* x, long n) alpha = omega = rho1 = rho = 1.0; #ifdef TESTLOES4 - Display::DisplayMsgLn("SpBICGSTAB"); + DisplayMsgLn("SpBICGSTAB"); #endif MXResiduum(x, b, r); @@ -1560,9 +1563,9 @@ int SpBICGSTAB(double* b, double* x, long n) // WW cout << "\n SpBICGSTAB iteration: 0/" << max_iter << " Error: " << // error_rel << "\n"; #ifdef TESTLOES4 - Display::DisplayMsg("eps = "); - Display::DisplayDouble(eps, 22, 20); - Display::DisplayMsgLn(""); + DisplayMsg("eps = "); + DisplayDouble(eps, 22, 20); + DisplayMsgLn(""); #endif /* Fehlerkriterium oder max_iter erreicht? */ if ((k >= max_iter) || (VEKNORM_BICGSTAB(r, n) <= eps)) @@ -1676,11 +1679,11 @@ int SpBICGSTAB(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((max_iter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r2, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r2, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif @@ -1766,7 +1769,7 @@ int SpQMRCGSTAB(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - Display::DisplayMsgLn("SpQMRCGSTAB"); + DisplayMsgLn("SpQMRCGSTAB"); #endif r = (double*)Malloc(n * sizeof(double)); /* MNulleVec(r,n); */ @@ -1800,9 +1803,9 @@ int SpQMRCGSTAB(double* b, double* x, long n) } #ifdef TESTLOES4 - Display::DisplayMsg("eps = "); - Display::DisplayDouble(eps, 22, 20); - Display::DisplayMsgLn(""); + DisplayMsg("eps = "); + DisplayDouble(eps, 22, 20); + DisplayMsgLn(""); #endif if (VEKNORM_QMRCGSTAB(r, n) <= eps) @@ -1891,11 +1894,11 @@ int SpQMRCGSTAB(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif rho1 = rho; @@ -2071,8 +2074,8 @@ int SpMGMRES(double* b, double* x, long n) n = n; *x = *x; *b = *b; - Display::DisplayMsg("!!!! Error: GMRES-Solver not yet finished!"); - Display::DisplayMsgLn(" "); + DisplayMsg("!!!! Error: GMRES-Solver not yet finished!"); + DisplayMsgLn(" "); exit(1); #endif } @@ -2151,7 +2154,7 @@ int SpCG(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - Display::DisplayMsgLn("SpCG"); + DisplayMsgLn("SpCG"); #endif r = (double*)Malloc(n * sizeof(double)); @@ -2187,9 +2190,9 @@ int SpCG(double* b, double* x, long n) s = (double*)Free(s); #ifdef TESTLOES4 - Display::DisplayMsg("eps = "); - Display::DisplayDouble(eps, 22, 20); - Display::DisplayMsgLn(""); + DisplayMsg("eps = "); + DisplayDouble(eps, 22, 20); + DisplayMsgLn(""); #endif if (VEKNORM_CG(r, n) <= eps) @@ -2238,11 +2241,11 @@ int SpCG(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif @@ -2313,7 +2316,7 @@ int SpCGNR(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - Display::DisplayMsgLn("SpCGNE"); + DisplayMsgLn("SpCGNE"); #endif r = (double*)Malloc(n * sizeof(double)); @@ -2404,11 +2407,11 @@ int SpCGNR(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_BICGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif @@ -2486,7 +2489,7 @@ int SpCGS(double* b, double* x, long n) // OK411 max_iter = NodeListLength; #ifdef TESTLOES4 - Display::DisplayMsgLn("SpCGS"); + DisplayMsgLn("SpCGS"); #endif r = (double*)Malloc(n * sizeof(double)); @@ -2583,11 +2586,11 @@ int SpCGS(double* b, double* x, long n) #ifdef SOLVER_SHOW_ERROR if (k % (int)MMax((cg_maxiter / 10), 1.) == 1) { - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Fehler = "); - Display::DisplayDouble(VEKNORM_QMRCGSTAB(r, n) / eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Fehler = "); + DisplayDouble(VEKNORM_QMRCGSTAB(r, n) / eps, 4, 1); + DisplayMsgLn(" "); } #endif @@ -2659,7 +2662,7 @@ int SpGauss(double* vecb, double* vecx, long g) static double z, hilf; register int k, i, j, sk; #ifdef TESTLOES - Display::DisplayMsgLn("SpGAUSS"); + DisplayMsgLn("SpGAUSS"); #endif s = (int*)Malloc(sizeof(int) * (g - 1)); /* LR-Faktorisierung */ @@ -2844,7 +2847,7 @@ int NonLinearSolve(long cas, double* b, double* x, long n, strcpy(text, "SpNEWTON"); break; } - Display::DisplayMsgLn(text); + DisplayMsgLn(text); #endif } else if (cas == 2) @@ -2902,14 +2905,14 @@ int NonLinearSolve(long cas, double* b, double* x, long n, strcpy(text, "SpNEWTON"); break; } - Display::DisplayMsgLn(text); + DisplayMsgLn(text); #endif } iter = NonlinearSolver(b, x, n, f, ind); if (iter == nonlinear_maxiter) { - Display::DisplayErrorMsg("Abbruch! Maximale Anzahl an Iterationen erreicht."); + DisplayErrorMsg("Abbruch! Maximale Anzahl an Iterationen erreicht."); return 0; } return iter; @@ -2970,7 +2973,7 @@ int SpPICARD(double* b, double* x, long n, #define GERMAN #ifdef TESTLOES6 - Display::DisplayMsgLn("SpPICARD"); + DisplayMsgLn("SpPICARD"); #endif cg_eps_original = cg_eps; @@ -3019,7 +3022,7 @@ int SpPICARD(double* b, double* x, long n, if ((rebuild_matrix) || (!(k % nonlinear_assemble_flow))) { #ifdef TESTLOES6 - Display::DisplayMsgLn("Neuaufbau der Systemmatrix"); + DisplayMsgLn("Neuaufbau der Systemmatrix"); #endif f(b, x, aktuelle_zeit); rebuild_matrix = 0; @@ -3054,22 +3057,22 @@ int SpPICARD(double* b, double* x, long n, } #ifdef GERMAN - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", GLS-Iter. = "); - Display::DisplayLong((long)iter); - Display::DisplayMsg(", Fehler/Abbruchf. = "); - Display::DisplayDouble(error / nonlinear_eps, 4, 1); - Display::DisplayMsgLn(" "); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", GLS-Iter. = "); + DisplayLong((long)iter); + DisplayMsg(", Fehler/Abbruchf. = "); + DisplayDouble(error / nonlinear_eps, 4, 1); + DisplayMsgLn(" "); #endif #ifdef ENGLISH - Display::DisplayMsg(" Iteration-Nr.: "); - Display::DisplayLong((long)k); - Display::DisplayMsg(", Linear solver iterations = "); - Display::DisplayLong((long)iter); - Display::DisplayMsg(", error/errorcrit. = "); - Display::DisplayDouble(error / nonlinear_eps, 4, 1); - Display::DisplayMsgLn(""); + DisplayMsg(" Iteration-Nr.: "); + DisplayLong((long)k); + DisplayMsg(", Linear solver iterations = "); + DisplayLong((long)iter); + DisplayMsg(", error/errorcrit. = "); + DisplayDouble(error / nonlinear_eps, 4, 1); + DisplayMsgLn(""); #endif if (nonlinear_rel_cg_eps > 0) @@ -3170,7 +3173,7 @@ int SpNEWTON(double*, double*, long, void (*)(double*, double*, double), long) // WW long ldummy; // WW void (*g) (double *b, double *x, double dummy); - Display::DisplayMsgLn("Newton noch nicht implementiert !!! "); + DisplayMsgLn("Newton noch nicht implementiert !!! "); // WW ddummy = b[0]; // WW ddummy = x[0]; @@ -3189,7 +3192,7 @@ int SpNEWTON(double*, double*, long, void (*)(double*, double*, double), long) static double error; #ifdef TESTLOES6 - Display::DisplayMsgLn("SpNEWTON"); + DisplayMsgLn("SpNEWTON"); #endif k = 0; @@ -3205,9 +3208,9 @@ int SpNEWTON(double*, double*, long, void (*)(double*, double*, double), long) #endif #ifdef TESTLOES6 - Display::DisplayMsg("eps = "); - Display::DisplayDouble(eps, 22, 20); - Display::DisplayMsgLn(""); + DisplayMsg("eps = "); + DisplayDouble(eps, 22, 20); + DisplayMsgLn(""); #endif MXResiduum(x, b, r); diff --git a/FEM/tools.cpp b/FEM/tools.cpp index 72e5e5b4e..a61746880 100644 --- a/FEM/tools.cpp +++ b/FEM/tools.cpp @@ -48,6 +48,7 @@ #include "msh_elem.h" #include "msh_lib.h" using namespace std; +using namespace Display; Kurven* kurven = NULL; int anz_kurven = 0; @@ -123,10 +124,10 @@ double GetCurveValue(int kurve, int methode, double punkt, int* gueltig) #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - Display::DisplayMsgLn(""); - Display::DisplayMsg("PANIC! Curve "); - Display::DisplayLong(kurve); - Display::DisplayMsgLn(" is requested but not defined!"); + DisplayMsgLn(""); + DisplayMsg("PANIC! Curve "); + DisplayLong(kurve); + DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -155,7 +156,7 @@ double GetCurveValue(int kurve, int methode, double punkt, int* gueltig) switch (methode) { default: - Display::ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); + ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); return 0.0; // case 0: // Linear Interpolation @@ -203,10 +204,10 @@ double GetCurveValueInverse(int kurve, int methode, double wert, int* gueltig) #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - Display::DisplayMsgLn(""); - Display::DisplayMsg("PANIC! Curve "); - Display::DisplayLong(kurve); - Display::DisplayMsgLn(" is requested but not defined!"); + DisplayMsgLn(""); + DisplayMsg("PANIC! Curve "); + DisplayLong(kurve); + DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -256,7 +257,7 @@ double GetCurveValueInverse(int kurve, int methode, double wert, int* gueltig) switch (methode) { default: - Display::ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); + ScreenMessage("ERROR: GetCurveValue() --> Invalid curve.\n"); return 0.0; // case 0: // Lineare Interpolation @@ -311,10 +312,10 @@ double GetCurveDerivative(int kurve, int methode, double punkt, int* gueltig) #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - Display::DisplayMsgLn(""); - Display::DisplayMsg("PANIC! Curve "); - Display::DisplayLong(kurve); - Display::DisplayMsgLn(" is requested but not defined!"); + DisplayMsgLn(""); + DisplayMsg("PANIC! Curve "); + DisplayLong(kurve); + DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -423,10 +424,10 @@ double GetCurveInverseDerivative(int kurve, #ifdef ERROR_CONTROL if ((kurve < 0) || (kurve >= anz_kurven)) { - Display::DisplayMsgLn(""); - Display::DisplayMsg("PANIC! Curve "); - Display::DisplayLong(kurve); - Display::DisplayMsgLn(" is requested but not defined!"); + DisplayMsgLn(""); + DisplayMsg("PANIC! Curve "); + DisplayLong(kurve); + DisplayMsgLn(" is requested but not defined!"); abort(); } #endif @@ -553,7 +554,7 @@ int FctCurves(char* data, int found, FILE* f) int i; #ifdef TESTFILES - Display::DisplayMsgLn("Eingabedatenbank, Schluesselwort CURVES"); + DisplayMsgLn("Eingabedatenbank, Schluesselwort CURVES"); #endif LineFeed(f); @@ -717,14 +718,14 @@ int FctCurves(char* data, int found, FILE* f) // long NumberOfElementsPerLayer = -1; // MeshLib::CElem* m_ele = NULL; // //------------------------------------------------------------------------ -// Display::DisplayMsgLn("Input file Heterogeneous Fields "); +// DisplayMsgLn("Input file Heterogeneous Fields "); // //------------------------------------------------------------------------ // // File handling // ein.open(name_file); // if(!ein) // { -// //Display::DisplayMsgLn(" ERROR opening file with heterogeneous fields!"); -// //Display::DisplayMsgLn(" File does not exist."); +// //DisplayMsgLn(" ERROR opening file with heterogeneous fields!"); +// //DisplayMsgLn(" File does not exist."); // cout << " FctReadHeterogeneousFields" << "\n"; // cout << " Cannot find " << name_file << "\n"; // exit(1); @@ -837,7 +838,7 @@ int FctCurves(char* data, int found, FILE* f) // } // //Warning // if(no_values < NumberOfElementsPerLayer) -// Display::DisplayMsgLn( +// DisplayMsgLn( // "Warning! Fewer element values in File for heterogeneous // permeability field than elements in element // list"); @@ -904,20 +905,20 @@ int FctCurves(char* data, int found, FILE* f) // { // ihet = GetNearestHetVal(i, m_msh, no_values, invals); // if(ihet < 0) -// Display::DisplayMsgLn(" Error getting nearest het_value location"); +// DisplayMsgLn(" Error getting nearest het_value location"); // else // for(j = 0; j < nof; j++) // values[j] = invals[ihet][j + 3]; -// //Display::DisplayMsg(" Het Val for element: "); Display::DisplayLong(i); -// Display::DisplayMsg(" with coordinates "); -// //Display::DisplayDouble(x,0,0); Display::DisplayMsg(", "); Display::DisplayDouble(y,0,0); -// Display::DisplayMsg(", "); Display::DisplayDouble(z,0,0); -// Display::DisplayMsg(" found at: "); -// //Display::DisplayDouble(invals[ihet][0],0,0); Display::DisplayMsg(", "); -// Display::DisplayDouble(invals[ihet][1],0,0); -// Display::DisplayMsg(", +// //DisplayMsg(" Het Val for element: "); DisplayLong(i); +// DisplayMsg(" with coordinates "); +// //DisplayDouble(x,0,0); DisplayMsg(", "); DisplayDouble(y,0,0); +// DisplayMsg(", "); DisplayDouble(z,0,0); +// DisplayMsg(" found at: "); +// //DisplayDouble(invals[ihet][0],0,0); DisplayMsg(", "); +// DisplayDouble(invals[ihet][1],0,0); +// DisplayMsg(", //"); -// Display::DisplayDouble(invals[ihet][2],0,0); Display::DisplayMsgLn(". "); +// DisplayDouble(invals[ihet][2],0,0); DisplayMsgLn(". "); // } // //..................................................................... // //Get all values in Element and calculate the geometric mean @@ -925,11 +926,11 @@ int FctCurves(char* data, int found, FILE* f) // { // values[0] = GetAverageHetVal(i, m_msh, no_values, invals); // -// Display::DisplayMsgLn(" AverageHetVal "); -// Display::DisplayMsg(" Element "); -// Display::DisplayDouble(i,0,0); -// Display::DisplayMsg(" Value: "); -// Display::DisplayDouble(values[0],0,0); +// DisplayMsgLn(" AverageHetVal "); +// DisplayMsg(" Element "); +// DisplayDouble(i,0,0); +// DisplayMsg(" Value: "); +// DisplayDouble(values[0],0,0); // } // // save values // m_ele = m_msh->ele_vector[i]; @@ -1068,7 +1069,7 @@ double GetAverageHetVal(long EleIndex, { ihet = GetNearestHetVal(EleIndex, m_msh, no_values, invals); if (ihet < 0) - Display::DisplayMsgLn(" Error getting nearest het_value location"); + DisplayMsgLn(" Error getting nearest het_value location"); else average = invals[ihet][j + 3]; } @@ -1286,7 +1287,7 @@ double GetHetValue(int ele_no, char* inname) return value; } } - Display::DisplayMsgLn(" Error - No het. Field Value found"); + DisplayMsgLn(" Error - No het. Field Value found"); return -1.0; } diff --git a/FileIO/OGSIOVer4.cpp b/FileIO/OGSIOVer4.cpp index 7addc15bc..e4855a801 100644 --- a/FileIO/OGSIOVer4.cpp +++ b/FileIO/OGSIOVer4.cpp @@ -39,6 +39,7 @@ #include "EarClippingTriangulation.h" using namespace GEOLIB; +using namespace Display; namespace FileIO { @@ -655,7 +656,7 @@ std::string readSurfaces(std::istream& in, std::vector& sfc_vec, bool readGLIFileV4(const std::string& fname, GEOObjects* geo, std::string& unique_name, std::vector& errors) { - Display::ScreenMessage( + ScreenMessage( "GEOLIB::readGLIFile open stream from file %s ...", fname.data()); std::ifstream in(fname.c_str()); @@ -666,7 +667,7 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, return false; } - Display::ScreenMessage("done\n"); + ScreenMessage("done\n"); std::string tag; while (tag.find("#POINTS") == std::string::npos && !in.eof()) @@ -677,9 +678,9 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, new std::map); bool zero_based_idx(true); std::vector* pnt_vec(new std::vector); - Display::ScreenMessage("read points from stream ... \n"); + ScreenMessage("read points from stream ... \n"); tag = readPoints(in, pnt_vec, zero_based_idx, pnt_id_names_map); - Display::ScreenMessage(" ok, %d points read\n", pnt_vec->size()); + ScreenMessage(" ok, %d points read\n", pnt_vec->size()); unique_name = BaseLib::getFileNameFromPath(fname, true); if (!pnt_vec->empty()) @@ -696,11 +697,11 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, std::vector* ply_vec(new std::vector); if (tag.find("#POLYLINE") != std::string::npos && in) { - Display::ScreenMessage("read polylines from stream ... \n"); + ScreenMessage("read polylines from stream ... \n"); tag = readPolylines(in, ply_vec, *ply_names, *pnt_vec, zero_based_idx, geo->getPointVecObj(unique_name)->getIDMap(), path, errors); - Display::ScreenMessage(" ok, %d polylines read.\n", ply_vec->size()); + ScreenMessage(" ok, %d polylines read.\n", ply_vec->size()); } else std::cerr @@ -711,10 +712,10 @@ bool readGLIFileV4(const std::string& fname, GEOObjects* geo, std::map* sfc_names(new std::map); if (tag.find("#SURFACE") != std::string::npos && in) { - Display::ScreenMessage("read surfaces from stream ... \n"); + ScreenMessage("read surfaces from stream ... \n"); tag = readSurfaces(in, *sfc_vec, *sfc_names, *ply_vec, *ply_names, *pnt_vec, path, errors); - Display::ScreenMessage(" ok, %d surfaces read.\n", sfc_vec->size()); + ScreenMessage(" ok, %d surfaces read.\n", sfc_vec->size()); } else std::cerr