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

Reorganize the Numeric lib

parent a3b27e37
No related branches found
No related tags found
No related merge requests found
// $Id: CAD.cpp,v 1.50 2002-05-18 16:31:16 geuzaine Exp $ // $Id: CAD.cpp,v 1.51 2002-05-18 21:35:10 geuzaine Exp $
// //
// Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
// //
...@@ -1587,8 +1587,8 @@ void ReplaceAllDuplicates(Mesh *m){ ...@@ -1587,8 +1587,8 @@ void ReplaceAllDuplicates(Mesh *m){
static Curve *CURVE, *CURVE_2; static Curve *CURVE, *CURVE_2;
static Surface *SURFACE; static Surface *SURFACE;
static Vertex *VERTEX; static Vertex *VERTEX;
extern void newt(float x[], int n, int *check, extern void newt(double x[], int n, int *check,
void (*vecfunc)(int, float [], float [])); void (*vecfunc)(int, double [], double []));
double min1d (double (*funct)(double), double *xmin){ double min1d (double (*funct)(double), double *xmin){
double xx, fx, fb, fa, bx, ax; double xx, fx, fb, fa, bx, ax;
...@@ -1603,7 +1603,7 @@ double min1d (double (*funct)(double), double *xmin){ ...@@ -1603,7 +1603,7 @@ double min1d (double (*funct)(double), double *xmin){
return( brent(ax,xx,bx,funct,TOL,xmin) ); return( brent(ax,xx,bx,funct,TOL,xmin) );
} }
static void intersectCS (int N, float x[], float res[]){ static void intersectCS (int N, double x[], double res[]){
//x[1] = u x[2] = v x[3] = w //x[1] = u x[2] = v x[3] = w
Vertex s,c; Vertex s,c;
s = InterpolateSurface(SURFACE,x[1],x[2],0,0); s = InterpolateSurface(SURFACE,x[1],x[2],0,0);
...@@ -1613,7 +1613,7 @@ static void intersectCS (int N, float x[], float res[]){ ...@@ -1613,7 +1613,7 @@ static void intersectCS (int N, float x[], float res[]){
res[3] = s.Pos.Z - c.Pos.Z; res[3] = s.Pos.Z - c.Pos.Z;
} }
static void intersectCC (int N, float x[], float res[]){ static void intersectCC (int N, double x[], double res[]){
//x[1] = u x[2] = v //x[1] = u x[2] = v
Vertex c2,c; Vertex c2,c;
c2 = InterpolateCurve(CURVE_2,x[2],0); c2 = InterpolateCurve(CURVE_2,x[2],0);
...@@ -1622,7 +1622,7 @@ static void intersectCC (int N, float x[], float res[]){ ...@@ -1622,7 +1622,7 @@ static void intersectCC (int N, float x[], float res[]){
res[2] = c2.Pos.Y - c.Pos.Y; res[2] = c2.Pos.Y - c.Pos.Y;
} }
static void projectPS (int N, float x[], float res[]){ static void projectPS (int N, double x[], double res[]){
//x[1] = u x[2] = v //x[1] = u x[2] = v
Vertex du,dv,c; Vertex du,dv,c;
c = InterpolateSurface(SURFACE,x[1],x[2],0,0); c = InterpolateSurface(SURFACE,x[1],x[2],0,0);
...@@ -1763,7 +1763,7 @@ bool try_a_value(Surface *s, Vertex *p, double u, double v,double *uu, double *v ...@@ -1763,7 +1763,7 @@ bool try_a_value(Surface *s, Vertex *p, double u, double v,double *uu, double *v
} }
bool ProjectPointOnSurface (Surface *s, Vertex &p){ bool ProjectPointOnSurface (Surface *s, Vertex &p){
float x[3] = {0.5,0.5,0.5}; double x[3] = {0.5,0.5,0.5};
Vertex vv; Vertex vv;
int check; int check;
SURFACE = s; SURFACE = s;
...@@ -1789,7 +1789,7 @@ bool ProjectPointOnSurface (Surface *s, Vertex &p){ ...@@ -1789,7 +1789,7 @@ bool ProjectPointOnSurface (Surface *s, Vertex &p){
} }
bool ProjectPointOnSurface (Surface *s, Vertex *p,double *u, double *v){ bool ProjectPointOnSurface (Surface *s, Vertex *p,double *u, double *v){
static float x[3]; static double x[3];
int check; int check;
static int deb = 1; static int deb = 1;
double VMIN,VMAX,UMIN,UMAX,l, lmin; double VMIN,VMAX,UMIN,UMAX,l, lmin;
...@@ -1869,7 +1869,7 @@ bool ProjectPointOnSurface (Surface *s, Vertex *p,double *u, double *v){ ...@@ -1869,7 +1869,7 @@ bool ProjectPointOnSurface (Surface *s, Vertex *p,double *u, double *v){
} }
bool IntersectCurveSurface (Curve *c, Surface *s){ bool IntersectCurveSurface (Curve *c, Surface *s){
float x[4]; double x[4];
int check; int check;
SURFACE = s; SURFACE = s;
CURVE = c; CURVE = c;
...@@ -1893,7 +1893,7 @@ void DivideCurve (Curve *c , double u, Vertex *v, Curve **c1, Curve **c2){ ...@@ -1893,7 +1893,7 @@ void DivideCurve (Curve *c , double u, Vertex *v, Curve **c1, Curve **c2){
bool IntersectCurves (Curve *c1, Curve *c2, bool IntersectCurves (Curve *c1, Curve *c2,
Curve **c11, Curve **c12, Curve **c11, Curve **c12,
Curve **c21, Curve **c22, Vertex **v){ Curve **c21, Curve **c22, Vertex **v){
float x[3]; double x[3];
Vertex v1,v2; Vertex v1,v2;
int check; int check;
......
# $Id: Makefile,v 1.43 2002-05-18 16:31:16 geuzaine Exp $ # $Id: Makefile,v 1.44 2002-05-18 21:35:10 geuzaine Exp $
# #
# Makefile for "libGmshMesh.a" # Makefile for "libGmshMesh.a"
# #
...@@ -259,7 +259,7 @@ Utils.o: Utils.cpp ../Common/Gmsh.h ../Common/Message.h \ ...@@ -259,7 +259,7 @@ Utils.o: Utils.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/avl.h ../DataStr/Tools.h ../Numeric/Numeric.h ../Geo/Geo.h \ ../DataStr/avl.h ../DataStr/Tools.h ../Numeric/Numeric.h ../Geo/Geo.h \
../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \ ../Geo/CAD.h ../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Simplex.h \
../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Matrix.h \ ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/Metric.h ../Mesh/Matrix.h \
Mesh.h Interpolation.h ../Numeric/nrutil.h ../Common/Context.h Mesh.h Interpolation.h ../Numeric/NRUtil.h ../Common/Context.h
Metric.o: Metric.cpp ../Common/Gmsh.h ../Common/Message.h \ Metric.o: Metric.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \ ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../Numeric/Numeric.h ../Geo/Geo.h \ ../DataStr/avl.h ../DataStr/Tools.h ../Numeric/Numeric.h ../Geo/Geo.h \
......
// $Id: Utils.cpp,v 1.11 2002-05-18 08:01:39 geuzaine Exp $ // $Id: Utils.cpp,v 1.12 2002-05-18 21:35:10 geuzaine Exp $
// //
// Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997 - 2002 C. Geuzaine, J.-F. Remacle
// //
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include "CAD.h" #include "CAD.h"
#include "Mesh.h" #include "Mesh.h"
#include "Interpolation.h" #include "Interpolation.h"
#include "nrutil.h" #include "NRUtil.h"
#include "Context.h" #include "Context.h"
extern Context_T CTX; extern Context_T CTX;
......
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