Skip to content
Snippets Groups Projects
Select Git revision
  • 03ba48aa4f7a7e39baac9e542b39a0927dd62a6a
  • master default protected
  • alphashapes
  • quadMeshingTools
  • cygwin_conv_path
  • macos_arm64
  • add-transfiniteautomatic-to-geo
  • patch_releases_4_10
  • HierarchicalHDiv
  • isuruf-master-patch-63355
  • hyperbolic
  • hexdom
  • hxt_update
  • jf
  • 1618-pythonocc-and-gmsh-api-integration
  • octreeSizeField
  • hexbl
  • alignIrregularVertices
  • getEdges
  • patch_releases_4_8
  • isuruf-master-patch-51992
  • 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
  • gmsh_4_8_4
  • gmsh_4_8_3
  • gmsh_4_8_2
  • gmsh_4_8_1
  • gmsh_4_8_0
  • gmsh_4_7_1
  • gmsh_4_7_0
41 results

linearSystemPETSc.h

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    GRbf.cpp 40.84 KiB
    // Gmsh - Copyright (C) 1997-2016 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 Cecile Piret
    
    #include <math.h>
    #include <vector>
    #include "GmshConfig.h"
    #include "GRbf.h"
    #include "OS.h"
    #include "fullMatrix.h"
    #include "Octree.h"
    #include "SPoint3.h"
    #include "SVector3.h"
    #include "SBoundingBox3d.h"
    #include "OS.h"
    #include "MVertex.h"
    #include "MVertexRTree.h"
    
    #if defined(HAVE_SOLVER)
    #include "linearSystem.h"
    #endif
    
    #if defined(HAVE_ANN)
    #include "ANN/ANN.h"
    #endif
    
    static void SphereBB(void *a, double*mmin, double*mmax)
    {
      Sphere *t = (Sphere *)a;
      mmin[0] = t->center.x()-t->radius;
      mmin[1] = t->center.y()-t->radius;
      mmin[2] = t->center.z()-t->radius;
      mmax[0] = t->center.x()+t->radius;
      mmax[1] = t->center.y()+t->radius;
      mmax[2] = t->center.z()+t->radius;
    }
    
    static void SphereCentroid(void *a, double*c)
    {
      Sphere *t = (Sphere *)a;
      c[0] = t->center.x();
      c[1] = t->center.y();
      c[2] = t->center.z();
    }
    
    static int SphereInEle(void *a, double*c)
    {
      Sphere *t = (Sphere *)a;
      double dist = sqrt((c[0]-t->center.x())*(c[0]-t->center.x())+
    		     (c[1]-t->center.y())*(c[1]-t->center.y())+
    		     (c[2]-t->center.z())*(c[2]-t->center.z()) );
      if(dist < t->radius){
        return 1;
      }
      return 0;
    }
    
    static void printNodes(std::set<MVertex *> myNodes)
    {
      FILE * xyz = Fopen("myNodes.pos","w");
      if(xyz){
        fprintf(xyz,"View \"\"{\n");
        for(std::set<MVertex *>::iterator itv = myNodes.begin(); itv !=myNodes.end(); ++itv){
          MVertex *v = *itv;
          fprintf(xyz,"SP(%g,%g,%g){%d};\n", v->x(), v->y(), v->z(), v->getNum());
        }
        fprintf(xyz,"};\n");