Skip to content
Snippets Groups Projects
Select Git revision
1 result Searching

t6.geo

Blame
  • gmshVertex.cpp 3.77 KiB
    // Gmsh - Copyright (C) 1997-2014 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>.
    
    #include "GFace.h"
    #include "GEdge.h"
    #include "gmshVertex.h"
    #include "Geo.h"
    #include "GeoInterpolation.h"
    #include "GmshMessage.h"
    #include "MVertex.h"
    #include "MPoint.h"
    
    gmshVertex::gmshVertex(GModel *m, Vertex *_v)
      : GVertex(m, _v->Num, _v->lc), v(_v)
    {
    }
    
    void gmshVertex::resetMeshAttributes()
    {
      meshSize = v->lc;
    }
    
    void gmshVertex::setPosition(GPoint &p)
    {
      v->Pos.X = p.x();
      v->Pos.Y = p.y();
      v->Pos.Z = p.z();
      if(mesh_vertices.size()){
        mesh_vertices[0]->x() = p.x();
        mesh_vertices[0]->y() = p.y();
        mesh_vertices[0]->z() = p.z();
      }
    }
    
    GEntity::GeomType gmshVertex::geomType() const
    {
      if(v->Typ == MSH_POINT_BND_LAYER)
        return BoundaryLayerPoint;
      else
        return Point;
    }
    
    SPoint2 gmshVertex::reparamOnFace(const GFace *face, int dir) const
    {
    
      Surface *s = (Surface*)face->getNativePtr();
    
      if(s->geometry){
        // It is not always right if it is periodic.
        if(l_edges.size() == 1 &&
           (*l_edges.begin())->getBeginVertex() ==
           (*l_edges.begin())->getEndVertex()){
          Range<double> bb = (*l_edges.begin())->parBounds(0);
          return (*l_edges.begin())->reparamOnFace(face, bb.low(), dir);
        }
        return v->pntOnGeometry;
      }
    
      if(s->Typ ==  MSH_SURF_REGL){
        Curve *C[4];
        for(int i = 0; i < 4; i++)
          List_Read(s->Generatrices, i, &C[i]);
    
        double U, V;
        if ((C[0]->beg == v && C[3]->beg == v) ||
            (C[0]->end == v && C[3]->beg == v) ||
            (C[0]->beg == v && C[3]->end == v) ||
            (C[0]->end == v && C[3]->end == v)){