Commit 7dc04087 by jean-sebastien cagnone

Merge remote-tracking branch 'origin/master' into oneFilePerPart

added command line interface option to: 1) write partitioned mesh to separate files. 2) Ignore periodicity information when reading a mesh.
parents 66dad3e3 4c6e34bf
Pipeline #302 passed with stage
in 8 minutes 48 seconds
3.0.4 (July 28, 2017): moved vorometal code to plugin; openmp improvements; bug
fixes.
3.0.3 (June 27, 2017): new element quality measures; Block->Box; minor fixes.
3.0.2 (May 13, 2017): improved handling of meshing constraints and entity
......
......@@ -93,7 +93,7 @@ opt(ZIPPER "Enable Zip file compression/decompression" OFF)
set(GMSH_MAJOR_VERSION 3)
set(GMSH_MINOR_VERSION 0)
set(GMSH_PATCH_VERSION 4)
set(GMSH_PATCH_VERSION 5)
set(GMSH_EXTRA_VERSION "" CACHE STRING "Gmsh extra version string")
set(GMSH_VERSION "${GMSH_MAJOR_VERSION}.${GMSH_MINOR_VERSION}")
......@@ -169,8 +169,12 @@ if(IAMCHILD)
set(GMSH_API ${GMSH_API} PARENT_SCOPE)
endif(IAMCHILD)
execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(${CMAKE_MAJOR_VERSION} GREATER 2)
string(TIMESTAMP DATE "%Y%m%d")
else(${CMAKE_MAJOR_VERSION} GREATER 2)
execute_process(COMMAND date "+%Y%m%d" OUTPUT_VARIABLE DATE
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif(${CMAKE_MAJOR_VERSION} GREATER 2)
execute_process(COMMAND hostname OUTPUT_VARIABLE HOSTNAME
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND whoami OUTPUT_VARIABLE PACKAGER
......
......@@ -18,6 +18,7 @@
extern "C"
{
/* Gmsh */
int gmshInitialize(int argc, char **argv)
{
return !GmshInitialize(argc, argv);
......@@ -40,61 +41,78 @@ extern "C"
int gmshExport(const char *fileName)
{
return 1;
}
int gmshClear()
{
return 1;
}
/* Gmsh Options */
int gmshOptionsSetNumber(const char *name, double value)
{
return 1;
}
int gmshOptionsGetNumber(const char *name, double *value)
{
return 1;
}
/* Gmsh Model */
int gmshModelCreate(const char *name)
{
return 1;
}
int gmshModelSetCurrent(const char *name)
{
return 1;
}
int gmshModelDestroy()
{
return 1;
}
int gmshModelMesh(int dim)
{
return 1;
}
int gmshModelGeoCreate()
int gmshModelAddEmbeddedVertex(int tag, int inDim, int inTag)
{
return 1;
}
/* Gmsh Model Geo Internals */
int gmshModelGeoAddPoint(int *tag, double x, double y, double z, double lc)
{
return 1;
}
int gmshModelGeoAddLine(int *tag, int startVertexTag, int endVertexTag)
{
return 1;
}
int gmshModelGeoSynchronize()
{
return 1;
}
int gmshModelOCCCreate()
{
}
/* Gmsh Model OCC Internals */
int gmshModelOCCAddPoint(int *tag, double x, double y, double z, double lc)
{
return 1;
}
int gmshModelOCCSynchronize()
{
return 1;
}
}
......@@ -17,52 +17,54 @@
#ifndef _GMSH_API_H_
#define _GMSH_API_H_
#if defined(WIN32)
#define GMSH_API __declspec(dllexport) int
#else
#define GMSH_API int
#endif
typedef struct gmshEntity{ int dim, tag; };
typedef struct gmshIntVector{ int n; int *v; };
typedef struct gmshDoubleVector{ int n; double *v; };
typedef struct gmshEntityVector{ int n; gmshEntity *v; };
// all functions return 0 on successful completion
/* all functions return 0 on successful completion */
extern "C"
{
// initialize Gmsh (argc and argv are processed like command line arguments);
// no other API function should be called before this one
int gmshInitialize(int argc, char **argv);
// finalize Gmsh; no other API function should be called after this one
int gmshFinalize();
// open a new project (same as File->Open in the interactive version)
int gmshOpen(const char *fileName);
// merge a file (same as File->Merge in the interactive version)
int gmshMerge(const char *fileName);
// export a file
int gmshExport(const char *fileName);
// clears everything (models, post-processing views)
int gmshClear();
/* Gmsh */
GMSH_API gmshInitialize(int argc, char **argv);
GMSH_API gmshFinalize();
GMSH_API gmshOpen(const char *fileName);
GMSH_API gmshMerge(const char *fileName);
GMSH_API gmshExport(const char *fileName);
GMSH_API gmshClear();
int gmshOptionsSetNumber(const char *name, double value);
int gmshOptionsGetNumber(const char *name, double *value);
/* Gmsh Options */
GMSH_API gmshOptionsSetNumber(const char *name, double value);
GMSH_API gmshOptionsGetNumber(const char *name, double *value);
int gmshModelCreate(const char *name);
int gmshModelSetCurrent(const char *name);
int gmshModelDestroy();
int gmshModelMesh(int dim);
/* Gmsh Model */
GMSH_API gmshModelCreate(const char *name);
GMSH_API gmshModelSetCurrent(const char *name);
GMSH_API gmshModelDestroy();
GMSH_API gmshModelMesh(int dim);
GMSH_API gmshModelAddEmbeddedVertex(int tag, int inDim, int inTag);
int gmshModelGeoCreate();
int gmshModelGeoAddPoint(int *tag, double x, double y, double z, double lc);
int gmshModelGeoAddLine(int *tag, int startVertexTag, int endVertexTag);
int gmshModelGeoAddPolyLine(int *tag, const gmshIntVector *vertexTags);
int gmshModelGeoExtrude(gmshEntityVector *in, double dx, double dy, double dz,
gmshEntityVector *out);
int gmshModelGeoSynchronize();
/* Gmsh Model Geo Internals */
GMSH_API gmshModelGeoAddVertex(int *tag, double x, double y, double z, double lc);
GMSH_API gmshModelGeoAddLine(int *tag, int startVertexTag, int endVertexTag);
GMSH_API gmshModelGeoAddPolyLine(int *tag, const gmshIntVector *vertexTags);
GMSH_API gmshModelGeoExtrude(const gmshEntityVector *in, double dx, double dy,
double dz, gmshEntityVector *out);
GMSH_API gmshModelGeoSynchronize();
int gmshModelOCCCreate();
int gmshModelOCCAddPoint(int *tag, double x, double y, double z, double lc);
int gmshModelOCCAddLine(int *tag, int startVertexTag, int endVertexTag);
int gmshModelOCCExtrude(const gmshEntityVector *in, double dx, double dy, double dz,
gmshEntityVector *out);
int gmshModelOCCSynchronize();
/* Gmsh Model OCC Internals */
GMSH_API gmshModelOCCAddVertex(int *tag, double x, double y, double z, double lc);
GMSH_API gmshModelOCCAddLine(int *tag, int startVertexTag, int endVertexTag);
GMSH_API gmshModelOCCExtrude(const gmshEntityVector *in, double dx, double dy,
double dz, gmshEntityVector *out);
GMSH_API gmshModelOCCSynchronize();
}
#endif
......@@ -230,9 +230,7 @@ std::map<std::string, std::string> &Msg::GetCommandLineStrings()
void Msg::SetProgressMeterStep(int step)
{
#if defined(_OPENMP)
#pragma omp critical
#endif
if(GetCommRank() || GetNumThreads() > 1) return;
_progressMeterStep = step;
}
......@@ -243,7 +241,8 @@ int Msg::GetProgressMeterStep()
void Msg::ResetProgressMeter()
{
if (!_commRank) _progressMeterCurrent = 0;
if(GetCommRank() || GetNumThreads() > 1) return;
_progressMeterCurrent = 0;
}
void Msg::SetInfoCpu(bool val)
......@@ -295,10 +294,13 @@ onelab::client *Msg::GetOnelabClient()
void Msg::Exit(int level)
{
if (GModel::current())
if(GModel::current())
delete GModel::current();
// delete the temp file
if(!_commRank) UnlinkFile(CTX::instance()->homeDir + CTX::instance()->tmpFileName);
if(!GetCommRank())
UnlinkFile(CTX::instance()->homeDir + CTX::instance()->tmpFileName);
if(_logFile){
fclose(_logFile);
_logFile = 0;
......@@ -330,7 +332,7 @@ void Msg::Exit(int level)
#if defined(HAVE_FLTK)
// if we exit cleanly (level==0) and we are in full GUI mode, save
// the persistent info to disk
if(FlGui::available() && !_commRank) {
if(FlGui::available() && !GetCommRank()) {
if(CTX::instance()->sessionSave)
PrintOptions(0, GMSH_SESSIONRC, 0, 0,
(CTX::instance()->homeDir + CTX::instance()->sessionFileName).c_str());
......@@ -479,7 +481,7 @@ void Msg::Fatal(const char *fmt, ...)
c0 = "\33[1m\33[31m"; c1 = "\33[0m"; // bold red
}
if(_commSize > 1)
fprintf(stderr, "%sFatal : [rank %3d] %s%s\n", c0, _commRank, str, c1);
fprintf(stderr, "%sFatal : [rank %3d] %s%s\n", c0, GetCommRank(), str, c1);
else
fprintf(stderr, "%sFatal : %s%s\n", c0, str, c1);
fflush(stderr);
......@@ -494,7 +496,7 @@ void Msg::Error(const char *fmt, ...)
_errorCount++;
_atLeastOneErrorInRun = 1;
if(_verbosity < 1) return;
if(GetVerbosity() < 1) return;
char str[5000];
va_list args;
......@@ -524,7 +526,7 @@ void Msg::Error(const char *fmt, ...)
c0 = "\33[1m\33[31m"; c1 = "\33[0m"; // bold red
}
if(_commSize > 1)
fprintf(stderr, "%sError : [rank %3d] %s%s\n", c0, _commRank, str, c1);
fprintf(stderr, "%sError : [rank %3d] %s%s\n", c0, GetCommRank(), str, c1);
else
fprintf(stderr, "%sError : %s%s\n", c0, str, c1);
fflush(stderr);
......@@ -535,7 +537,7 @@ void Msg::Warning(const char *fmt, ...)
{
_warningCount++;
if(_verbosity < 2) return;
if(GetVerbosity() < 2) return;
char str[5000];
va_list args;
......@@ -564,7 +566,7 @@ void Msg::Warning(const char *fmt, ...)
c0 = "\33[35m"; c1 = "\33[0m"; // magenta
}
if(_commSize > 1)
fprintf(stderr, "%sWarning : [rank %3d] %s%s\n", c0, _commRank, str, c1);
fprintf(stderr, "%sWarning : [rank %3d] %s%s\n", c0, GetCommRank(), str, c1);
else
fprintf(stderr, "%sWarning : %s%s\n", c0, str, c1);
fflush(stderr);
......@@ -573,7 +575,7 @@ void Msg::Warning(const char *fmt, ...)
void Msg::Info(const char *fmt, ...)
{
if(_verbosity < 4) return;
if(GetVerbosity() < 4) return;
char str[5000];
va_list args;
......@@ -600,7 +602,7 @@ void Msg::Info(const char *fmt, ...)
if(CTX::instance()->terminal){
if(_commSize > 1)
fprintf(stdout, "Info : [rank %3d] %s\n", _commRank, str);
fprintf(stdout, "Info : [rank %3d] %s\n", GetCommRank(), str);
else
fprintf(stdout, "Info : %s\n", str);
fflush(stdout);
......@@ -614,7 +616,7 @@ void Msg::RequestRender()
void Msg::Direct(const char *fmt, ...)
{
if(_verbosity < 3) return;
if(GetVerbosity() < 3) return;
char str[5000];
va_list args;
......@@ -641,7 +643,7 @@ void Msg::Direct(const char *fmt, ...)
c0 = "\33[34m"; c1 = "\33[0m"; // blue
}
if(_commSize > 1)
fprintf(stdout, "%s[rank %3d] %s%s\n", c0, _commRank, str, c1);
fprintf(stdout, "%s[rank %3d] %s%s\n", c0, GetCommRank(), str, c1);
else
fprintf(stdout, "%s%s%s\n", c0, str, c1);
fflush(stdout);
......@@ -650,7 +652,7 @@ void Msg::Direct(const char *fmt, ...)
void Msg::StatusBar(bool log, const char *fmt, ...)
{
if(_verbosity < 4) return;
if(GetVerbosity() < 4) return;
char str[5000];
va_list args;
......@@ -670,7 +672,7 @@ void Msg::StatusBar(bool log, const char *fmt, ...)
#if defined(HAVE_FLTK)
if(FlGui::available()){
if(log) FlGui::instance()->check();
if(!log || _verbosity > 4)
if(!log || GetVerbosity() > 4)
FlGui::instance()->setStatus(str);
if(log){
std::string tmp = std::string("Info : ") + str;
......@@ -681,7 +683,7 @@ void Msg::StatusBar(bool log, const char *fmt, ...)
if(log && CTX::instance()->terminal){
if(_commSize > 1)
fprintf(stdout, "Info : [rank %3d] %s\n", _commRank, str);
fprintf(stdout, "Info : [rank %3d] %s\n", GetCommRank(), str);
else
fprintf(stdout, "Info : %s\n", str);
fflush(stdout);
......@@ -691,7 +693,7 @@ void Msg::StatusBar(bool log, const char *fmt, ...)
void Msg::StatusGl(const char *fmt, ...)
{
#if defined(HAVE_FLTK)
if(_commRank) return;
if(GetCommRank()) return;
char str[5000];
va_list args;
va_start(args, fmt);
......@@ -713,7 +715,7 @@ void Msg::SetWindowTitle(const std::string &title)
void Msg::Debug(const char *fmt, ...)
{
if(_verbosity < 99) return;
if(GetVerbosity() < 99) return;
char str[5000];
va_list args;
......@@ -734,7 +736,7 @@ void Msg::Debug(const char *fmt, ...)
if(CTX::instance()->terminal){
if(_commSize > 1)
fprintf(stdout, "Debug : [rank %3d] %s\n", _commRank, str);
fprintf(stdout, "Debug : [rank %3d] %s\n", GetCommRank(), str);
else
fprintf(stdout, "Debug : %s\n", str);
fflush(stdout);
......@@ -743,7 +745,7 @@ void Msg::Debug(const char *fmt, ...)
void Msg::ProgressMeter(int n, int N, bool log, const char *fmt, ...)
{
if(_commRank || _verbosity < 4 ||
if(GetCommRank() || GetNumThreads() > 1 || GetVerbosity() < 4 ||
_progressMeterStep <= 0 || _progressMeterStep >= 100) return;
double percent = 100. * (double)n/(double)N;
......@@ -761,7 +763,7 @@ void Msg::ProgressMeter(int n, int N, bool log, const char *fmt, ...)
if(_client) _client->Progress(str2);
#if defined(HAVE_FLTK)
if(FlGui::available() && _verbosity > 4){
if(FlGui::available() && GetVerbosity() > 4){
FlGui::instance()->check();
FlGui::instance()->setProgress(str, (n > N - 1) ? 0 : n, 0, N);
}
......@@ -773,9 +775,6 @@ void Msg::ProgressMeter(int n, int N, bool log, const char *fmt, ...)
(n > N - 1) ? "" : str2);
fflush(stdout);
}
//#if defined(_OPENMP)
//#pragma omp barrier
//#endif
}
}
......@@ -794,7 +793,7 @@ void Msg::PrintTimers()
if(CTX::instance()->terminal){
if(_commSize > 1)
fprintf(stdout, "Timers : [rank %3d] %s\n", _commRank, str.c_str());
fprintf(stdout, "Timers : [rank %3d] %s\n", GetCommRank(), str.c_str());
else
fprintf(stdout, "Timers : %s\n", str.c_str());
fflush(stdout);
......@@ -812,19 +811,19 @@ void Msg::ResetErrorCounter()
void Msg::PrintErrorCounter(const char *title)
{
if(_commRank || _verbosity < 1) return;
if(!_warningCount && !_errorCount) return;
if(GetCommRank() || GetVerbosity() < 1) return;
if(!GetWarningCount() && !GetErrorCount()) return;
std::string prefix = _errorCount ? "Error : " : "Warning : ";
std::string prefix = GetErrorCount() ? "Error : " : "Warning : ";
std::string help("Check the full log for details");
std::string line(std::max(strlen(title), help.size()), '-');
char warn[128], err[128];
sprintf(warn, "%5d warning%s", _warningCount, _warningCount == 1 ? "" : "s");
sprintf(err, "%5d error%s", _errorCount, _errorCount == 1 ? "" : "s");
sprintf(warn, "%5d warning%s", GetWarningCount(), GetWarningCount() == 1 ? "" : "s");
sprintf(err, "%5d error%s", GetErrorCount(), GetErrorCount() == 1 ? "" : "s");
#if defined(HAVE_FLTK)
if(FlGui::available()){
std::string col = _errorCount ?
std::string col = GetErrorCount() ?
std::string(CTX::instance()->guiColorScheme ? "@B72@." : "@C1@.") :
std::string(CTX::instance()->guiColorScheme ? "@B152@." : "@C5@.");
FlGui::instance()->addMessage((col + prefix + line).c_str());
......@@ -833,14 +832,14 @@ void Msg::PrintErrorCounter(const char *title)
FlGui::instance()->addMessage((col + prefix + err).c_str());
FlGui::instance()->addMessage((col + prefix + help).c_str());
FlGui::instance()->addMessage((col + prefix + line).c_str());
if(_errorCount) fl_beep();
if(GetErrorCount()) fl_beep();
}
#endif
if(CTX::instance()->terminal){
const char *c0 = "", *c1 = "";
if(!streamIsFile(stderr) && streamIsVT100(stderr)){
c0 = _errorCount ? "\33[1m\33[31m" : "\33[35m"; // bold red or magenta
c0 = GetErrorCount() ? "\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(),
......@@ -1575,6 +1574,8 @@ MsgProgressStatus::~MsgProgressStatus()
void MsgProgressStatus::next()
{
if(Msg::GetCommRank() || Msg::GetNumThreads() > 1) return;
++_currentI;
if (_currentI < _nextIToCheck) return;
......
......@@ -104,10 +104,10 @@ class GmshSocket{
int _SendData(const void *buffer, int bytes)
{
const char *buf = (const char *)buffer;
int sofar = 0;
int remaining = bytes;
long int sofar = 0;
long int remaining = bytes;
do {
int len = send(_sock, buf + sofar, remaining, 0);
long int len = send(_sock, buf + sofar, remaining, 0);
if(len < 0) return -1; // error
sofar += len;
remaining -= len;
......@@ -119,10 +119,10 @@ class GmshSocket{
int _ReceiveData(void *buffer, int bytes)
{
char *buf = (char *)buffer;
int sofar = 0;
int remaining = bytes;
long int sofar = 0;
long int remaining = bytes;
do {
int len = recv(_sock, buf + sofar, remaining, 0);
long int len = recv(_sock, buf + sofar, remaining, 0);
if(len == 0) break; // we're done!
if(len < 0) return -1; // error
sofar += len;
......
......@@ -38,7 +38,11 @@
#include <algorithm>
#include <sstream>
#include "GmshSocket.h"
#define HAVE_PICOJSON
#if defined(HAVE_PICOJSON)
#include "picojson.h"
#endif
namespace onelab{
......@@ -362,6 +366,7 @@ namespace onelab{
}
return sstream.str();
}
#if defined(HAVE_PICOJSON)
virtual bool fromJSON(const picojson::value::object& par)
{
for(picojson::value::object::const_iterator it = par.begin(); it != par.end(); ++it){
......@@ -410,6 +415,7 @@ namespace onelab{
}
return true;
}
#endif
};
class parameterLessThan{
......@@ -579,6 +585,7 @@ namespace onelab{
sstream << " }";
return sstream.str();
}
#if defined(HAVE_PICOJSON)
bool fromJSON(const picojson::value::object& par)
{
if(!parameter::fromJSON(par)) return false;
......@@ -628,6 +635,7 @@ namespace onelab{
}
return true;
}
#endif
};
// The string class. A string has a mutable "kind", that can be changed at
......@@ -727,6 +735,7 @@ namespace onelab{
sstream << " }";
return sstream.str();
}
#if defined(HAVE_PICOJSON)
bool fromJSON(const picojson::value::object& par)
{
if(!parameter::fromJSON(par)) return false;
......@@ -756,6 +765,7 @@ namespace onelab{
}
return true;
}
#endif
};
// The parameter space, i.e., the set of parameters stored and handled by the
......@@ -1014,6 +1024,7 @@ namespace onelab{
json += "\n ] }\n}\n";
return true;
}
#if defined(HAVE_PICOJSON)
bool fromJSON(const std::string &json, const std::string &client="")
{
picojson::value v;
......@@ -1051,6 +1062,7 @@ namespace onelab{
}
return true;
}
#endif
};
// The onelab client: a class that communicates with the onelab server. Each
......@@ -1215,10 +1227,12 @@ namespace onelab{
{
return _parameterSpace.toJSON(json, client);
}
#if defined(HAVE_PICOJSON)
bool fromJSON(const std::string &json, const std::string &client="")
{
return _parameterSpace.fromJSON(json, client);
}
#endif
};
// A local client, which lives in the same memory space as the server.
......
......@@ -1698,13 +1698,14 @@ static void geometry_elementary_boolean_cb(Fl_Widget *w, void *data)
else
selectObject = false;
}
else if(tool.empty()){
else if(tool.empty() && mode != "BooleanFragments"){
Msg::Error("At least one tool must be selected");
}
else{
apply_boolean(GModel::current()->getFileName(), mode, object, tool,
FlGui::instance()->transformContext->butt[4]->value(),
FlGui::instance()->transformContext->butt[5]->value());
tool.size() ?
FlGui::instance()->transformContext->butt[5]->value() : 0);
GModel::current()->setSelection(0);
selectObject = true;
object.clear();
......@@ -4206,13 +4207,13 @@ static menuItem static_modules[] = {
(Fl_Callback *)geometry_elementary_extrude_rotate_cb} ,
{"0Modules/Geometry/Elementary entities/Extrude/Pipe",
(Fl_Callback *)geometry_elementary_pipe_cb} ,
{"0Modules/Geometry/Elementary entities/Boolean/Intersection",
{"0Modules/Geometry/Elementary entities/Boolean/Intersection (Common)",
(Fl_Callback *)geometry_elementary_boolean_cb, (void*)"BooleanIntersection"} ,
{"0Modules/Geometry/Elementary entities/Boolean/Union",
{"0Modules/Geometry/Elementary entities/Boolean/Union (Fuse)",
(Fl_Callback *)geometry_elementary_boolean_cb, (void*)"BooleanUnion"} ,
{"0Modules/Geometry/Elementary entities/Boolean/Difference",
{"0Modules/Geometry/Elementary entities/Boolean/Difference (Cut)",
(Fl_Callback *)geometry_elementary_boolean_cb, (void*)"BooleanDifference"} ,
{"0Modules/Geometry/Elementary entities/Boolean/Fragments",
{"0Modules/Geometry/Elementary entities/Boolean/Fragments (Coherence)",
(Fl_Callback *)geometry_elementary_boolean_cb, (void*)"BooleanFragments"} ,
{"0Modules/Geometry/Elementary entities/Fillet",
(Fl_Callback *)geometry_elementary_fillet_cb},
......
......@@ -179,7 +179,7 @@ statisticsWindow::statisticsWindow(int deltaFontSize)
{
memUsage = new Fl_Box(WB, height - BH - WB, width / 2, BH, "");
memUsage->align(FL_ALIGN_INSIDE);
memUsage->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
Fl_Return_Button *o = new Fl_Return_Button
(width - BB - WB, height - BH - WB, BB, BH, "Update");
......
......@@ -33,7 +33,7 @@ static void view_toggle_cb(Fl_Widget *w, void *data)
viewButton *but = FlGui::instance()->onelab->getViewButton(num);
if(but){
if(Fl::event_state(FL_SHIFT)){
for(int i = 0; i < PView::list.size(); i++){
for(unsigned int i = 0; i < PView::list.size(); i++){
if(i != num) opt_view_visible(i, GMSH_SET | GMSH_GUI, 0);
else opt_view_visible(i, GMSH_SET | GMSH_GUI, 1);
}
......
......@@ -1041,8 +1041,10 @@ void DeleteSurface(int is, bool recursive)
if(c->beg) vv.insert(c->beg->Num);
if(c->end) vv.insert(c->end->Num);
}
for(std::set<int>::iterator it = cc.begin(); it != cc.end(); it++)
for(std::set<int>::iterator it = cc.begin(); it != cc.end(); it++){
DeleteCurve(*it);
DeleteCurve(-*it);
}
for(std::set<int>::iterator it = vv.begin(); it != vv.end(); it++)
DeletePoint(*it);
}
......@@ -1078,8 +1080,10 @@ void DeleteVolume(int iv, bool recursive)
}
for(std::set<int>::iterator it = ss.begin(); it != ss.end(); it++)
DeleteSurface(*it);
for(std::set<int>::iterator it = cc.begin(); it != cc.end(); it++)
for(std::set<int>::iterator it = cc.begin(); it != cc.end(); it++){
DeleteCurve(*it);
DeleteCurve(-*it);
}
for(std::set<int>::iterator it = vv.begin(); it != vv.end(); it++)
DeletePoint(*it);
}
......@@ -2331,7 +2335,7 @@ static void RemoveDegenerateCurves()
List_Read(All, i, &c);
if(c->degenerate()) {
DeleteCurve(c->Num);
// DeleteCurve(-c->Num);
DeleteCurve(-c->Num);
}
}
}
......@@ -2429,7 +2433,6 @@ static void RemoveDegenerateSurfaces()
List_Delete (ll);
List_Delete (ll2);
}
printf("Deleting Surface %d\n",s->Num);
DeleteSurface(s->Num);
}
}
......
......@@ -190,7 +190,7 @@ void GetStatistics(double stat[50], double quality[3][100])
stat[16] = CTX::instance()->meshTimer[2];
if(quality){
for(int i = 0; i < 4; i++)
for(int i = 0; i < 3; i++)
for(int j = 0; j < 100; j++)
quality[i][j] = 0.;
double minSICN = 0., minSICNMin = 1., minSICNMax = -1.;
......@@ -319,13 +319,13 @@ static void Mesh1D(GModel *m)
Msg::StatusBar(true, "Meshing 1D...");
double t1 = Cpu();
std::vector<GEdge*> temp;
for(GModel::eiter it = m->firstEdge(); it != m->lastEdge(); ++it){
(*it)->meshStatistics.status = GEdge::PENDING;
temp.push_back(*it);
}
Msg::ResetProgressMeter();
int nIter = 0, nTot = m->getNumEdges();
......@@ -346,9 +346,9 @@ static void Mesh1D(GModel *m)
nPending++;
}
}
// if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 1D...");
if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 1D...");
}
if(!nPending) break;
if(nIter++ > 10) break;
}
......@@ -486,7 +486,7 @@ static void Mesh2D(GModel *m)
nPending++;
}
}
// if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 2D...");
if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 2D...");
}
#if defined(_OPENMP)
#pragma omp master
......@@ -519,7 +519,7 @@ static void Mesh2D(GModel *m)
#endif
nPending++;
}
// if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 2D...");
if(!nIter) Msg::ProgressMeter(nPending, nTot, false, "Meshing 2D...");
}
if(!nPending) break;
if(nIter++ > 10) break;
......@@ -825,6 +825,11 @@ static void Mesh3D(GModel *m)
Msg::StatusBar(true, "Meshing 3D...");
double t1 = Cpu();
Msg::ResetProgressMeter();
if(m->getNumRegions())
Msg::ProgressMeter(0, 100, false, "Meshing 3D...");
// mesh the extruded volumes first
std::for_each(m->firstRegion(), m->lastRegion(), meshGRegionExtruded());
......@@ -939,12 +944,16 @@ static void Mesh3D(GModel *m)
m->setAllVolumesPositive();
// std::for_each(m->firstRegion(), m->lastRegion(), optimizeMeshGRegionNetgen());
if (Msg::GetVerbosity() > 98)
std::for_each(m->firstRegion(), m->lastRegion(), TEST_IF_MESH_IS_COMPATIBLE_WITH_EMBEDDED_ENTITIES ());
if(Msg::GetVerbosity() > 98)