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

Store the surface orientations (from surface loops) in the volume: we need
this for Netgen.
parent a1e7b561
No related branches found
No related tags found
No related merge requests found
// $Id: GeoUtils.cpp,v 1.1 2004-02-28 00:48:49 geuzaine Exp $ // $Id: GeoUtils.cpp,v 1.2 2004-06-26 05:07:47 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -115,14 +115,14 @@ void setSurfaceGeneratrices(Surface *s, List_T *loops) ...@@ -115,14 +115,14 @@ void setSurfaceGeneratrices(Surface *s, List_T *loops)
void setVolumeSurfaces(Volume *v, List_T * loops) void setVolumeSurfaces(Volume *v, List_T * loops)
{ {
v->Surfaces = List_Create(4, 1, sizeof(Surface *)); List_Reset(v->Surfaces);
List_Reset(v->SurfacesOrientations);
for(int i = 0; i < List_Nbr(loops); i++) { for(int i = 0; i < List_Nbr(loops); i++) {
int il; int il;
List_Read(loops, i, &il); List_Read(loops, i, &il);
SurfaceLoop *sl; SurfaceLoop *sl;
if(!(sl = FindSurfaceLoop(il, THEM))) { if(!(sl = FindSurfaceLoop(il, THEM))) {
Msg(GERROR, "Unknown Surface Loop %d", il); Msg(GERROR, "Unknown Surface Loop %d", il);
List_Delete(v->Surfaces);
return; return;
} }
else { else {
...@@ -130,13 +130,19 @@ void setVolumeSurfaces(Volume *v, List_T * loops) ...@@ -130,13 +130,19 @@ void setVolumeSurfaces(Volume *v, List_T * loops)
int is; int is;
List_Read(sl->Surfaces, j, &is); List_Read(sl->Surfaces, j, &is);
Surface *s; Surface *s;
// FIXME: this is a little bit tricky: contrary to curves in
// edge loops, we don't actually create "negative"
// surfaces. So we just store the signs in another list
// (beeerk...)
if(!(s = FindSurface(abs(is), THEM))) { if(!(s = FindSurface(abs(is), THEM))) {
Msg(GERROR, "Unknown Surface %d", is); Msg(GERROR, "Unknown Surface %d", is);
List_Delete(v->Surfaces);
return; return;
} }
else else{
List_Add(v->Surfaces, &s); List_Add(v->Surfaces, &s);
int tmp = (s->Num > 0) ? 1 : -1;
List_Add(v->SurfacesOrientations, &tmp);
}
} }
} }
} }
......
// $Id: Create.cpp,v 1.59 2004-06-23 22:23:42 geuzaine Exp $ // $Id: Create.cpp,v 1.60 2004-06-26 05:07:47 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -719,6 +719,7 @@ Volume *Create_Volume(int Num, int Typ) ...@@ -719,6 +719,7 @@ Volume *Create_Volume(int Num, int Typ)
pV->ipar[i] = 0; pV->ipar[i] = 0;
pV->TrsfPoints = List_Create(6, 6, sizeof(Vertex *)); pV->TrsfPoints = List_Create(6, 6, sizeof(Vertex *));
pV->Surfaces = List_Create(1, 2, sizeof(Surface *)); pV->Surfaces = List_Create(1, 2, sizeof(Surface *));
pV->SurfacesOrientations = List_Create(1, 2, sizeof(int));
pV->Simplexes = Tree_Create(sizeof(Simplex *), compareQuality); pV->Simplexes = Tree_Create(sizeof(Simplex *), compareQuality);
pV->Vertices = Tree_Create(sizeof(Vertex *), compareVertex); pV->Vertices = Tree_Create(sizeof(Vertex *), compareVertex);
pV->Hexahedra = Tree_Create(sizeof(Hexahedron *), compareHexahedron); pV->Hexahedra = Tree_Create(sizeof(Hexahedron *), compareHexahedron);
...@@ -739,6 +740,7 @@ void Free_Volume(void *a, void *b) ...@@ -739,6 +740,7 @@ void Free_Volume(void *a, void *b)
if(pV) { if(pV) {
List_Delete(pV->TrsfPoints); List_Delete(pV->TrsfPoints);
List_Delete(pV->Surfaces); // surfaces freed elsewhere List_Delete(pV->Surfaces); // surfaces freed elsewhere
List_Delete(pV->SurfacesOrientations);
Tree_Action(pV->Simplexes, Free_Simplex); Tree_Action(pV->Simplexes, Free_Simplex);
Tree_Delete(pV->Simplexes); Tree_Delete(pV->Simplexes);
Tree_Delete(pV->Simp_Surf); // for old extrusion mesh generator Tree_Delete(pV->Simp_Surf); // for old extrusion mesh generator
......
...@@ -301,6 +301,7 @@ typedef struct { ...@@ -301,6 +301,7 @@ typedef struct {
ExtrudeParams *Extrude; ExtrudeParams *Extrude;
List_T *TrsfPoints; List_T *TrsfPoints;
List_T *Surfaces; List_T *Surfaces;
List_T *SurfacesOrientations;
Tree_T *Vertices; Tree_T *Vertices;
Tree_T *Edges; Tree_T *Edges;
Tree_T *Faces; Tree_T *Faces;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment