~ubuntu-branches/ubuntu/karmic/gmsh/karmic

« back to all changes in this revision

Viewing changes to Geo/gmshVertex.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Christophe Prud'homme, Christophe Prud'homme, Daniel Leidert
  • Date: 2008-05-18 12:46:05 UTC
  • mfrom: (1.2.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20080518124605-716xqbqeo07o497k
Tags: 2.2.0-2
[Christophe Prud'homme]
* Bug fix: "gmsh ships no .desktop", thanks to Vassilis Pandis (Closes:
  #375770). Applied the Ubuntu patch.

[Daniel Leidert]
* debian/control (Vcs-Svn): Fixed.
  (Build-Depends): Use texlive instead of tetex-bin.
* debian/gmsh.doc-base (Section): Fixed accordingly to doc-base (>= 0.8.10).
* debian/rules: Removed some variable declarations, that lead to double
  configuration and seem to be useless.
  (build/gmsh): Try to avoid multiple runs by using a stamp.
  (orig-tarball): Renamed to get-orig-source and changed to use uscan.
* debian/watch: Added.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// $Id: gmshVertex.cpp,v 1.10 2008-03-20 11:44:07 geuzaine Exp $
 
2
//
 
3
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
 
4
//
 
5
// This program is free software; you can redistribute it and/or modify
 
6
// it under the terms of the GNU General Public License as published by
 
7
// the Free Software Foundation; either version 2 of the License, or
 
8
// (at your option) any later version.
 
9
//
 
10
// This program is distributed in the hope that it will be useful,
 
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
// GNU General Public License for more details.
 
14
//
 
15
// You should have received a copy of the GNU General Public License
 
16
// along with this program; if not, write to the Free Software
 
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 
18
// USA.
 
19
// 
 
20
// Please report all bugs and problems to <gmsh@geuz.org>.
 
21
 
1
22
#include "GFace.h"
 
23
#include "GEdge.h"
2
24
#include "gmshVertex.h"
3
25
#include "Geo.h"
4
26
#include "GeoInterpolation.h"
5
27
#include "Message.h"
6
 
#include "Context.h"
7
28
 
8
29
SPoint2 gmshVertex::reparamOnFace(GFace *face, int dir) const
9
30
{
10
 
  Surface *s = (Surface*) face->getNativePtr();
11
 
  if (s->geometry)
12
 
    {
13
 
      return v -> pntOnGeometry;
14
 
    }
15
 
  if (s->Typ ==  MSH_SURF_REGL){
 
31
  Surface *s = (Surface*)face->getNativePtr();
 
32
 
 
33
  if(s->geometry){
 
34
    // It is not always right if it is periodic.
 
35
    if(l_edges.size() == 1 && 
 
36
       (*l_edges.begin())->getBeginVertex() ==
 
37
       (*l_edges.begin())->getEndVertex()){
 
38
      Range<double> bb = (*l_edges.begin())->parBounds(0);
 
39
      return (*l_edges.begin())->reparamOnFace(face, bb.low(), dir);
 
40
    } 
 
41
    return v->pntOnGeometry;
 
42
  }
 
43
 
 
44
  if(s->Typ ==  MSH_SURF_REGL){
16
45
    Curve *C[4];
17
46
    for(int i = 0; i < 4; i++)
18
47
      List_Read(s->Generatrices, i, &C[i]);
19
48
 
20
49
    double U, V;    
21
50
    if ((C[0]->beg == v && C[3]->beg == v) ||
22
 
        (C[0]->end == v && C[3]->beg == v) ||
23
 
        (C[0]->beg == v && C[3]->end == v) ||
24
 
        (C[0]->end == v && C[3]->end == v)){
 
51
        (C[0]->end == v && C[3]->beg == v) ||
 
52
        (C[0]->beg == v && C[3]->end == v) ||
 
53
        (C[0]->end == v && C[3]->end == v)){
25
54
      U = V = 0;
26
55
    }
27
56
    else if ((C[0]->beg == v && C[1]->beg == v) ||
28
 
             (C[0]->end == v && C[1]->beg == v) ||
29
 
             (C[0]->beg == v && C[1]->end == v) ||
30
 
             (C[0]->end == v && C[1]->end == v)){
 
57
             (C[0]->end == v && C[1]->beg == v) ||
 
58
             (C[0]->beg == v && C[1]->end == v) ||
 
59
             (C[0]->end == v && C[1]->end == v)){
31
60
      U = 1;
32
61
      V = 0;
33
62
    }
34
63
    else if ((C[2]->beg == v && C[1]->beg == v) ||
35
 
             (C[2]->end == v && C[1]->beg == v) ||
36
 
             (C[2]->beg == v && C[1]->end == v) ||
37
 
             (C[2]->end == v && C[1]->end == v)){
 
64
             (C[2]->end == v && C[1]->beg == v) ||
 
65
             (C[2]->beg == v && C[1]->end == v) ||
 
66
             (C[2]->end == v && C[1]->end == v)){
38
67
      U = 1;
39
68
      V = 1;
40
69
    }
41
70
    else if ((C[2]->beg == v && C[3]->beg == v) ||
42
 
             (C[2]->end == v && C[3]->beg == v) ||
43
 
             (C[2]->beg == v && C[3]->end == v) ||
44
 
             (C[2]->end == v && C[3]->end == v)){
 
71
             (C[2]->end == v && C[3]->beg == v) ||
 
72
             (C[2]->beg == v && C[3]->end == v) ||
 
73
             (C[2]->end == v && C[3]->end == v)){
45
74
      U = 0;
46
75
      V = 1;
47
76
    }
49
78
      Msg(INFO, "Reparameterizing point %d on face %d", v->Num, s->Num);
50
79
      return GVertex::reparamOnFace(face, dir);
51
80
    }
52
 
    return SPoint2(U,V);
 
81
    return SPoint2(U, V);
53
82
  }
54
83
  else{
55
 
    return GVertex::reparamOnFace(face,dir);
 
84
    return GVertex::reparamOnFace(face, dir);
56
85
  }
57
86
}
58
87
 
59
88
GEntity::GeomType gmshVertex::geomType() const
60
89
{
61
 
  if(v && v->Typ == MSH_POINT_BND_LAYER)
 
90
  if(v->Typ == MSH_POINT_BND_LAYER)
62
91
    return BoundaryLayerPoint;
63
92
  else
64
93
    return Point;