From 8fb6e65e3ef82e65e2a51af0e432f5a39e1baab8 Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Wed, 1 Aug 2001 16:37:15 +0000 Subject: [PATCH] Dirty flag to prevent meshing of incomplete geometrical entities (e.g. created by Read_Mesh) --- Mesh/1D_Mesh.cpp | 7 ++++++- Mesh/2D_Mesh.cpp | 7 ++++++- Mesh/3D_Mesh.cpp | 7 ++++++- Mesh/Create.cpp | 5 ++++- Mesh/Mesh.h | 3 +++ Mesh/Read_Mesh.cpp | 5 ++++- 6 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Mesh/1D_Mesh.cpp b/Mesh/1D_Mesh.cpp index bbc6e5a470..ecfce07e0e 100644 --- a/Mesh/1D_Mesh.cpp +++ b/Mesh/1D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 1D_Mesh.cpp,v 1.16 2001-05-29 13:26:54 geuzaine Exp $ +// $Id: 1D_Mesh.cpp,v 1.17 2001-08-01 16:37:15 geuzaine Exp $ #include "Gmsh.h" #include "Const.h" @@ -115,6 +115,11 @@ void Maillage_Curve (void *data, void *dummy){ if (c->Num < 0) return; + if(c->Dirty){ + Msg(INFO, "Not meshing dirty Curve %d", c->Num); + return; + } + Msg(STATUS3, "Meshing Curve %d", c->Num); Points = List_Create (10, 10, sizeof (IntPoint)); diff --git a/Mesh/2D_Mesh.cpp b/Mesh/2D_Mesh.cpp index 3b9d9655a9..4fcd6452e6 100644 --- a/Mesh/2D_Mesh.cpp +++ b/Mesh/2D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 2D_Mesh.cpp,v 1.30 2001-07-26 21:26:34 geuzaine Exp $ +// $Id: 2D_Mesh.cpp,v 1.31 2001-08-01 16:37:15 geuzaine Exp $ /* Maillage Delaunay d'une surface (Point insertion Technique) @@ -862,6 +862,11 @@ void Maillage_Surface (void *data, void *dum){ if (!s->Support) return; + if(s->Dirty){ + Msg(INFO, "Not meshing dirty Surface %d", s->Num); + return; + } + THESUPPORT = s->Support; THESURFACE = s; diff --git a/Mesh/3D_Mesh.cpp b/Mesh/3D_Mesh.cpp index 6874a0d620..232b52e8f1 100644 --- a/Mesh/3D_Mesh.cpp +++ b/Mesh/3D_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: 3D_Mesh.cpp,v 1.22 2001-06-25 15:24:12 remacle Exp $ +// $Id: 3D_Mesh.cpp,v 1.23 2001-08-01 16:37:15 geuzaine Exp $ /* @@ -725,6 +725,11 @@ void Maillage_Volume (void *data, void *dum){ pv = (Volume **) data; v = *pv; + if(v->Dirty){ + Msg(INFO, "Not meshing dirty Volume %d", v->Num); + return; + } + if (Extrude_Mesh (v)){ } diff --git a/Mesh/Create.cpp b/Mesh/Create.cpp index ac64a9cfc8..25293b2f3f 100644 --- a/Mesh/Create.cpp +++ b/Mesh/Create.cpp @@ -1,4 +1,4 @@ -// $Id: Create.cpp,v 1.21 2001-06-25 13:05:16 geuzaine Exp $ +// $Id: Create.cpp,v 1.22 2001-08-01 16:37:15 geuzaine Exp $ #include "Gmsh.h" #include "Const.h" @@ -423,6 +423,7 @@ Curve *Create_Curve (int Num, int Typ, int Order, List_T * Liste, {1, 0, 0, 0.0} }; pC = (Curve *) Malloc (sizeof (Curve)); + pC->Dirty = 0; pC->cp = NULL; pC->Vertices = NULL; pC->Extrude = NULL; @@ -534,6 +535,7 @@ Surface * Create_Surface (int Num, int Typ, int Mat){ Surface *pS; pS = (Surface *) Malloc (sizeof (Surface)); + pS->Dirty = 0; pS->Num = Num; pS->Typ = Typ; pS->Mat = Mat; @@ -581,6 +583,7 @@ Volume * Create_Volume (int Num, int Typ, int Mat){ Volume *pV; pV = (Volume *) Malloc (sizeof (Volume)); + pV->Dirty = 0; pV->Num = Num; pV->Typ = Typ; pV->Mat = Mat; diff --git a/Mesh/Mesh.h b/Mesh/Mesh.h index 153f9d6a4b..064c0af778 100644 --- a/Mesh/Mesh.h +++ b/Mesh/Mesh.h @@ -224,6 +224,7 @@ struct _Surf{ Grid_T Grid; /* Grille de recherches rapides */ ExtrudeParams *Extrude; STL_Data *STL; + int Dirty; //flag to prevent any meshing }; typedef struct _Surf Surface; @@ -265,6 +266,7 @@ typedef struct { Tree_T *Simp_Surf;//for old extrusion mesh generator Tree_T *Hexahedra; Tree_T *Prisms; + int Dirty; //flag to prevent any meshing }Volume; typedef struct { @@ -327,6 +329,7 @@ typedef struct{ int degre; CircParam Circle; char functu[256], functv[256], functw[256]; + int Dirty; //flag to prevent any meshing }Curve; typedef struct{ diff --git a/Mesh/Read_Mesh.cpp b/Mesh/Read_Mesh.cpp index e245d4d0f2..b7f23f726c 100644 --- a/Mesh/Read_Mesh.cpp +++ b/Mesh/Read_Mesh.cpp @@ -1,4 +1,4 @@ -// $Id: Read_Mesh.cpp,v 1.17 2001-06-25 13:30:57 remacle Exp $ +// $Id: Read_Mesh.cpp,v 1.18 2001-08-01 16:37:15 geuzaine Exp $ #include "Gmsh.h" #include "Geo.h" @@ -107,6 +107,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){ if(!(cc = (Curve**)Tree_PQuery(M->Curves, &c))){ c = Create_Curve(Elementary, MSH_SEGM_LINE, 0, NULL, NULL, -1, -1, 0., 1.); + c->Dirty=1; Tree_Add(M->Curves, &c); } else @@ -116,6 +117,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){ s = &S; s->Num = Elementary; if(!(ss = (Surface**)Tree_PQuery(M->Surfaces, &s))){ s = Create_Surface(Elementary, MSH_SURF_PLAN, Elementary); + s->Dirty=1; Tree_Add(M->Surfaces, &s); } else @@ -125,6 +127,7 @@ void Read_Mesh_MSH (Mesh *M, FILE *File_GEO){ v = &V; v->Num = Elementary; if(!(vv = (Volume**)Tree_PQuery(M->Volumes, &v))){ v = Create_Volume(Elementary, MSH_VOLUME, Elementary); + v->Dirty=1; Tree_Add(M->Volumes, &v); } else -- GitLab