Skip to content
Snippets Groups Projects
Select Git revision
  • f2bd3813a20e91e3e1c1c26907e56f244cf2966b
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

Element.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    directions3D.cpp 47.17 KiB
    // Gmsh - Copyright (C) 1997-2013 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@geuz.org>.
    //
    // Contributor(s):
    //   Tristan Carrier François Henrotte
    
    #include <fstream>
    #include "GModel.h"
    #include "BackgroundMesh.h"
    #include "meshGFaceDelaunayInsertion.h"
    #include "MTetrahedron.h"
    #include "directions3D.h"
    
    #if defined(HAVE_PETSC)
    #include "dofManager.h"
    #include "laplaceTerm.h"
    #include "linearSystemPETSc.h"
    #include "linearSystemFull.h"
    #endif
    
    
    
    /****************class Frame_field****************/
    
    Frame_field::Frame_field(){}
    
    void Frame_field::init_region(GRegion* gr){
      // Fill in a ANN tree with the bondary cross field of region gr
    #if defined(HAVE_ANN)
      int index;
      MVertex* vertex;
      GFace* gf;
      std::list<GFace*> faces;
      STensor3 m(1.0);
    
      Nearest_point::init_region(gr);
    
      faces = gr->faces();
    
      temp.clear();
      field.clear();
    
      for( std::list<GFace*>::iterator it=faces.begin();it!=faces.end();it++){
        gf = *it;
        init_face(gf);
      }
    
      ANNpointArray duplicate = annAllocPts(temp.size(),3);
    
      index = 0;
      for(std::map<MVertex*,STensor3>::iterator it=temp.begin(); it != temp.end(); it++){
        vertex = it->first;
        m = it->second;
        duplicate[index][0] = vertex->x();
        duplicate[index][1] = vertex->y();
        duplicate[index][2] = vertex->z();
        field.push_back(std::pair<MVertex*,STensor3>(vertex,m));
        index++;
      }
    
      kd_tree = new ANNkd_tree(duplicate, temp.size(), 3);
    #endif
    }
    
    void Frame_field::init_face(GFace* gf){
      // Fills the auxiliary std::map "temp" with a pair <vertex, STensor3>
      // for each vertex of the face gf.
      unsigned int i;