Skip to content
Snippets Groups Projects
Commit e5863a89 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix

parent 658611b2
Branches
Tags
No related merge requests found
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
#include <string> #include <string>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <fstream>
#include "GmshConfig.h" #include "GmshConfig.h"
#include "GmshDefines.h" #include "GmshDefines.h"
#include "GmshVersion.h" #include "GmshVersion.h"
...@@ -17,8 +18,6 @@ ...@@ -17,8 +18,6 @@
#include "GModel.h" #include "GModel.h"
#include "CreateFile.h" #include "CreateFile.h"
#include "OS.h" #include "OS.h"
#include <fstream>
#include <periodical.h>
#if defined(HAVE_FLTK) #if defined(HAVE_FLTK)
#include <FL/Fl.H> #include <FL/Fl.H>
...@@ -33,6 +32,10 @@ ...@@ -33,6 +32,10 @@
#include "PView.h" #include "PView.h"
#endif #endif
#if defined(HAVE_MESH)
#include "periodical.h"
#endif
int GetGmshMajorVersion(){ return GMSH_MAJOR_VERSION; } int GetGmshMajorVersion(){ return GMSH_MAJOR_VERSION; }
int GetGmshMinorVersion(){ return GMSH_MINOR_VERSION; } int GetGmshMinorVersion(){ return GMSH_MINOR_VERSION; }
int GetGmshPatchVersion(){ return GMSH_PATCH_VERSION; } int GetGmshPatchVersion(){ return GMSH_PATCH_VERSION; }
...@@ -472,36 +475,32 @@ void GetOptions(int argc, char *argv[]) ...@@ -472,36 +475,32 @@ void GetOptions(int argc, char *argv[])
else else
Msg::Fatal("Missing number of lloyd iterations"); Msg::Fatal("Missing number of lloyd iterations");
} }
#if defined(HAVE_MESH)
else if(!strcmp(argv[i] + 1, "microstructure")) { else if(!strcmp(argv[i] + 1, "microstructure")) {
i++; i++;
int j; int j;
double number; double number;
double temp; double temp;
std::vector<double> coordinates; std::vector<double> coordinates;
if(argv[i]){ if(argv[i]){
std::ifstream file(argv[i++]); std::ifstream file(argv[i++]);
file >> number; file >> number;
coordinates.clear(); coordinates.clear();
coordinates.resize(3*number); coordinates.resize(3*number);
for(j = 0; j <number; j++){ for(j = 0; j <number; j++){
file >> coordinates[3*j]; file >> coordinates[3*j];
file >> coordinates[3*j+1]; file >> coordinates[3*j+1];
file >> coordinates[3*j+2]; file >> coordinates[3*j+2];
file >> temp; file >> temp;
} }
voroMetal3D vm1; voroMetal3D vm1;
vm1.execute(coordinates,0.1); vm1.execute(coordinates,0.1);
GModel::current()->load("MicrostructurePolycrystal3D.geo"); GModel::current()->load("MicrostructurePolycrystal3D.geo");
voroMetal3D vm2; voroMetal3D vm2;
vm2.correspondance(0.00001); vm2.correspondance(0.00001);
} }
} }
#endif
else if(!strcmp(argv[i] + 1, "nopopup")) { else if(!strcmp(argv[i] + 1, "nopopup")) {
CTX::instance()->noPopup = 1; CTX::instance()->noPopup = 1;
i++; i++;
......
...@@ -544,13 +544,13 @@ void Msg::PrintErrorCounter(const char *title) ...@@ -544,13 +544,13 @@ void Msg::PrintErrorCounter(const char *title)
#if defined(HAVE_FLTK) #if defined(HAVE_FLTK)
if(FlGui::available()){ if(FlGui::available()){
std::string red("@C1@."); std::string col = _errorCount ? "@C1@." : "@C5@.";
FlGui::instance()->addMessage((red + prefix + line).c_str()); FlGui::instance()->addMessage((col + prefix + line).c_str());
FlGui::instance()->addMessage((red + prefix + title).c_str()); FlGui::instance()->addMessage((col + prefix + title).c_str());
FlGui::instance()->addMessage((red + prefix + warn).c_str()); FlGui::instance()->addMessage((col + prefix + warn).c_str());
FlGui::instance()->addMessage((red + prefix + err).c_str()); FlGui::instance()->addMessage((col + prefix + err).c_str());
FlGui::instance()->addMessage((red + prefix + help).c_str()); FlGui::instance()->addMessage((col + prefix + help).c_str());
FlGui::instance()->addMessage((red + prefix + line).c_str()); FlGui::instance()->addMessage((col + prefix + line).c_str());
if(_errorCount) fl_beep(); if(_errorCount) fl_beep();
} }
#endif #endif
...@@ -558,7 +558,8 @@ void Msg::PrintErrorCounter(const char *title) ...@@ -558,7 +558,8 @@ void Msg::PrintErrorCounter(const char *title)
if(CTX::instance()->terminal){ if(CTX::instance()->terminal){
const char *c0 = "", *c1 = ""; const char *c0 = "", *c1 = "";
if(!streamIsFile(stderr) && streamIsVT100(stderr)){ if(!streamIsFile(stderr) && streamIsVT100(stderr)){
c0 = "\33[31m"; c1 = "\33[0m"; // red c0 = _errorCount ? "\33[1m\33[31m" : "\33[35m"; // bold red or magenta
c1 = "\33[0m";
} }
fprintf(stderr, "%s%s\n%s\n%s\n%s\n%s\n%s%s\n", c0, (prefix + line).c_str(), fprintf(stderr, "%s%s\n%s\n%s\n%s\n%s\n%s%s\n", c0, (prefix + line).c_str(),
(prefix + title).c_str(), (prefix + warn).c_str(), (prefix + title).c_str(), (prefix + warn).c_str(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment