Select Git revision
meshGRegionRelocateVertex.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Amaury Johnen authoredAmaury Johnen authored
meshGFaceOptimize.cpp 46.20 KiB
// Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file in the Gmsh root directory for license information.
// Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
#include <stack>
#include "GmshConfig.h"
#include "meshGFaceOptimize.h"
#include "qualityMeasures.h"
#include "GFace.h"
#include "GEdge.h"
#include "GVertex.h"
#include "GModel.h"
#include "MVertex.h"
#include "MTriangle.h"
#include "MQuadrangle.h"
#include "MLine.h"
#include "BackgroundMeshTools.h"
#include "Numeric.h"
#include "GmshMessage.h"
#include "Context.h"
#include "OS.h"
#include "SVector3.h"
#include "SPoint3.h"
#include "meshRelocateVertex.h"
#include "Field.h"
#if defined(HAVE_BLOSSOM)
extern "C" struct CCdatagroup;
extern "C" int perfect_match(int ncount, CCdatagroup *dat, int ecount,
int **elist, int **elen, char *blo_filename,
char *mat_filename, int just_fractional,
int no_fractional, int use_all_trees,
int partialprice, double *totalzeit);
#endif
RecombineTriangle::RecombineTriangle(const MEdge &me, MElement *_t1,
MElement *_t2, Field *cross_field)
: t1(_t1), t2(_t2)
{
n1 = me.getVertex(0);
n2 = me.getVertex(1);
n3 = 0;
n4 = 0;
if(t1->getVertex(0) != n1 && t1->getVertex(0) != n2)
n3 = t1->getVertex(0);
else if(t1->getVertex(1) != n1 && t1->getVertex(1) != n2)
n3 = t1->getVertex(1);
else if(t1->getVertex(2) != n1 && t1->getVertex(2) != n2)
n3 = t1->getVertex(2);
if(t2->getVertex(0) != n1 && t2->getVertex(0) != n2)
n4 = t2->getVertex(0);
else if(t2->getVertex(1) != n1 && t2->getVertex(1) != n2)
n4 = t2->getVertex(1);
else if(t2->getVertex(2) != n1 && t2->getVertex(2) != n2)
n4 = t2->getVertex(2);
if(!n3) {
Msg::Warning("Invalid quadrangle in recombination");
n3 = n1;
}
if(!n4) {
Msg::Warning("Invalid quadrangle in recombination");
n4 = n2;
}
MQuadrangle q(n1, n3, n2, n4);
angle = q.etaShapeMeasure();