ibgd.c
来自「有限元学习研究用源代码(老外的),供科研人员参考」· C语言 代码 · 共 54 行
C
54 行
/* last edit: Ilja Schmelzer -------------- 17-OCT-1994 19:34:21.97 */
/************************************************************************/
/* */
/* <<< 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") */
/* */
/************************************************************************/
#include "ibgd.h"
#include "ibglib.h"
#include "ibgdefault.h"
#include "ibgd0.h"
#include "ibgi.h"
ibGeometry ibgdCopy(ibGeometry old)
{
old->copy++;
return old;
}
int ibgdFree(ibGeometry old)
{
if(old==ibgNULL) return ibgSuccess;
if(old->copy>0) {old->copy--; return ibgSuccess;}
if(old->Class->Free) old->Class->Free(old);
free(old);
return ibgSuccess;
}
/* <<< ibgdNew >>> example of a simple geometry --- only one region: */
typedef struct _ibgConstant{
ibGeometryRec g;
ibgSegment u;
}ibgConstantRec,*ibgConstant;
static ibGeometryClassRec ibgConstantClass;
static int RegionOfPoint(ibGeometry g, ibgPoint *point, const ibgPoint *prev)
{ibgpSegment(*point) = ((ibgConstant)g)->u;
ibgpType(*point) = ibgSRegion;
return ibgRegionFound;
}
ibGeometry ibgdNew(ibgSegment region)
{ibgConstant geom = (ibgConstant) malloc(sizeof(ibgConstantRec));
ibgdInitialize((ibGeometry)geom,&ibgConstantClass);
ibgConstantClass.RegionOfPoint = RegionOfPoint;
geom->u = region;
return (ibGeometry)geom;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?