Skip to content
Snippets Groups Projects
Commit a91e10f2 authored by Gaetan Bricteux's avatar Gaetan Bricteux
Browse files

fix commit

parent 34589b29
Branches
Tags
No related merge requests found
...@@ -3,15 +3,19 @@ ...@@ -3,15 +3,19 @@
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include "voro++.hh"
#include "Voronoi3D.h" #include "Voronoi3D.h"
#include "GModel.h" #include "GModel.h"
#include "MElement.h" #include "MElement.h"
#include "meshGRegion.h" #include "meshGRegion.h"
#include <fstream> #include <fstream>
#include "Levy3D.h" #include "Levy3D.h"
#if defined(HAVE_Voro3D)
#include "voro++.hh"
#endif
#if defined(HAVE_Voro3D)
using namespace voro; using namespace voro;
#endif
/*********class clip*********/ /*********class clip*********/
...@@ -72,6 +76,7 @@ void clip::execute(GRegion* gr){ ...@@ -72,6 +76,7 @@ void clip::execute(GRegion* gr){
} }
void clip::execute(std::vector<SPoint3>& vertices,std::vector<VoronoiElement>& clipped){ void clip::execute(std::vector<SPoint3>& vertices,std::vector<VoronoiElement>& clipped){
#if defined(HAVE_Voro3D)
int i; int i;
int j; int j;
int start; int start;
...@@ -265,6 +270,9 @@ void clip::execute(std::vector<SPoint3>& vertices,std::vector<VoronoiElement>& c ...@@ -265,6 +270,9 @@ void clip::execute(std::vector<SPoint3>& vertices,std::vector<VoronoiElement>& c
//printf("%f %f\n",volume1,volume2); //printf("%f %f\n",volume1,volume2);
for(i=0;i<pointers.size();i++) delete pointers[i]; for(i=0;i<pointers.size();i++) delete pointers[i];
#else
Msg::Error("Gmsh needs to be compiled with Voro3D to use clip");
#endif
} }
double clip::min(double a,double b){ double clip::min(double a,double b){
......
...@@ -171,7 +171,7 @@ void meshMetric::exportInfo(const char * fileendname){ ...@@ -171,7 +171,7 @@ void meshMetric::exportInfo(const char * fileendname){
meshMetric::~meshMetric(){ meshMetric::~meshMetric(){
if (_octree) delete _octree; if (_octree) delete _octree;
for (int i=0; i< _elements.size(); i++) for (unsigned int i = 0; i < _elements.size(); i++)
delete _elements[i]; delete _elements[i];
} }
......
...@@ -3,15 +3,19 @@ ...@@ -3,15 +3,19 @@
// See the LICENSE.txt file for license information. Please report all // See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>. // bugs and problems to <gmsh@geuz.org>.
#include "voro++.hh"
#include "periodical.h" #include "periodical.h"
#include "GModel.h" #include "GModel.h"
#include "meshGRegion.h" #include "meshGRegion.h"
#include <fstream> #include <fstream>
#include <algorithm> #include <algorithm>
#include "MElement.h" #include "MElement.h"
#if defined(HAVE_Voro3D)
#include "voro++.hh"
#endif
#if defined(HAVE_Voro3D)
using namespace voro; using namespace voro;
#endif
/*********class voroMetal3D*********/ /*********class voroMetal3D*********/
...@@ -58,6 +62,7 @@ void voroMetal3D::execute(GRegion* gr){ ...@@ -58,6 +62,7 @@ void voroMetal3D::execute(GRegion* gr){
} }
void voroMetal3D::execute(std::vector<SPoint3>& vertices){ void voroMetal3D::execute(std::vector<SPoint3>& vertices){
#if defined(HAVE_Voro3D)
int i; int i;
int j; int j;
int start; int start;
...@@ -144,6 +149,9 @@ void voroMetal3D::execute(std::vector<SPoint3>& vertices){ ...@@ -144,6 +149,9 @@ void voroMetal3D::execute(std::vector<SPoint3>& vertices){
file << "};\n"; file << "};\n";
for(i=0;i<pointers.size();i++) delete pointers[i]; for(i=0;i<pointers.size();i++) delete pointers[i];
#else
Msg::Error("Gmsh needs to be compiled with Voro3D to use voroMetal3D");
#endif
} }
void voroMetal3D::print_segment(SPoint3 p1,SPoint3 p2,std::ofstream& file){ void voroMetal3D::print_segment(SPoint3 p1,SPoint3 p2,std::ofstream& file){
......
...@@ -9,7 +9,9 @@ ...@@ -9,7 +9,9 @@
#include "MElementOctree.h" #include "MElementOctree.h"
#include "meshGRegion.h" #include "meshGRegion.h"
#include <queue> #include <queue>
#if defined(HAVE_RTREE)
#include "rtree.h" #include "rtree.h"
#endif
#include <fstream> #include <fstream>
#define k1 0.7 //k1*h is the minimal distance between two nodes #define k1 0.7 //k1*h is the minimal distance between two nodes
...@@ -325,6 +327,7 @@ void Filler::treat_model(){ ...@@ -325,6 +327,7 @@ void Filler::treat_model(){
} }
void Filler::treat_region(GRegion* gr){ void Filler::treat_region(GRegion* gr){
#if defined(HAVE_RTREE)
int i,j; int i,j;
int count; int count;
bool ok; bool ok;
...@@ -433,6 +436,9 @@ void Filler::treat_region(GRegion* gr){ ...@@ -433,6 +436,9 @@ void Filler::treat_region(GRegion* gr){
for(i=0;i<garbage.size();i++) delete garbage[i]; for(i=0;i<garbage.size();i++) delete garbage[i];
for(i=0;i<new_vertices.size();i++) delete new_vertices[i]; for(i=0;i<new_vertices.size();i++) delete new_vertices[i];
new_vertices.clear(); new_vertices.clear();
#else
Msg::Error("Gmsh needs to be compiled with rtree to use Filler::treat_region");
#endif
} }
Metric Filler::get_metric(double x,double y,double z){ Metric Filler::get_metric(double x,double y,double z){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment