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

📄 ibgg0p.h

📁 有限元学习研究用源代码(老外的),供科研人员参考
💻 H
字号:
/* last edit: Ilja Schmelzer -------------- 17-OCT-1994 13:22:56.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 IBGG0P_H
#define IBGG0P_H

#ifndef IBGGP_H
#include "ibggp.h"
#endif

#ifndef IBGG0_H
#include "ibgg0.h"
#endif

/* only for internal use in "ibgg0.c" !!! */
#define g0ibig 123456789

#if ibgDIM == 3
#define ibgDIM2 6			/* double space dimension */
#define ibgDIMQ 8			/* quader in space dimension */
#endif
#if ibgDIM == 2
#define ibgDIM2 4			/* double space dimension */
#define ibgDIMQ 4			/* quader in space dimension */
#endif
#if ibgDIM == 1
#define ibgDIM2 2			/* double space dimension */
#define ibgDIMQ 2			/* quader in space dimension */
#endif


/*internal grid structure: */
struct _ibGrid00{
	ibGrid	*gg;
       	char	*nx,*nt,*nu,*nf,*nl;
	int	*no,*nb;
	int	*ndp[ibgDIM],*ndn[ibgDIM],*ndr[ibgDIM2];
	int	*nq[ibgDIMQ];
   	int	*qn[ibgDIMQ];
	int	*qdp[ibgDIM],*qdn[ibgDIM],*qdr[ibgDIM2];
	int	*qn0;
	int	lastQuad,maxQuad;
	ibgPoint	*bPoint;
       	char	*bx,*bt,*bu,*bf;
	int	*bn;
	int	lastBound,maxBound;
	int	maxr,maxo,maxq,maxd;
	int	ror[ibgDIM2][ibgDIM2];
	int	roq[ibgDIM2][ibgDIM2];
	int	rrq[ibgDIM2][ibgDIM2];
	int	rrr[ibgDIM2][ibgDIM2];
	int	qother[ibgDIMQ];
	int	firstq,lastq;
	int	(*eref)(int nu, unsigned ro);
	int	(*elot)(int nn, unsigned rr, unsigned ro);
	void	(*nref)(int nn);
	int	(*breg)(int nn);
	int	(*elo2)(int nn, unsigned rr, unsigned ro);
	int	*bstack;
	int	*nstack;
	int	nfree;
	int	bfree;
};

extern	ibGrid0	ibgg0;	/* current internal grid */

	/* point data */
#undef cnx
#undef cnl
#undef cnt
#undef cnu
#define cnx(nn) ((ibgFloat *) (ibgg0.nx + IBGPOINTSIZE*(nn))) /* coordinates  */
#define cnl(nn) ((char  *)    (ibgg0.nl + IBGPOINTSIZE*(nn))) /* point level   */
#define cnt(nn) ((ibgSegmentType *) (ibgg0.nt + IBGPOINTSIZE*(nn)))[0] /* point type */
#define cnu(nn) ((ibgSegment *)  (ibgg0.nu + IBGPOINTSIZE*(nn)))[0] /* point segment */
#define cnb(nn) ((ibgg0.nb)[nn])		/* boundary point of the point */
#define cndp(nn,dd) ((ibgg0.ndp[dd])[nn])	/* neighbour in positive dir.*/
#define cndn(nn,dd) ((ibgg0.ndn[dd])[nn])	/* neighbour in negative dir.*/
#define cndr(nn,rr) ((ibgg0.ndr[rr])[nn])	/* neighbour in direction rr */
#define cnq(nn,rq)  ((ibgg0.nq[rq])[nn])	/* cuboid in skew dir. rq    */
#define cndef(nn)	((nn)> 0)     	/* defined point */
#define cnund(nn)	((nn)<=0)	/* undefined point */
#define cnoutside(nn)	((nn)==0)	/* point outside */
#define cnnothing(nn)	((nn)< 0)	/* undefined point */

	/* cuboid data */
#define cqn(qq,rq)  ((ibgg0.qn[rq])[qq])	/* point in skew direction rq */
#define cqdp(qq,dd) ((ibgg0.qdp[dd])[qq])	/* point in positive dir. dd */
#define cqdn(qq,dd) ((ibgg0.qdn[dd])[qq])	/* point in negative dir. dd */
#define cqdr(qq,rr) ((ibgg0.qdr[rr])[qq])	/* point in direction rr */
#define cqn0(qq)    ((ibgg0.qn0)[qq])		/* central point */

	/* shifted (boundary) point data */
#define cbd(bb) ((ibgPoint *)  (((char *) ibgg0.bPoint) + IBGPOINTSIZE*(bb)))
#define cbx(bb) ((ibgFloat *) (ibgg0.bx + IBGPOINTSIZE*(bb)))  /* coordinates */
#define cbt(bb) ((ibgSegmentType *) (ibgg0.bt + IBGPOINTSIZE*(bb)))[0] /* point type */
#define cbu(bb) ((ibgSegment *)  (ibgg0.bu + IBGPOINTSIZE*(bb)))[0] /* point segment */
#define cbn(bb) ((ibgg0.bn)[bb])	/* basis point of boundary point */

	/* direction data */
#define	cror(r,o)	(ibgg0.ror[r][o])
#define	croq(r,o)	(ibgg0.roq[r][o])
#define	cqother(q)	(ibgg0.qother[q])

#define rother(r)	((r) < cgdim ? (r) + cgdim : (r) - cgdim)
#define rposit(r)	((r) < cgdim ? (r)         : (r) - cgdim)
#define rnegat(r)	((r) < cgdim ? (r) + cgdim : (r)        )
#define rispos(r)	((r) < cgdim)
#define dnegat(d)	((d) + cgdim)

/* functions for creating (deleting) cells, points and boundary points: */


#define g0BDel(b)  	{ibgassert(cbn(b)==0 || cnb(cbn(b)) != (b));\
			 if((b)==ibgg0.lastBound) {\
				ibgg0.bn[b]= 0;\
				ibgg0.lastBound--;}\
	       		 else {	if(ibgg0.bstack[b]==0) {\
					ibgg0.bn[b]= -100000;\
					ibgg0.bstack[b]=ibgg0.bfree;\
					ibgg0.bfree=(b);\
				}else{	ibgg0.bn[b]= 0;\
			}}}

#define g0BNew		g0BNew0()

#define g0QNew  	(ibgg0.lastQuad<ibgg0.maxQuad ? ++ibgg0.lastQuad :\
   				(g0QRealloc() ? ++ibgg0.lastQuad : 0))

#define g0NDel(n)  	{if((n)==ibgg.lastPoint) ibgg.lastPoint--;\
	       		 else  {ibgpType(ibgridPoint(ibgg,n))=ibgSNothing;\
			     if(ibgg0.nstack[n]==0) {\
				ibgg0.nstack[n]=ibgg0.nfree;ibgg0.nfree=(n);\
			}}}

#define g0NNew		g0NNew0()


#endif

⌨️ 快捷键说明

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