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

make Export_LcField also work with SimplexBase
parent 00418abb
No related branches found
No related tags found
No related merge requests found
// $Id: 3D_BGMesh.cpp,v 1.31 2004-05-25 04:10:04 geuzaine Exp $ // $Id: 3D_BGMesh.cpp,v 1.32 2004-11-22 22:06:34 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -32,9 +32,8 @@ extern Context_T CTX; ...@@ -32,9 +32,8 @@ extern Context_T CTX;
void ExportLcFieldOnVolume(Mesh * M, char *filename) void ExportLcFieldOnVolume(Mesh * M, char *filename)
{ {
List_T *l = Tree2List(M->Volumes);
Volume *vol; Volume *vol;
Simplex *simp; SimplexBase *simp;
FILE *f = fopen(filename, "w"); FILE *f = fopen(filename, "w");
if(!f) { if(!f) {
...@@ -42,15 +41,19 @@ void ExportLcFieldOnVolume(Mesh * M, char *filename) ...@@ -42,15 +41,19 @@ void ExportLcFieldOnVolume(Mesh * M, char *filename)
return; return;
} }
List_T *l = Tree2List(M->Volumes);
fprintf(f, "View \"LC_FIELD\" {\n"); fprintf(f, "View \"LC_FIELD\" {\n");
for(int i = 0; i < List_Nbr(l); i++) { for(int i = 0; i < List_Nbr(l); i++) {
List_Read(l, i, &vol); List_Read(l, i, &vol);
List_T *ll = Tree2List(vol->Simplexes); List_T *ll;
for(int j = 0; j < List_Nbr(ll); j++) { for(int simtype = 0; simtype < 2; simtype++){
List_Read(ll, j, &simp); ll = (!simtype) ? Tree2List(vol->Simplexes) : Tree2List(vol->SimplexesBase);
simp->ExportLcField(f); for(int j = 0; j < List_Nbr(ll); j++) {
List_Read(ll, j, &simp);
simp->ExportLcField(f);
}
List_Delete(ll);
} }
List_Delete(ll);
} }
List_Delete(l); List_Delete(l);
fprintf(f, "};\n"); fprintf(f, "};\n");
...@@ -59,9 +62,8 @@ void ExportLcFieldOnVolume(Mesh * M, char *filename) ...@@ -59,9 +62,8 @@ void ExportLcFieldOnVolume(Mesh * M, char *filename)
void ExportLcFieldOnSurfaces(Mesh * M, char *filename) void ExportLcFieldOnSurfaces(Mesh * M, char *filename)
{ {
List_T *l = Tree2List(M->Surfaces);
Surface *surf; Surface *surf;
Simplex *simp; SimplexBase *simp;
FILE *f = fopen(filename, "w"); FILE *f = fopen(filename, "w");
if(!f) { if(!f) {
...@@ -69,15 +71,19 @@ void ExportLcFieldOnSurfaces(Mesh * M, char *filename) ...@@ -69,15 +71,19 @@ void ExportLcFieldOnSurfaces(Mesh * M, char *filename)
return; return;
} }
List_T *l = Tree2List(M->Surfaces);
fprintf(f, "View \"LC_FIELD\" {\n"); fprintf(f, "View \"LC_FIELD\" {\n");
for(int i = 0; i < List_Nbr(l); i++) { for(int i = 0; i < List_Nbr(l); i++) {
List_Read(l, i, &surf); List_Read(l, i, &surf);
List_T *ll = Tree2List(surf->Simplexes); List_T *ll;
for(int j = 0; j < List_Nbr(ll); j++) { for(int simtype = 0; simtype < 2; simtype++){
List_Read(ll, j, &simp); ll = (!simtype) ? Tree2List(surf->Simplexes) : Tree2List(surf->SimplexesBase);
simp->ExportLcField(f); for(int j = 0; j < List_Nbr(ll); j++) {
List_Read(ll, j, &simp);
simp->ExportLcField(f);
}
List_Delete(ll);
} }
List_Delete(ll);
} }
List_Delete(l); List_Delete(l);
fprintf(f, "};\n"); fprintf(f, "};\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment