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

Added tolerance in sys3x3 (it produces a message) -> to help in Plan_Moyen

parent d4940d04
No related branches found
No related tags found
No related merge requests found
/* $Id: 2D_Mesh.cpp,v 1.11 2000-12-08 13:55:23 geuzaine Exp $ */ /* $Id: 2D_Mesh.cpp,v 1.12 2000-12-13 20:21:48 geuzaine Exp $ */
/* /*
Maillage Delaunay d'une surface (Point insertion Technique) Maillage Delaunay d'une surface (Point insertion Technique)
...@@ -73,6 +73,8 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -73,6 +73,8 @@ void Plan_Moyen (void *data, void *dum){
points = List_Create (10, 10, sizeof (Vertex *)); points = List_Create (10, 10, sizeof (Vertex *));
deb = 0; deb = 0;
} }
else
List_Reset (points);
switch (s->Typ){ switch (s->Typ){
case MSH_SURF_PLAN: case MSH_SURF_PLAN:
...@@ -143,7 +145,7 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -143,7 +145,7 @@ void Plan_Moyen (void *data, void *dum){
s->d = X; s->d = X;
res[0] = 1.; res[0] = 1.;
res[1] = res[2] = 0.0; res[1] = res[2] = 0.0;
Msg(DEBUG, "Plan Type x = c"); Msg(DEBUG, "Mean Plane of Type 'x = c'");
} }
/* y = Y */ /* y = Y */
...@@ -152,7 +154,7 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -152,7 +154,7 @@ void Plan_Moyen (void *data, void *dum){
s->d = Y; s->d = Y;
res[1] = 1.; res[1] = 1.;
res[0] = res[2] = 0.0; res[0] = res[2] = 0.0;
Msg(DEBUG, "Plan Type y = c"); Msg(DEBUG, "Mean Plane of Type 'y = c'");
} }
/* z = Z */ /* z = Z */
...@@ -161,6 +163,7 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -161,6 +163,7 @@ void Plan_Moyen (void *data, void *dum){
s->d = Z; s->d = Z;
res[2] = 1.; res[2] = 1.;
res[1] = res[0] = 0.0; res[1] = res[0] = 0.0;
Msg(DEBUG, "Mean Plane of Type 'y = c'");
} }
/* by + cz = -x */ /* by + cz = -x */
...@@ -177,7 +180,7 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -177,7 +180,7 @@ void Plan_Moyen (void *data, void *dum){
res[0] = 1.; res[0] = 1.;
res[1] = r2[0]; res[1] = r2[0];
res[2] = r2[1]; res[2] = r2[1];
Msg(DEBUG, "Plan Type by + cz = -x"); Msg(DEBUG, "Mean Plane of Type 'by + cz = -x'");
} }
/* ax + cz = -y */ /* ax + cz = -y */
...@@ -194,7 +197,7 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -194,7 +197,7 @@ void Plan_Moyen (void *data, void *dum){
res[0] = r2[0]; res[0] = r2[0];
res[1] = 1.; res[1] = 1.;
res[2] = r2[1]; res[2] = r2[1];
Msg(DEBUG, "Plan Type ax + cz = -y"); Msg(DEBUG, "Mean Plane of Type 'ax + cz = -y'");
} }
/* ax + by = -z */ /* ax + by = -z */
...@@ -211,10 +214,10 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -211,10 +214,10 @@ void Plan_Moyen (void *data, void *dum){
res[0] = r2[0]; res[0] = r2[0];
res[1] = r2[1]; res[1] = r2[1];
res[2] = 1.; res[2] = 1.;
Msg(DEBUG, "Plan Type ax + by = -z"); Msg(DEBUG, "Mean Plane of Type 'ax + by = -z'");
} }
else{ else{
Msg(ERROR, "Mean Plane"); Msg(ERROR, "Problem in Mean Plane");
} }
} }
} }
...@@ -282,7 +285,7 @@ void Plan_Moyen (void *data, void *dum){ ...@@ -282,7 +285,7 @@ void Plan_Moyen (void *data, void *dum){
} }
} }
} }
List_Reset (points);
} }
......
/* $Id: Numeric.cpp,v 1.7 2000-11-28 11:28:32 geuzaine Exp $ */ /* $Id: Numeric.cpp,v 1.8 2000-12-13 20:21:48 geuzaine Exp $ */
#include "Gmsh.h" #include "Gmsh.h"
#include "Const.h" #include "Const.h"
...@@ -94,6 +94,13 @@ int sys3x3 (double mat[3][3], double b[3], double res[3], double *det){ ...@@ -94,6 +94,13 @@ int sys3x3 (double mat[3][3], double b[3], double res[3], double *det){
return (0); return (0);
} }
// WARNING, WARNING
if (fabs(*det) < 1.e-12){
Msg(INFO, "Assuming Sys3x3 Matrix is Singular (Is this OK?)");
res[0] = res[1] = res[2] = 0.0 ;
return (0);
}
ud = 1. / (*det); ud = 1. / (*det);
res[0] = b[0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) - res[0] = b[0] * (mat[1][1] * mat[2][2] - mat[1][2] * mat[2][1]) -
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment