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

fix exportLcField for lines and quads
parent c24717fe
No related branches found
No related tags found
No related merge requests found
// $Id: 3D_BGMesh.cpp,v 1.29 2004-05-08 00:19:47 geuzaine Exp $ // $Id: 3D_BGMesh.cpp,v 1.30 2004-05-13 00:50:40 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -48,7 +48,7 @@ void ExportLcFieldOnVolume(Mesh * M, char *filename) ...@@ -48,7 +48,7 @@ void ExportLcFieldOnVolume(Mesh * M, char *filename)
List_T *ll = Tree2List(vol->Simplexes); List_T *ll = Tree2List(vol->Simplexes);
for(int j = 0; j < List_Nbr(ll); j++) { for(int j = 0; j < List_Nbr(ll); j++) {
List_Read(ll, j, &simp); List_Read(ll, j, &simp);
simp->ExportLcField(f); simp->ExportLcField(f, 3);
} }
List_Delete(ll); List_Delete(ll);
} }
...@@ -75,7 +75,7 @@ void ExportLcFieldOnSurfaces(Mesh * M, char *filename) ...@@ -75,7 +75,7 @@ void ExportLcFieldOnSurfaces(Mesh * M, char *filename)
List_T *ll = Tree2List(surf->Simplexes); List_T *ll = Tree2List(surf->Simplexes);
for(int j = 0; j < List_Nbr(ll); j++) { for(int j = 0; j < List_Nbr(ll); j++) {
List_Read(ll, j, &simp); List_Read(ll, j, &simp);
simp->ExportLcField(f); simp->ExportLcField(f, 2);
} }
List_Delete(ll); List_Delete(ll);
} }
......
// $Id: Simplex.cpp,v 1.30 2004-05-07 21:13:34 geuzaine Exp $ // $Id: Simplex.cpp,v 1.31 2004-05-13 00:50:40 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -589,24 +589,26 @@ int Simplex::Pt_In_Simplex_2D(Vertex * v) ...@@ -589,24 +589,26 @@ int Simplex::Pt_In_Simplex_2D(Vertex * v)
return 1; return 1;
} }
void Simplex::ExportLcField(FILE * f) void Simplex::ExportLcField(FILE * f, int dim)
{ {
if(!V[3]) { if(!V[2])
fprintf(f, "SL(%f,%f,%f,%f,%f,%f){%12.5E,%12.5E};\n",
V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y,
V[1]->Pos.Z, V[0]->lc, V[1]->lc);
else if(!V[3])
fprintf(f, "ST(%f,%f,%f,%f,%f,%f,%f,%f,%f){%12.5E,%12.5E,%12.5E};\n", fprintf(f, "ST(%f,%f,%f,%f,%f,%f,%f,%f,%f){%12.5E,%12.5E,%12.5E};\n",
V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y,
V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[0]->lc, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[0]->lc,
V[1]->lc, V[2]->lc); V[1]->lc, V[2]->lc);
} else
else {
fprintf(f, fprintf(f,
"SS(%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f){%12.5E,%12.5E,%12.5E,%12.5E};\n", "%s(%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f){%12.5E,%12.5E,%12.5E,%12.5E};\n",
(dim == 3) ? "SS" : "SQ",
V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y, V[0]->Pos.X, V[0]->Pos.Y, V[0]->Pos.Z, V[1]->Pos.X, V[1]->Pos.Y,
V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X, V[1]->Pos.Z, V[2]->Pos.X, V[2]->Pos.Y, V[2]->Pos.Z, V[3]->Pos.X,
V[3]->Pos.Y, V[3]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc); V[3]->Pos.Y, V[3]->Pos.Z, V[0]->lc, V[1]->lc, V[2]->lc, V[3]->lc);
} }
}
double Simplex::AireFace(Vertex * V[3]) double Simplex::AireFace(Vertex * V[3])
{ {
double a[3], b[3], c[3]; double a[3], b[3], c[3];
......
...@@ -60,7 +60,7 @@ class Simplex : public Element { ...@@ -60,7 +60,7 @@ class Simplex : public Element {
bool SwapEdge (int iFac); bool SwapEdge (int iFac);
bool SwapFace (int iFac, List_T *newsimp, List_T *delsimp); bool SwapFace (int iFac, List_T *newsimp, List_T *delsimp);
bool ExtractOppositeEdges ( int iFac, Vertex *p[2], Vertex *q[2]); bool ExtractOppositeEdges ( int iFac, Vertex *p[2], Vertex *q[2]);
void ExportLcField (FILE *f); void ExportLcField (FILE *f, int dim=3);
void Center_Ellipsum_3D (double m[3][3]); void Center_Ellipsum_3D (double m[3][3]);
double GammaShapeMeasure (); double GammaShapeMeasure ();
double RhoShapeMeasure (); double RhoShapeMeasure ();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment