Skip to content
Snippets Groups Projects
Commit 5ce74bd2 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix position of BoundaryLayerPoints
parent 69445ed5
No related branches found
No related tags found
No related merge requests found
......@@ -31,13 +31,17 @@ class GPoint
const GEntity *e;
double par[2];
public:
inline double x() const {return X;}
inline double y() const {return Y;}
inline double z() const {return Z;}
inline double u() const {return par[0];}
inline double v() const {return par[1];}
inline double x() const { return X; }
inline double y() const { return Y; }
inline double z() const { return Z; }
inline double &x() { return X; }
inline double &y() { return Y; }
inline double &z() { return Z; }
inline double u() const { return par[0]; }
inline double v() const { return par[1]; }
GPoint (double _x=0, double _y=0, double _z=0, const GEntity *onwhat=0)
: X(_x), Y(_y), Z(_z), e(onwhat){
: X(_x), Y(_y), Z(_z), e(onwhat)
{
}
GPoint (double _x, double _y, double _z, const GEntity *onwhat, double p)
: X(_x), Y(_y), Z(_z), e(onwhat)
......
// $Id: GVertex.cpp,v 1.12 2007-01-18 13:18:42 geuzaine Exp $
// $Id: GVertex.cpp,v 1.13 2007-09-03 12:00:28 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -19,9 +19,10 @@
//
// Please report all bugs and problems to <gmsh@geuz.org>.
#include <algorithm>
#include "GVertex.h"
#include "GFace.h"
#include <algorithm>
#include "Message.h"
GVertex::GVertex(GModel *m, int tag, double ms) : GEntity (m, tag), meshSize (ms)
{
......@@ -33,6 +34,11 @@ GVertex::~GVertex()
delete mesh_vertices[i];
}
void GVertex::setPosition(GPoint &p)
{
Msg(GERROR, "Cannot set position of this kind of vertex");
}
void GVertex::addEdge(GEdge *e)
{
l_edges.push_back(e);
......
......@@ -38,6 +38,7 @@ class GVertex : public GEntity
virtual double x() const = 0;
virtual double y() const = 0;
virtual double z() const = 0;
virtual void setPosition(GPoint &p);
void addEdge(GEdge *e);
void delEdge(GEdge *e);
virtual int dim() const {return 0;}
......
......@@ -59,6 +59,19 @@ class gmshVertex : public GVertex {
{
return v ? v->Pos.Z : mesh_vertices.size() ? mesh_vertices[0]->z() : 0.;
}
virtual void setPosition(GPoint &p)
{
if(v){
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();
}
}
virtual GeomType geomType() const;
ModelType getNativeType() const { return GmshModel; }
void * getNativePtr() const { return v; }
......
// $Id: BoundaryLayer.cpp,v 1.2 2007-03-05 09:30:53 geuzaine Exp $
// $Id: BoundaryLayer.cpp,v 1.3 2007-09-03 12:00:28 geuzaine Exp $
//
// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
//
......@@ -45,7 +45,7 @@ static void addExtrudeNormals(std::vector<T*> &elements)
}
}
}
int MeshBoundaryLayerFaces(GModel *m)
{
bool haveBoundaryLayers = false;
......@@ -107,14 +107,10 @@ int MeshBoundaryLayerFaces(GModel *m)
for(GModel::viter it = m->firstVertex(); it != m->lastVertex(); it++){
GVertex *gv = *it;
if(gv->geomType() == GEntity::BoundaryLayerPoint){
double x = gv->x();
double y = gv->y();
double z = gv->z();
GPoint p = gv->point();
myep->Extrude(myep->mesh.NbLayer - 1, myep->mesh.NbElmLayer[myep->mesh.NbLayer - 1],
x, y, z);
gv->mesh_vertices[0]->x() = x;
gv->mesh_vertices[0]->y() = y;
gv->mesh_vertices[0]->z() = z;
p.x(), p.y(), p.z());
gv->setPosition(p);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment