Commit d38a637c by Larry Price

Add option logic, fix missing edges

parent b2b97675
......@@ -316,6 +316,8 @@ int GmshBatch()
AdaptMesh(GModel::current());
else if(CTX::instance()->batch == 5)
RefineMesh(GModel::current(), CTX::instance()->mesh.secondOrderLinear);
else if(CTX::instance()->batch == 6)
GModel::current()->classifyAllFaces();
#if defined(HAVE_CHACO) || defined(HAVE_METIS)
if(CTX::instance()->batchAfterMesh == 1){
if (CTX::instance()->partitionOptions.num_partitions > 1)
......
......@@ -20,9 +20,6 @@
#include "discreteEdge.h"
#include "discreteFace.h"
extern GEdge *getNewModelEdge(GFace *gf1, GFace *gf2,
std::map<std::pair<int, int>, GEdge*> &newEdges);
static void NoElementsSelectedMode(classificationEditor *e)
{
e->buttons[CLASS_BUTTON_SELECT_ELEMENTS]->activate();
......
......@@ -3815,11 +3815,39 @@ GEdge *getNewModelEdge(GFace *gf1, GFace *gf2,
void GModel::classifyAllFaces()
{
std::set<GFace*> faces;
std::vector<MElement*> elements;
for(GModel::fiter it = this->firstFace();
it != this->lastFace(); ++it) {
faces.insert(*it);
elements.insert(elements.end(), (*it)->triangles.begin(),
(*it)->triangles.end());
elements.insert(elements.end(), (*it)->quadrangles.begin(),
(*it)->quadrangles.end());
}
discreteEdge* edge = new discreteEdge
(GModel::current(), GModel::current()->getMaxElementaryNumber(1) + 1, 0, 0);
GModel::current()->add(edge);
e2t_cont adj;
buildEdgeToElements(elements, adj);
std::vector<edge_angle> edges_detected, edges_lonly;
buildListOfEdgeAngle(adj, edges_detected, edges_lonly);
for(unsigned int i = 0; i < edges_detected.size(); i++){
edge_angle ea = edges_detected[i];
if (ea.angle <= 0.698132) break;
edge->lines.push_back(new MLine(ea.v1, ea.v2));
}
this->classifyFaces(faces);
GModel::current()->remove(edge);
edge->lines.clear();
delete edge;
elements.clear();
edges_detected.clear();
edges_lonly.clear();
}
void recurClassifyEdges(MTri3 *t, std::map<MTriangle*, GFace*> &reverse,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment