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

make full-quad algo work for non-plane surfaces
parent 45f7941d
No related branches found
No related tags found
No related merge requests found
// $Id: Main.cpp,v 1.78 2005-05-21 04:55:59 geuzaine Exp $
// $Id: Main.cpp,v 1.79 2005-06-10 00:31:28 geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -67,14 +67,14 @@ int main(int argc, char *argv[])
strcat(cmdline, " ");
}
// Gmsh default options
Init_Options(0);
// Initialize the static Mesh
Init_Mesh0(&M);
// Gmsh default options
Init_Options(0);
// Generate automatic documentation (before getting user-defined options)
if(argc == 2 && !strcmp(argv[1], "-doc")){
......
// $Id: 2D_Recombine.cpp,v 1.24 2005-06-09 22:19:02 geuzaine Exp $
// $Id: 2D_Recombine.cpp,v 1.25 2005-06-10 00:31:28 geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -21,7 +21,9 @@
#include "Gmsh.h"
#include "Numeric.h"
#include "Geo.h"
#include "Mesh.h"
#include "Interpolation.h"
#include "Utils.h"
#include "2D_Mesh.h"
#include "Create.h"
......@@ -236,12 +238,25 @@ int Recombine_All (Mesh *THEM)
for(int j=0 ; j<List_Nbr(Triangles); j++){
Simplex *t;
List_Read(Triangles, j, &t);
Vertex *c = Create_Vertex(++THEM->MaxPointNum,
(t->V[0]->Pos.X+t->V[1]->Pos.X+t->V[2]->Pos.X)/3.,
(t->V[0]->Pos.Y+t->V[1]->Pos.Y+t->V[2]->Pos.Y)/3.,
(t->V[0]->Pos.Z+t->V[1]->Pos.Z+t->V[2]->Pos.Z)/3.,
(t->V[0]->lc+t->V[1]->lc+t->V[2]->lc)/3.,
(t->V[0]->u+t->V[1]->u+t->V[2]->u)/3.);
Vertex *c;
if(s->Typ == MSH_SURF_PLAN || s->Typ == MSH_SURF_DISCRETE){
c = Create_Vertex(++THEM->MaxPointNum,
(t->V[0]->Pos.X+t->V[1]->Pos.X+t->V[2]->Pos.X)/3.,
(t->V[0]->Pos.Y+t->V[1]->Pos.Y+t->V[2]->Pos.Y)/3.,
(t->V[0]->Pos.Z+t->V[1]->Pos.Z+t->V[2]->Pos.Z)/3.,
(t->V[0]->lc+t->V[1]->lc+t->V[2]->lc)/3.,
(t->V[0]->u+t->V[1]->u+t->V[2]->u)/3.);
}
else{
double U1, U2, U3, V1, V2, V3;
XYZtoUV(s, t->V[0]->Pos.X, t->V[0]->Pos.Y, t->V[0]->Pos.Z, &U1, &V1, 1.0);
XYZtoUV(s, t->V[1]->Pos.X, t->V[1]->Pos.Y, t->V[1]->Pos.Z, &U2, &V2, 1.0);
XYZtoUV(s, t->V[2]->Pos.X, t->V[2]->Pos.Y, t->V[2]->Pos.Z, &U3, &V3, 1.0);
double U = (U1 + U2 + U3)/.3;
double V = (V1 + V2 + V3)/3.;
Vertex v = InterpolateSurface(s, U, V, 0, 0);
c = Create_Vertex(++THEM->MaxPointNum, v.Pos.X, v.Pos.Y, v.Pos.Z, v.lc, v.u);
}
Tree_Add(THEM->Vertices, &c);
Quadrangle *q1 = Create_Quadrangle(t->V[0], t->VSUP[0], c, t->VSUP[2]);
Quadrangle *q2 = Create_Quadrangle(t->V[1], t->VSUP[1], c, t->VSUP[0]);
......
// $Id: Generator.cpp,v 1.68 2005-06-09 22:27:18 geuzaine Exp $
// $Id: Generator.cpp,v 1.69 2005-06-10 00:31:28 geuzaine Exp $
//
// Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
//
......@@ -310,6 +310,7 @@ void Maillage_Dimension_3(Mesh * M)
void Init_Mesh0(Mesh * M)
{
THEM = M;
M->bds = 0;
M->bds_mesh = 0;
M->Vertices = NULL;
......@@ -330,7 +331,6 @@ void Init_Mesh0(Mesh * M)
void Init_Mesh(Mesh * M)
{
THEM = M;
M->MaxPointNum = 0;
M->MaxLineNum = 0;
M->MaxLineLoopNum = 0;
......
# $Id: Makefile,v 1.86 2005-06-03 17:32:29 geuzaine Exp $
# $Id: Makefile,v 1.87 2005-06-10 00:31:28 geuzaine Exp $
#
# Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
#
......@@ -153,10 +153,10 @@ depend:
2D_Recombine.o: 2D_Recombine.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
../Numeric/Numeric.h Mesh.h Vertex.h Element.h Simplex.h Face.h Edge.h \
../Geo/ExtrudeParams.h ../Common/VertexArray.h \
../Common/SmoothNormals.h Metric.h Matrix.h Utils.h 2D_Mesh.h Create.h \
../Common/Context.h
../Numeric/Numeric.h ../Geo/Geo.h Mesh.h Vertex.h Element.h Simplex.h \
Face.h Edge.h ../Geo/ExtrudeParams.h ../Common/VertexArray.h \
../Common/SmoothNormals.h Metric.h Matrix.h Interpolation.h Utils.h \
2D_Mesh.h Create.h ../Common/Context.h
# 1 "/Users/geuzaine/.gmsh/Mesh//"
2D_InitMesh.o: 2D_InitMesh.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment