Skip to content
Snippets Groups Projects
Select Git revision
  • c58f01016f61df202691374069fbacef22c0d7a5
  • master default protected
  • steplayer
  • bl
  • pluginMeshQuality
  • fixBugsAmaury
  • hierarchical-basis
  • alphashapes
  • relaying
  • new_export_boris
  • oras_vs_osm
  • reassign_partitions
  • distributed_fwi
  • rename-classes
  • fix/fortran-api-example-t4
  • robust_partitions
  • reducing_files
  • fix_overlaps
  • 3115-issue-fix
  • 3023-Fillet2D-Update
  • convert_fdivs
  • gmsh_4_14_0
  • gmsh_4_13_1
  • gmsh_4_13_0
  • gmsh_4_12_2
  • gmsh_4_12_1
  • gmsh_4_12_0
  • gmsh_4_11_1
  • gmsh_4_11_0
  • gmsh_4_10_5
  • gmsh_4_10_4
  • gmsh_4_10_3
  • gmsh_4_10_2
  • gmsh_4_10_1
  • gmsh_4_10_0
  • gmsh_4_9_5
  • gmsh_4_9_4
  • gmsh_4_9_3
  • gmsh_4_9_2
  • gmsh_4_9_1
  • gmsh_4_9_0
41 results

pointInsertion.cpp

Blame
  • 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