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

fix the mess

parent 37e05213
Branches
Tags
No related merge requests found
...@@ -489,85 +489,73 @@ static void Mesh3D(GModel *m) ...@@ -489,85 +489,73 @@ static void Mesh3D(GModel *m)
FindConnectedRegions(delaunay, connected); FindConnectedRegions(delaunay, connected);
// remove quads elements for volumes that are recombined // remove quads elements for volumes that are recombined
// pragma OMP ICI ?? // pragma OMP here ?
for(unsigned int i = 0; i < connected.size(); i++){ for(unsigned int i = 0; i < connected.size(); i++){
for(unsigned j=0;j<connected[i].size();j++){ for(unsigned j = 0; j < connected[i].size(); j++){
GRegion *gr = connected[i][j]; GRegion *gr = connected[i][j];
if(CTX::instance()->mesh.recombine3DAll || gr->meshAttributes.recombine3D){ if(CTX::instance()->mesh.recombine3DAll || gr->meshAttributes.recombine3D){
std::list<GFace*> f = gr->faces(); std::list<GFace*> f = gr->faces();
for (std::list<GFace*>::iterator it = f.begin(); for(std::list<GFace*>::iterator it = f.begin(); it != f.end() ; ++it)
it != f.end() ; ++it) quadsToTriangles (*it,1000000); quadsToTriangles(*it, 1000000);
} }
} }
} }
// pragma OMP ICI ?? double time_recombination = 0., vol_element_recombination = 0.;
double time_recombination, vol_element_recombination, vol_hexa_recombination; double vol_hexa_recombination = 0.;
int nb_elements_recombination,nb_hexa_recombination; int nb_elements_recombination = 0, nb_hexa_recombination = 0;
time_recombination = vol_hexa_recombination = vol_element_recombination = 0.;
nb_elements_recombination = nb_hexa_recombination = 0; // pragma OMP here ?
for(unsigned int i = 0; i < connected.size(); i++){ for(unsigned int i = 0; i < connected.size(); i++){
MeshDelaunayVolume(connected[i]); MeshDelaunayVolume(connected[i]);
//Additional code for hex mesh begin // additional code for experimental hex mesh
for(unsigned j=0;j<connected[i].size();j++){ for(unsigned j = 0; j < connected[i].size(); j++){
GRegion *gr = connected[i][j]; GRegion *gr = connected[i][j];
//R-tree bool treat_region_ok = false;
bool treat_region_ok=false;
if(CTX::instance()->mesh.algo3d == ALGO_3D_RTREE){ if(CTX::instance()->mesh.algo3d == ALGO_3D_RTREE){
// PEB MODIF
if (old_algo_hexa()){ if (old_algo_hexa()){
Filler f; Filler f;
f.treat_region(gr); f.treat_region(gr);
treat_region_ok=true; treat_region_ok = true;
} }
else{ else{
Filler3D f; Filler3D f;
treat_region_ok = f.treat_region(gr); treat_region_ok = f.treat_region(gr);
} }
// END PEB MODIF
} }
//Recombine3D into hex if(treat_region_ok && (CTX::instance()->mesh.recombine3DAll ||
if((CTX::instance()->mesh.recombine3DAll || gr->meshAttributes.recombine3D) && treat_region_ok){ gr->meshAttributes.recombine3D)){
clock_t a = clock(); double a = Cpu();
// Recombinator rec;
// rec.execute();
Recombinator rec; Recombinator rec;
rec.execute(gr); rec.execute(gr);
// Recombinator_Graph rec(1.e7,"test");
// rec.execute(gr);
// Supplementary sup;
// sup.execute();
// PostOp post;
// post.execute(0);
Supplementary sup; Supplementary sup;
sup.execute(gr); sup.execute(gr);
PostOp post; PostOp post;
post.execute(gr,0); post.execute(gr,0);
nb_elements_recombination += post.get_nb_elements(); nb_elements_recombination += post.get_nb_elements();
nb_hexa_recombination += post.get_nb_hexahedra(); nb_hexa_recombination += post.get_nb_hexahedra();
vol_element_recombination += post.get_vol_elements(); vol_element_recombination += post.get_vol_elements();
vol_hexa_recombination += post.get_vol_hexahedra(); vol_hexa_recombination += post.get_vol_hexahedra();
// partial export
// -- partial export
stringstream ss; stringstream ss;
ss << "yamakawa_part_"; ss << "yamakawa_part_";
ss << gr->tag(); ss << gr->tag();
ss << ".msh"; ss << ".msh";
export_gregion_mesh(gr,ss.str().c_str()); export_gregion_mesh(gr, ss.str().c_str());
// -- end partial export time_recombination += (Cpu() - a);
time_recombination += (clock() - a) / (double)CLOCKS_PER_SEC;
} }
} }
} }
if(CTX::instance()->mesh.recombine3DAll){ if(CTX::instance()->mesh.recombine3DAll){
cout << "RECOMBINATION timing:" << endl; Msg::Info("RECOMBINATION timing:");
cout << " ------- CUMULATIVE TIME RECOMBINATION : " << time_recombination << " s." << endl; Msg::Info(" --- CUMULATIVE TIME RECOMBINATION : %g s.", time_recombination);
cout << "RECOMBINATION CUMULATIVE STATISTICS:" << endl; Msg::Info("RECOMBINATION CUMULATIVE STATISTICS:");
cout << "............................ Percentage of hexahedra (#) : " << nb_hexa_recombination*100./nb_elements_recombination << endl; Msg::Info(".... Percentage of hexahedra (#) : %g",
cout << "............................ Percentage of hexahedra (Vol) : " << vol_hexa_recombination*100./vol_element_recombination << endl; nb_hexa_recombination*100./nb_elements_recombination);
Msg::Info(".... Percentage of hexahedra (Vol) : %g",
vol_hexa_recombination*100./vol_element_recombination);
} }
// Ensure that all volume Jacobians are positive // Ensure that all volume Jacobians are positive
......
...@@ -192,13 +192,14 @@ class compareSmoothnessVertexPairs ...@@ -192,13 +192,14 @@ class compareSmoothnessVertexPairs
private: private:
const double threshold; const double threshold;
double roundit(const double &d)const{ double roundit(const double &d)const{
return (round(d/threshold)*threshold); //return (round(d/threshold)*threshold);
return ((int)(d/threshold + 0.5)*threshold);
} }
public: public:
static bool vectorial; static bool vectorial;
compareSmoothnessVertexPairs():threshold(0.05){}; compareSmoothnessVertexPairs():threshold(0.05){};
inline bool operator () (const smoothness_vertex_pair *a, const smoothness_vertex_pair *b) const inline bool operator () (const smoothness_vertex_pair *a, const smoothness_vertex_pair *b) const
{ {
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment