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

📄 mainext.c

📁 有限元学习研究用源代码(老外的),供科研人员参考
💻 C
字号:
/* last edit: Ilja Schmelzer -------------- 10-JUN-1994 17:58:40.20	*/
/************************************************************************/
/*                                                                      */
/*  <<< 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")	*/
/*                                                                      */
/************************************************************************/
/*
	Intersection-Based Grid Generator	Version 1.1

author:	Ilja Schmelzer, IAAS,
	Mohrenst. 39, D-10117 Berlin Germany
	e-mail:	schmelzer@iaas-berlin.d400.de
	Tel:	+49 30	20377 567
	Fax:	+49 30	200 4975

This example creates the most trivial 2D grid and writes it into a file.
*/

#include <stdio.h>
#include <ibg.h>
#include <ibgd.h>
#include <ibgg.h>
#include <ibgapplication.h>
#include <ibgext.h>

int main()
{
/* the data of the coarse grid - cuboid */
 ibgFloat x[2] = {-1.0,1.0},
	  y[2] = {-1.0,1.0},
	  z[2] = { 0.0,1.0};
 ibGeometry g0;
 ibGrid	*grid;
 ibgExtData *dat;

/* ibgNameApplication = "test"; */
 ibgApplicationInit();	/* calls also ibgdInit and ibGridInit */

 g0  = ibgdNew(2);	/* trivial geometry: only one region 2 */
 dat = ibgExtInit("test.ibg");

/* grid generator call. */
 grid=ibGridGenerate(g0,  	/* geometry description */
	100,	/* approx. point number (for malloc to minimize realloc) */
	ibgExtNum(dat,0),ibgExtX(dat,0),ibgExtReg(dat,0),
	ibgExtNum(dat,1),ibgExtX(dat,1),ibgExtReg(dat,1),
	ibgExtNum(dat,2),ibgExtX(dat,2),ibgExtReg(dat,2),
/* default refinement criteria: */
        ibgExtRegion,(ibgPtObject)dat,
	ibggDefaultRefineFace,ibgNULL,
	ibggDefaultRefineLine,ibgNULL,
	ibggDefaultRefineNode,ibgNULL,
	ibgExtEdge,(ibgPtObject)dat);
/* end of program: */
 ibgNameFile = "test";
 ibgOutput(grid);
 return ibgdQuit();
}

⌨️ 快捷键说明

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