Skip to content
Snippets Groups Projects
Commit 548fc31d authored by Tristan Carrier Baudouin's avatar Tristan Carrier Baudouin
Browse files

Voronoi 3D

parent 0463689f
No related branches found
No related tags found
No related merge requests found
...@@ -1452,8 +1452,6 @@ void LpSmoother::improve_model(){ ...@@ -1452,8 +1452,6 @@ void LpSmoother::improve_model(){
GModel* model = GModel::current(); GModel* model = GModel::current();
GModel::riter it; GModel::riter it;
Frame_field::init_model();
for(it=model->firstRegion();it!=model->lastRegion();it++) for(it=model->firstRegion();it!=model->lastRegion();it++)
{ {
gr = *it; gr = *it;
...@@ -1461,8 +1459,6 @@ void LpSmoother::improve_model(){ ...@@ -1461,8 +1459,6 @@ void LpSmoother::improve_model(){
improve_region(gr); improve_region(gr);
} }
} }
Frame_field::clear();
} }
void LpSmoother::improve_region(GRegion* gr) void LpSmoother::improve_region(GRegion* gr)
...@@ -1494,6 +1490,7 @@ void LpSmoother::improve_region(GRegion* gr) ...@@ -1494,6 +1490,7 @@ void LpSmoother::improve_region(GRegion* gr)
alglib::real_1d_array x; alglib::real_1d_array x;
alglib::real_1d_array alglib_scales; alglib::real_1d_array alglib_scales;
Frame_field::init_model();
octree = new MElementOctree(gr->model()); octree = new MElementOctree(gr->model());
for(i=0;i<gr->getNumMeshElements();i++){ for(i=0;i<gr->getNumMeshElements();i++){
...@@ -1623,6 +1620,7 @@ void LpSmoother::improve_region(GRegion* gr) ...@@ -1623,6 +1620,7 @@ void LpSmoother::improve_region(GRegion* gr)
delete octree; delete octree;
free(initial_conditions); free(initial_conditions);
free(scales); free(scales);
Frame_field::clear();
#endif #endif
} }
......
...@@ -182,6 +182,7 @@ void voroMetal3D::execute(std::vector<SPoint3>& vertices) ...@@ -182,6 +182,7 @@ void voroMetal3D::execute(std::vector<SPoint3>& vertices)
std::ofstream file("cells.pos"); std::ofstream file("cells.pos");
file << "View \"test\" {\n"; file << "View \"test\" {\n";
std::ofstream file2("cells.geo"); std::ofstream file2("cells.geo");
file2 << "Coherence;\n";
file2 << "c = 1.0;\n"; file2 << "c = 1.0;\n";
for(i=0;i<pointers.size();i++){ for(i=0;i<pointers.size();i++){
obj = geo_cell(); obj = geo_cell();
...@@ -363,3 +364,36 @@ void voroMetal3D::print_geo_face_loop(int index,std::vector<int>& indices,std::o ...@@ -363,3 +364,36 @@ void voroMetal3D::print_geo_face_loop(int index,std::vector<int>& indices,std::o
file << "};\n"; file << "};\n";
} }
void voroMetal3D::correspondance(){
int i;
GFace* gf;
GModel* model = GModel::current();
GModel::fiter it;
std::vector<GFace*> faces;
std::map<GFace*,bool> markings;
faces.clear();
for(it=model->firstFace();it!=model->lastFace();it++)
{
gf = *it;
if(gf->numRegions()==1){
faces.push_back(gf);
}
printf("%d ",gf->numRegions());
}
printf("\n");
printf("%zu\n",faces.size());
markings.clear();
for(i=0;i<faces.size();i++){
markings.insert(std::pair<GFace*,bool>(faces[i],0));
}
std::ofstream file;
file.open("cells.geo",ios::out | ios::app);
//geofile << "test\n";
}
\ No newline at end of file
...@@ -28,4 +28,5 @@ class voroMetal3D{ ...@@ -28,4 +28,5 @@ class voroMetal3D{
void print_geo_volume(int,int,std::ofstream&); void print_geo_volume(int,int,std::ofstream&);
void print_geo_line_loop(int,std::vector<int>&,std::vector<int>&,std::ofstream&); void print_geo_line_loop(int,std::vector<int>&,std::vector<int>&,std::ofstream&);
void print_geo_face_loop(int,std::vector<int>&,std::ofstream&); void print_geo_face_loop(int,std::vector<int>&,std::ofstream&);
void correspondance();
}; };
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment