Select Git revision
pointInsertion.cpp
-
Christophe Geuzaine authoredChristophe Geuzaine authored
pointInsertion.cpp 24.03 KiB
// Gmsh - Copyright (C) 1997-2018 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
//
// Contributed by Paul-Emile Bernard
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include "pointInsertion.h"
#include "BackgroundMeshManager.h"
#include "BackgroundMesh2D.h"
#include "BackgroundMesh3D.h"
#include "GFace.h"
#include "GRegion.h"
#include "OS.h"
#include "Context.h"
#include "meshGRegion.h"
#include "pointInsertionRTreeTools.h"
#include "intersectCurveSurface.h"
//#include "google/profiler.h"
using namespace std;
bool old_algo_hexa(){
return true;
}
template<typename T>
void print_nodal_info(string filename, map<MVertex*, T> &mapp)
{
ofstream out(filename.c_str());
out << "View \"\"{" << endl;
for (typename map<MVertex*, T>::iterator it = mapp.begin();it!=mapp.end();it++){
MVertex *v = it->first;
out << "SP( " << v->x() << "," << v->y() << "," << v->z() << "){" << it->second << "};" << endl;;
}
out << "};" << endl;
out.close();
}
bool shoot(const SPoint2 &start, const SPoint2 &dir,
const double &h, SPoint2 &res)
{
const int RK = 1;
if (RK==1){
res = start + (dir*h);
// cout << "(" << start[0] << "," <<start[1] << ") -> (" << res[0] << ","
// <<res[1] << ") " << endl;
return true;
}
return false;
}
bool computeFourNeighbors (frameFieldBackgroundMesh2D *bgm,
MVertex *v_center, // the vertex for which we want to
// generate 4 neighbors (real
// vertex (xyz), not parametric!)
SPoint2 &midpoint,
bool goNonLinear, // do we compute the position in
// the real surface which is
// nonlinear