Skip to content
Snippets Groups Projects
Commit 17a00707 authored by Emilie Marchandise's avatar Emilie Marchandise
Browse files

No commit message

No commit message
parent 913f8908
No related branches found
No related tags found
No related merge requests found
...@@ -180,6 +180,27 @@ statisticsWindow::statisticsWindow(int deltaFontSize) ...@@ -180,6 +180,27 @@ statisticsWindow::statisticsWindow(int deltaFontSize)
void statisticsWindow::compute(bool elementQuality) void statisticsWindow::compute(bool elementQuality)
{ {
//emi hack
// double minAngle = 120.0;
// double meanAngle = 0.0;
// int count = 0;
// std::vector<GEntity*> entities;
// GModel::current()->getEntities(entities);
// std::map<int, std::vector<double> > d;
// for(unsigned int i = 0; i < entities.size(); i++){
// if(entities[i]->dim() < 2) continue;
// for(unsigned int j = 0; j < entities[i]->getNumMeshElements(); j++){
// MElement *e = entities[i]->getMeshElement(j);
// double angle = e->angleShapeMeasure();
// minAngle = std::min(minAngle, angle);
// meanAngle += angle;
// count++;
// }
// }
// meanAngle = meanAngle / count;
// printf("Angles = min=%g av=%g \n", minAngle, meanAngle);
//hack emi
int num = 0; int num = 0;
static double s[50]; static double s[50];
static char label[50][256]; static char label[50][256];
......
...@@ -2005,7 +2005,7 @@ void GFaceCompound::printStuff() const ...@@ -2005,7 +2005,7 @@ void GFaceCompound::printStuff() const
{ {
if( !CTX::instance()->mesh.saveAll) return; if( !CTX::instance()->mesh.saveAll) return;
std::list<GFace*>::const_iterator it = _compound.begin(); std::list<GFace*>::const_iterator it = _compound.begin();
char name0[256], name1[256], name2[256], name3[256]; char name0[256], name1[256], name2[256], name3[256];
......
...@@ -1545,7 +1545,7 @@ void partitionAndRemesh(GFaceCompound *gf) ...@@ -1545,7 +1545,7 @@ void partitionAndRemesh(GFaceCompound *gf)
//Partition the mesh and createTopology for new faces //Partition the mesh and createTopology for new faces
//----------------------------------------------------- //-----------------------------------------------------
double tbegin = Cpu();
std::list<GFace*> cFaces = gf->getCompounds(); std::list<GFace*> cFaces = gf->getCompounds();
std::vector<MElement *> elements; std::vector<MElement *> elements;
for (std::list<GFace*>::iterator it = cFaces.begin(); it != cFaces.end(); it++) for (std::list<GFace*>::iterator it = cFaces.begin(); it != cFaces.end(); it++)
...@@ -1555,7 +1555,7 @@ void partitionAndRemesh(GFaceCompound *gf) ...@@ -1555,7 +1555,7 @@ void partitionAndRemesh(GFaceCompound *gf)
typeOfPartition method; typeOfPartition method;
if(gf->nbSplit > 0) method = MULTILEVEL; if(gf->nbSplit > 0) method = MULTILEVEL;
else method = LAPLACIAN; else method = LAPLACIAN;
multiscalePartition *msp = new multiscalePartition(elements, abs(gf->nbSplit), method); multiscalePartition *msp = new multiscalePartition(elements, abs(gf->nbSplit), method);
//gf->partitionFaceCM(); //gf->partitionFaceCM();
...@@ -1569,13 +1569,15 @@ void partitionAndRemesh(GFaceCompound *gf) ...@@ -1569,13 +1569,15 @@ void partitionAndRemesh(GFaceCompound *gf)
gf->model()->createTopologyFromFaces(pFaces); gf->model()->createTopologyFromFaces(pFaces);
Msg::Info("Multiscale Partition SUCCESSFULLY PERFORMED : %d parts", NF ); double tmult = Cpu();
Msg::Info("Multiscale Partition SUCCESSFULLY PERFORMED : %d parts (%g s)", NF , tmult -tbegin);
gf->model()->writeMSH("multiscalePARTS.msh", 2.2, false, true); gf->model()->writeMSH("multiscalePARTS.msh", 2.2, false, true);
//Remesh new faces (Compound Lines and Compound Surfaces) //Remesh new faces (Compound Lines and Compound Surfaces)
//----------------------------------------------------- //-----------------------------------------------------
Msg::Info("--- Parametrize Compounds:"); Msg::Info("*** Starting parametrize compounds:");
double t0 = Cpu();
//Parametrize Compound Lines //Parametrize Compound Lines
int NE = gf->model()->getMaxElementaryNumber(1) - nume + 1; int NE = gf->model()->getMaxElementaryNumber(1) - nume + 1;
for (int i=0; i < NE; i++){ for (int i=0; i < NE; i++){
...@@ -1610,13 +1612,17 @@ void partitionAndRemesh(GFaceCompound *gf) ...@@ -1610,13 +1612,17 @@ void partitionAndRemesh(GFaceCompound *gf)
gfc->parametrize(); gfc->parametrize();
} }
Msg::Info("*** Mesh Compounds:"); double t1 = Cpu();
Msg::Info("*** Parametrize compounds done (%g s)", t1-t0);
Msg::Info("*** Starting meshing 1D edges ...:");
for (int i = 0; i < NE; i++){ for (int i = 0; i < NE; i++){
GEdge *gec = gf->model()->getEdgeByTag(nume + NE + i); GEdge *gec = gf->model()->getEdgeByTag(nume + NE + i);
meshGEdge mge; meshGEdge mge;
mge(gec); mge(gec);
} }
double t2 = Cpu();
Msg::Info("*** Meshing 1D edges done (%gs)", t2-t1);
Msg::Info("*** Starting Mesh of surface %d ...", gf->tag()); Msg::Info("*** Starting Mesh of surface %d ...", gf->tag());
...@@ -1706,7 +1712,8 @@ void partitionAndRemesh(GFaceCompound *gf) ...@@ -1706,7 +1712,8 @@ void partitionAndRemesh(GFaceCompound *gf)
} }
} }
Msg::Info("*** Mesh of surface %d done by assembly remeshed faces", gf->tag()); double t3 = Cpu();
Msg::Info("*** Mesh of surface %d done by assembly remeshed faces (%g s)", gf->tag(), t3-t2);
Msg::Info("-----------------------------------------------------------"); Msg::Info("-----------------------------------------------------------");
gf->coherenceNormals(); gf->coherenceNormals();
......
...@@ -341,6 +341,7 @@ double qmTriangleAngles (MTriangle *e) { ...@@ -341,6 +341,7 @@ double qmTriangleAngles (MTriangle *e) {
rot[2][0]= 0; rot[2][1]=0; rot[2][2]=1; rot[2][0]= 0; rot[2][1]=0; rot[2][2]=1;
double tmp[3][3]; double tmp[3][3];
double minAngle = 120.0;
for (int i = 0; i < e->getNumPrimaryVertices(); i++) { for (int i = 0; i < e->getNumPrimaryVertices(); i++) {
const double u = i == 1 ? 1 : 0; const double u = i == 1 ? 1 : 0;
const double v = i == 2 ? 1 : 0; const double v = i == 2 ? 1 : 0;
...@@ -375,12 +376,18 @@ double qmTriangleAngles (MTriangle *e) { ...@@ -375,12 +376,18 @@ double qmTriangleAngles (MTriangle *e) {
double c; double c;
prosca(v1,v2,&c); prosca(v1,v2,&c);
double x = acos(c)-M_PI/3; double x = acos(c)-M_PI/3;
// printf("Angle %g ", (x+M_PI/3)/M_PI*180); double angle = (x+M_PI/3)/M_PI*180;
double quality = (atan(a*(x+M_PI/9)) + atan(a*(M_PI/9-x)))/den; double quality = (atan(a*(x+M_PI/9)) + atan(a*(M_PI/9-x)))/den;
// printf("Quality %g\n",quality);
worst_quality = std::min(worst_quality, quality); worst_quality = std::min(worst_quality, quality);
// minAngle = std::min(angle, minAngle);
// printf("Angle %g ", angle);
// printf("Quality %g\n",quality);
} }
//printf("\n"); // printf("MinAngle %g ", minAngle);
// printf("\n");
// return minAngle;
return worst_quality; return worst_quality;
} }
......
...@@ -13,3 +13,12 @@ Line Loop(5) = {1, 2, 3, 4}; ...@@ -13,3 +13,12 @@ Line Loop(5) = {1, 2, 3, 4};
Plane Surface(10) = {5}; Plane Surface(10) = {5};
Field[1] = Attractor;
Field[1].EdgesList = {1};
Field[2] = BoundaryLayer;
Field[2].DistMax = 0.1;
Field[2].DistMin = 0.002;
Background Field = 2;
Background Field = -1;
Background Field = 1;
Background Field = 2;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment