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

No commit message

No commit message
parent d549dbb6
Branches
Tags
No related merge requests found
......@@ -577,6 +577,7 @@ int GModel::adaptMesh(std::vector<int> technique, std::vector<simpleFunction<dou
nbElemsOld = nbElems;
}
}
//adapt only upper most dimension
else{
while(1) {
......@@ -608,9 +609,6 @@ int GModel::adaptMesh(std::vector<int> technique, std::vector<simpleFunction<dou
metric->addMetric(technique[imetric], f[imetric], parameters[imetric]);
}
fields->setBackgroundField(metric);
// int id = fields->newId();
// (*fields)[id] = new meshMetric(this, technique, f, parameters);
// fields->background_field = id;
if (getDim() == 2){
for (fiter fit = firstFace(); fit != lastFace(); ++fit){
......@@ -632,7 +630,7 @@ int GModel::adaptMesh(std::vector<int> technique, std::vector<simpleFunction<dou
nbElems = getNumMeshElements();
if (++ITER >= niter) break;
if (fabs((double)(nbElems - nbElemsOld)) < 0.01 * nbElemsOld) break;
if (ITER > 3 && fabs((double)(nbElems - nbElemsOld)) < 0.01 * nbElemsOld) break;
nbElemsOld = nbElems;
}
......
......@@ -396,6 +396,11 @@ bool reparamMeshVertexOnFace(MVertex *v, const GFace *gf, SPoint2 &param,
double t;
v->getParameter(0, t);
param = ge->reparamOnFace(gf, t, 1);
if(!v->getParameter(0,t)) {
Msg::Error("vertex v %p not MedgeVertex", v);
Msg::Exit(1);
//param = gf->parFromPoint(SPoint3(v->x(), v->y(), v->z()), onSurface);
}
// shout, we are on a seam
if(ge->isSeam(gf))
......@@ -404,7 +409,6 @@ bool reparamMeshVertexOnFace(MVertex *v, const GFace *gf, SPoint2 &param,
else{
double uu, vv;
if(v->onWhat() == gf && v->getParameter(0, uu) && v->getParameter(1, vv)){
//printf("%d face %d pos %g %g\n",v->getNum(),gf->tag(),uu,vv);
param = SPoint2(uu, vv);
}
else {
......
......@@ -72,11 +72,12 @@ static void computeMeshMetricsForBamg(GFace *gf, int numV,
void meshGFaceBamg(GFace *gf){
//Replace edges by their compounds
std::list<GEdge*> edges = gf->edges();
bool hasCompounds = false;
//Replace edges by their compounds
std::set<GEdge*> mySet;
std::list<GEdge*>::iterator it = edges.begin();
bool hasCompounds = false;
while(it != edges.end()){
if((*it)->getCompound()){
hasCompounds = true;
......@@ -120,6 +121,7 @@ void meshGFaceBamg(GFace *gf){
(*it)->setIndex(index++);
}
}
//exit(1);
int nbFixedVertices = index;
for(std::set<MVertex*>::iterator it = all.begin(); it!=all.end(); ++it){
//FIXME : SEAMS should have to be taken into account here !!!
......
......@@ -371,8 +371,8 @@ void meshMetric::computeMetric(){
//printf("%d elements are considered in the meshMetric \n",(int)_elements.size());
computeValues();
//computeHessian_FE();
computeHessian_LS();
computeHessian_FE();
//computeHessian_LS();
int metricNumber = setOfMetrics.size();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment