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)
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;
static double s[50];
static char label[50][256];
......
......@@ -1545,7 +1545,7 @@ void partitionAndRemesh(GFaceCompound *gf)
//Partition the mesh and createTopology for new faces
//-----------------------------------------------------
double tbegin = Cpu();
std::list<GFace*> cFaces = gf->getCompounds();
std::vector<MElement *> elements;
for (std::list<GFace*>::iterator it = cFaces.begin(); it != cFaces.end(); it++)
......@@ -1569,12 +1569,14 @@ void partitionAndRemesh(GFaceCompound *gf)
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);
//Remesh new faces (Compound Lines and Compound Surfaces)
//-----------------------------------------------------
Msg::Info("--- Parametrize Compounds:");
Msg::Info("*** Starting parametrize compounds:");
double t0 = Cpu();
//Parametrize Compound Lines
int NE = gf->model()->getMaxElementaryNumber(1) - nume + 1;
......@@ -1610,13 +1612,17 @@ void partitionAndRemesh(GFaceCompound *gf)
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++){
GEdge *gec = gf->model()->getEdgeByTag(nume + NE + i);
meshGEdge mge;
mge(gec);
}
double t2 = Cpu();
Msg::Info("*** Meshing 1D edges done (%gs)", t2-t1);
Msg::Info("*** Starting Mesh of surface %d ...", gf->tag());
......@@ -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("-----------------------------------------------------------");
gf->coherenceNormals();
......
......@@ -341,6 +341,7 @@ double qmTriangleAngles (MTriangle *e) {
rot[2][0]= 0; rot[2][1]=0; rot[2][2]=1;
double tmp[3][3];
double minAngle = 120.0;
for (int i = 0; i < e->getNumPrimaryVertices(); i++) {
const double u = i == 1 ? 1 : 0;
const double v = i == 2 ? 1 : 0;
......@@ -375,12 +376,18 @@ double qmTriangleAngles (MTriangle *e) {
double c;
prosca(v1,v2,&c);
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;
// printf("Quality %g\n",quality);
worst_quality = std::min(worst_quality, quality);
// minAngle = std::min(angle, minAngle);
// printf("Angle %g ", angle);
// printf("Quality %g\n",quality);
}
// printf("MinAngle %g ", minAngle);
// printf("\n");
// return minAngle;
return worst_quality;
}
......
......@@ -13,3 +13,12 @@ Line Loop(5) = {1, 2, 3, 4};
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