diff --git a/Graphics/Makefile b/Graphics/Makefile index 63827eef9ba66a8f989a7662faade7a129007536..92e8e1d3606eb985e9d86e47962d14658fd0ced2 100644 --- a/Graphics/Makefile +++ b/Graphics/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.42 2003-02-11 08:54:56 geuzaine Exp $ +# $Id: Makefile,v 1.43 2003-02-12 09:20:41 remacle Exp $ include ../variables @@ -14,6 +14,7 @@ SRC = Draw.cpp \ PostElement.cpp \ Iso.cpp \ Entity.cpp \ + ReadImg.cpp \ Visibility.cpp \ Scale.cpp \ Graph2D.cpp \ diff --git a/Mesh/2D_Mesh_Aniso.cpp b/Mesh/2D_Mesh_Aniso.cpp index 28dbf78949795aa3dd3c9bd942dab934a3c8bea2..4487040ac90d1d76e99c851b2bc5fff688454f65 100644 --- a/Mesh/2D_Mesh_Aniso.cpp +++ b/Mesh/2D_Mesh_Aniso.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh_Aniso.cpp,v 1.30 2003-01-23 20:19:21 geuzaine Exp $ +// $Id: 2D_Mesh_Aniso.cpp,v 1.31 2003-02-12 09:20:41 remacle Exp $ // // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // @@ -69,10 +69,17 @@ static int ZONEELIMINEE, Methode = 0; static double volume; static List_T *coquille; static Edge *THEEDGE; - +extern void LCBGM (double X, double Y, double Z, double *l); double Interpole_lcTriangle (Simplex * s, Vertex * vv){ double Xp, Yp, X[3], Y[3], det, u, v, q1, q2, q3; + if (THEM->BGM.Typ == ONFILE) + { + double LL; + LCBGM (vv->Pos.X,vv->Pos.Y,0.0,&LL); + return LL * CTX.mesh.lc_factor; + } + Xp = vv->Pos.X; Yp = vv->Pos.Y; diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 268c600b3ec0d01f4661d52cba05b78c6ba78e98..7545871b72663db8261ae77be2445e3c184ab934 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh.cpp,v 1.45 2003-01-23 20:19:22 geuzaine Exp $ +// $Id: 3D_Mesh.cpp,v 1.46 2003-02-12 09:20:41 remacle Exp $ // // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // @@ -48,7 +48,7 @@ extern int FACE_DIMENSION; static Tree_T *Tsd, *Sim_Sur_Le_Bord, *POINTS_TREE; static List_T *Simplexes_Destroyed, *Simplexes_New, *Suppress; -static List_T *LLL, *POINTS; +static List_T *LLL, *POINTS_LIST; static Simplex *THES; static Vertex *THEV; static Tree_T *SimXFac; @@ -125,7 +125,7 @@ void add_points (void *a, void *b){ } void add_points_2 (void *a, void *b){ - List_Add (POINTS, a); + List_Add (POINTS_LIST, a); } @@ -769,7 +769,7 @@ void Convex_Hull_Mesh (List_T * Points, Mesh * m){ THEV->Pos.Z -= dz; if(count > 5){ N++; - List_Add(POINTS,&THEV); + List_Add(POINTS_LIST,&THEV); Msg(WARNING, "Unable to add point %d (will try it later)", THEV->Num); break; } @@ -865,7 +865,7 @@ void Maillage_Volume (void *data, void *dum){ s = &S; POINTS_TREE = Tree_Create (sizeof (Vertex *), comparePosition); - POINTS = List_Create (100, 100, sizeof (Vertex *)); + POINTS_LIST = List_Create (100, 100, sizeof (Vertex *)); LOCAL->Simplexes = v->Simplexes; LOCAL->Vertices = v->Vertices; @@ -876,7 +876,7 @@ void Maillage_Volume (void *data, void *dum){ Tree_Action (POINTS_TREE, add_points_2); Tree_Delete (POINTS_TREE); - N = List_Nbr (POINTS); + N = List_Nbr (POINTS_LIST); n = N / 30 + 1; if(!N) return; @@ -885,7 +885,7 @@ void Maillage_Volume (void *data, void *dum){ Msg(STATUS2, "Mesh 3D... (initial)"); - Convex_Hull_Mesh (POINTS, LOCAL); + Convex_Hull_Mesh (POINTS_LIST, LOCAL); if(!Coherence (v, LOCAL)) Msg(GERROR, "Surface recovery failed (send a bug report with the geo file to <gmsh@geuz.org>!)"); diff --git a/Parser/OpenFile.cpp b/Parser/OpenFile.cpp index 007151c1b4aaac0c44588783fae1fdbed6da7bbf..597ea5d591bd1f9f884c75f47f0f6b437139414b 100644 --- a/Parser/OpenFile.cpp +++ b/Parser/OpenFile.cpp @@ -1,4 +1,4 @@ -// $Id: OpenFile.cpp,v 1.37 2003-02-11 09:18:48 geuzaine Exp $ +// $Id: OpenFile.cpp,v 1.38 2003-02-12 09:20:41 remacle Exp $ // // Copyright (C) 1997 - 2003 C. Geuzaine, J.-F. Remacle // @@ -30,6 +30,7 @@ #include "Views.h" #include "MinMax.h" #include "Visibility.h" +#include "ReadImg.h" #ifndef _BLACKBOX #include "GmshUI.h" @@ -105,8 +106,24 @@ void ParseString(char *str){ } } -void MergeProblem(char *name){ - ParseFile(name,0); + +int MergeProblem(char *name){ + + char ext[5]; + + strncpy (ext,&name[strlen(name)-4],5); + /// a jpg file is used as an inpu, we transform it onto + /// a post pro file that could be used as a background mesh + + if(!strcmp(ext,".ppm") ||!strcmp(ext,".pnm")) + { + read_pnm (name); + return 1; + } + else + { + return ParseFile(name,0); + } } void MergeProblemWithBoundingBox(char *name){ @@ -146,6 +163,7 @@ void OpenProblem(char *name){ !strcmp(ext,".msh") || !strcmp(ext,".MSH") || !strcmp(ext,".stl") || !strcmp(ext,".STL") || !strcmp(ext,".sms") || !strcmp(ext,".SMS") || + !strcmp(ext,".ppm") || !strcmp(ext,".pnm") || !strcmp(ext,".pos") || !strcmp(ext,".POS")){ CTX.base_filename[strlen(name)-4] = '\0'; } @@ -161,7 +179,8 @@ void OpenProblem(char *name){ int nb = List_Nbr(CTX.post.list); - int status = ParseFile(CTX.filename,0); + int status = MergeProblem(CTX.filename); + //ParseFile(CTX.filename,0); ApplyLcFactor(THEM); diff --git a/Parser/OpenFile.h b/Parser/OpenFile.h index 602e471c72a86f38a983d1c2431dcbe78a58710c..f076bbb5f819ac4cc575df064705f67cd20fd1ad 100644 --- a/Parser/OpenFile.h +++ b/Parser/OpenFile.h @@ -25,7 +25,7 @@ int ParseFile(char *filename, int silent); void ParseString(char *str); void OpenProblem(char *filename); -void MergeProblem(char *filename); +int MergeProblem(char *filename); void MergeProblemWithBoundingBox(char *filename); void SystemCall(char *command); diff --git a/benchmarks/2d/Square-01.geo b/benchmarks/2d/Square-01.geo index 4f234fc01ac972173fc7c9de2e23a2e7923c3d25..9d918797878428a9a137316920394b82827548a1 100644 --- a/benchmarks/2d/Square-01.geo +++ b/benchmarks/2d/Square-01.geo @@ -12,5 +12,5 @@ Line(3) = {1,4}; Line(4) = {4,3}; Line Loop(5) = {1,2,3,4}; Plane Surface(6) = {5}; -Attractor Point{2} = {0.05,0.05,2}; -Mesh.Algorithm = 2; +//Attractor Point{2} = {0.05,0.05,2}; +//Mesh.Algorithm = 2; diff --git a/benchmarks/2d/Square-02.geo b/benchmarks/2d/Square-02.geo index d1b5976cd62d242edd90ac51429d77eaa67ebda9..f781bd1dba09cdf7c8da3e94322b901a4a46667d 100644 --- a/benchmarks/2d/Square-02.geo +++ b/benchmarks/2d/Square-02.geo @@ -3,7 +3,7 @@ Square non uniformly meshed ******************************/ lc = .1; -Point(1) = {0.0,0.0,0,lc*.1}; +Point(1) = {0.0,0.0,0,lc*.01}; Point(2) = {1,0.0,0,lc}; Point(3) = {1,1,0,lc}; Point(4) = {0,1,0,lc};