Select Git revision
Eigenvectors.cpp
-
Christophe Geuzaine authoredChristophe Geuzaine authored
meshGFace.cpp 62.13 KiB
// Gmsh - Copyright (C) 1997-2010 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include <sstream>
#include <stdlib.h>
#include <map>
#include "meshGFace.h"
#include "meshGFaceBDS.h"
#include "meshGFaceDelaunayInsertion.h"
#include "meshGFaceBamg.h"
#include "meshGFaceQuadrilateralize.h"
#include "meshGFaceOptimize.h"
#include "DivideAndConquer.h"
#include "BackgroundMesh.h"
#include "GVertex.h"
#include "GEdge.h"
#include "GEdgeCompound.h"
#include "GFace.h"
#include "GModel.h"
#include "MVertex.h"
#include "MLine.h"
#include "MTriangle.h"
#include "MQuadrangle.h"
#include "Context.h"
#include "GPoint.h"
#include "GmshMessage.h"
#include "Numeric.h"
#include "BDS.h"
#include "qualityMeasures.h"
#include "Field.h"
#include "OS.h"
#include "MElementOctree.h"
#include "HighOrder.h"
#include "meshGEdge.h"
#include "meshPartitionOptions.h"
#include "meshPartition.h"
#include "CreateFile.h"
#include "Context.h"
#include "multiscalePartition.h"
#include "meshGFaceLloyd.h"
static void copyMesh (GFace *source, GFace *target)
{
std::map<MVertex*,MVertex*> vs2vt;
std::list<GEdge*> edges = target->edges();
{
std::list<GEdge*>::iterator it = edges.begin();
for (; it!=edges.end(); ++it){
int sign = 1;
std::map<int,int>::iterator adnksd = target->edgeCounterparts.find((*it)->tag());
int source_e;
if ( adnksd != target->edgeCounterparts.end())
source_e= adnksd->second;
else{
sign = -1;
source_e = target->edgeCounterparts[-(*it)->tag()];
}
GEdge *se = source->model()->getEdgeByTag(abs(source_e));
GEdge *te = *it;
if (source_e * sign > 0){
vs2vt[se->getBeginVertex()->mesh_vertices[0]] = te->getBeginVertex()->mesh_vertices[0];
vs2vt[se->getEndVertex()->mesh_vertices[0]] = te->getEndVertex()->mesh_vertices[0];
for (unsigned i=0;i<se->mesh_vertices.size();i++){
MVertex *vs = se->mesh_vertices[i];
MVertex *vt = te->mesh_vertices[i];
vs2vt[vs] = vt;
}