⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ibgdspline.h

📁 有限元学习研究用源代码(老外的),供科研人员参考
💻 H
字号:
/* last edit: Ilja Schmelzer -------------- 10-JUN-1994 15:08:14.04	*/
/************************************************************************/
/*                                                                      */
/*  <<< I B G >>> - Intersection - Based Grid generation package 	*/
/*                                                                      */
/*  Version 1.1 by Ilja Schmelzer   schmelzer@iaas-berlin.d400.de       */
/*                                                                      */
/*  to be distributed under IBG license conditions (see "readme.ibg")	*/
/*                                                                      */
/************************************************************************/
#ifndef IBGDSPLINE_H
#define IBGDSPLINE_H

/*  This package allows to define a geometry description for a set of splines.
To define the region number of a point intersections of the line from the point
to infinity in positive y-direction (up) will be searched. The data of the
spline are hidden, only an intersection test routine, segment number data and a
bounding cube around every spline are visible. This modularization allows to
combine different search algorithms (trivial, xtree, quadtree, octree) with
different sorts of splines.

ibgdSpline can be considered as a C implementation of an abstract C++ class
with the pure virtual method test
*/

/* basic class - spline data which are visible for the geometry description: */
typedef struct _ibgdSpline{
	ibgSegment		left;		/* segment number of the left region */
	ibgSegment		right;		/* segment number of the right region */
	ibgSegment		face;		/* segment number of the face itself */
/* a cube containing the spline (allows to avoid many intersection tests): */
	ibgFloat	xmin,xmax,ymin,ymax,zmin,zmax; /* 2D: no zmin,zmax */
}ibgdSpline;

/* class for geoemtry description based on a spline list (base class
ibGeometryRec) */

typedef struct _ibgdSplines{
	ibGeometryRec	g;	/* basic class record */
/* the spline list:	*/
	char*	spline;		/* the spline field */
	int	num;		/* number of splines */
	int	max;		/* allocated length of spline */

	ibgSegment	outside;	/* segment if no intersection found */
/* spline data which are the same for all splines in the list: */
	int	dim;		/* spline dimension (2 or 3) */
	int	size;		/* sizeof(spline_data_type) */
	/* the spline intersection test function: */
	int	(*test)(void* spline, ibgFloat* xi,
			 ibgFloat* x1, ibgFloat* x2);
}ibgdSplines;

/* possible return values of intersection: */
#define ibgdSplineNone	0
#define ibgdSplineLeft	1
#define ibgdSplineRight	2

/* initialization of a spline list: */
ibgdSplines* ibgdSplineListNew(int dim, int max, int size,
		int (*test)(void* spline, ibgFloat* xi,
		      	 ibgFloat* x1, ibgFloat* x2)
	);

/* creation of the geometry from a given spline list: */
ibGeometry ibgdSplineList(ibgdSplines *spp);

/* <<<	predefined types - linear spline on a simplex >>>	*/

/* 2D linear approximation on a line segment: */

typedef struct{
	ibgdSpline	s;
	ibgFloat	x1[2];
	ibgFloat	x2[2];
}ibgdSplineLine;

void ibgdSplineLineNew(ibgdSplineLine *s,
	ibgFloat x1, ibgFloat y1,
	ibgFloat x2, ibgFloat y2,
	ibgSegment l, ibgSegment r, ibgSegment u);

int ibgdSplineLineTest(void* This,
	   	ibgFloat* xi,ibgFloat* x0,ibgFloat* x1);

/* 3D linear approximation on a triangle: */

typedef struct{
	ibgdSpline	s;
	ibgFloat	x1[3];
	ibgFloat	x2[3];
	ibgFloat	x3[3];
}ibgdSplineTriangle;

void ibgdSplineTriangleNew(ibgdSplineTriangle *s,
	ibgFloat x1, ibgFloat y1, ibgFloat z1,
	ibgFloat x2, ibgFloat y2, ibgFloat z2,
	ibgFloat x3, ibgFloat y3, ibgFloat z3,
	ibgSegment l, ibgSegment r, ibgSegment u);

int ibgdSplineTriangleTest(void* This,
	   	ibgFloat* xi,ibgFloat* x0,ibgFloat* x1);

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -