1
// $Id: gmshVertex.cpp,v 1.10 2008-03-20 11:44:07 geuzaine Exp $
3
// Copyright (C) 1997-2008 C. Geuzaine, J.-F. Remacle
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.
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.
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
20
// Please report all bugs and problems to <gmsh@geuz.org>.
2
24
#include "gmshVertex.h"
4
26
#include "GeoInterpolation.h"
5
27
#include "Message.h"
8
29
SPoint2 gmshVertex::reparamOnFace(GFace *face, int dir) const
10
Surface *s = (Surface*) face->getNativePtr();
13
return v -> pntOnGeometry;
15
if (s->Typ == MSH_SURF_REGL){
31
Surface *s = (Surface*)face->getNativePtr();
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);
41
return v->pntOnGeometry;
44
if(s->Typ == MSH_SURF_REGL){
17
46
for(int i = 0; i < 4; i++)
18
47
List_Read(s->Generatrices, i, &C[i]);
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)){
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)){
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)){
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)){
49
78
Msg(INFO, "Reparameterizing point %d on face %d", v->Num, s->Num);
50
79
return GVertex::reparamOnFace(face, dir);
55
return GVertex::reparamOnFace(face,dir);
84
return GVertex::reparamOnFace(face, dir);
59
88
GEntity::GeomType gmshVertex::geomType() const
61
if(v && v->Typ == MSH_POINT_BND_LAYER)
90
if(v->Typ == MSH_POINT_BND_LAYER)
62
91
return BoundaryLayerPoint;