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

📄 zaldy1.c

📁 FreeFem++可以生成高质量的有限元网格。可以用于流体力学
💻 C
字号:
/* *  memory allocation for data structures * *  Written by Pascal J. Frey, Inria-Rocquencourt *  Copyright (c) Inria, 1999.  All rights reserved. */#ifdef __cplusplusextern "C" {#endif#include <assert.h>#include <stdlib.h>#include "medit.h"#include "extern.h"#include "sproto.h"int zaldy1(pMesh mesh) {  /* default */  if ( ddebug ) printf("allocate %d points\n",mesh->np);  mesh->point = (pPoint)M_calloc(mesh->np+1,sizeof(Point),"zaldy1.point");  assert(mesh->point);  if ( ddebug ) printf("allocate %d tria\n",mesh->nt);  mesh->tria = (pTriangle)M_calloc(mesh->nt+1,sizeof(Triangle),"zaldy1.tria");  assert(mesh->tria);  if ( ddebug ) printf("allocate %d quad\n",mesh->nq);  if ( mesh->nq ) {    mesh->quad = (pQuad)M_calloc(mesh->nq+1,sizeof(Quad),"zaldy1.quad");	assert(mesh->quad);  }  if ( mesh->ntet ) {    if ( ddebug ) printf("allocate %d tetra\n",mesh->ntet);    mesh->tetra = (pTetra)M_calloc(mesh->ntet+1,sizeof(Tetra),"zaldy1.tetra");	assert(mesh->tetra);  }  if ( mesh->nhex ) {    if ( ddebug ) printf("allocate %d hexa\n",mesh->nhex);    mesh->hexa = (pHexa)M_calloc(mesh->nhex+1,sizeof(Hexa),"zaldy1.hexa");	assert(mesh->hexa);  }  if ( mesh->na ) {    if ( ddebug ) printf("allocate %d edges\n",mesh->na);    mesh->edge = (pEdge)M_calloc(mesh->na+1,sizeof(Edge),"zaldy1.edge");	assert(mesh->edge);  }  if ( mesh->nvn || mesh->ntg ) {    mesh->extra = (pExtra)M_calloc(1,sizeof(Extra),"zaldy1.extra");	assert(mesh->extra);  	if ( mesh->nvn ) {  	  mesh->extra->n = (float*)M_calloc(3*mesh->nvn+1,sizeof(float),"inmesh");	  assert(mesh->extra->n);    }    if ( mesh->ntg ) {      mesh->extra->t = (float*)M_calloc(3*mesh->ntg+1,sizeof(float),"inmesh");	  assert(mesh->extra->n);    }  }  return(1);}

⌨️ 快捷键说明

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