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

📄 input11.c

📁 an introduction to boundary element methods一书源码
💻 C
字号:
#include "cbox11.h"void Input11(Xi,Yi,X,Y,Code,Bc)float Xi[21],Yi[21],X[52],Y[52],Bc[101];int Code[101];{	int i,j,k,Dim,NN,lnsize;	FILE *infile,*outfile;	char Title[80],line1[100];	lnsize = 120;	printf("\nNOTE: FIRST LINE IN THE INPUT FILE SHOULD BE EITHER BLANK OR THE TITLE NOT DATA \n");	printf("\nEnter the name of the input file:");    scanf("%12s", inname);	printf("\nEnter the name of the output file:");	scanf("%12s", outname);              	infile = fopen(inname, "r");	outfile = fopen(outname,"w");		fgets(line1,lnsize,infile);	fprintf(outfile,"%s \n",line1);	fprintf(outfile,"Input \n");			fscanf(infile,"%d %d %d", &N, &L, &M); 	fprintf(outfile,"\nNumber of Boundary Elements = %2d \n",N);	fprintf(outfile,"Number of Interior Points = %2d \n",L);		for(i = 1; i<=5; i++) 	   fscanf(infile,"%d",&Last[i]); 	fscanf(infile,"%f %f", &mu, &nu);	fprintf(outfile, "\nShear Modulus = %10.4f \n",mu);	fprintf(outfile,"Poisson Ratio = %10.4f \n",nu);	if(M > 0)		{			fprintf(outfile,"Number of different Boundaries = %d\n\n",M);			for(i=1;i<=M;i++)				fprintf(outfile,"Last node on  boundary%2d = %2d\n\n",i,Last[i]);		}	/*[ Read coordinates of extreme points ]*/  fprintf(outfile,"\nCOORDINATES OF EXTREME POINTS OF THE BOUNDARY ELEMENTS\n");		fprintf(outfile,"\n\nPoint      X 	 	    Y\n");        for(i = 1; i<=N; i++)        {        	fscanf(infile,"%f %f", &X[i],&Y[i]);	  		fprintf(outfile,"%2d  %10.4f \t %10.4f \n",i,X[i],Y[i]);        }	/*[Read boundary conditions in Bc vector. If Code[i] = 0, the Bc[] 	value is a prescribed displacement; if Code[] = 1, the Bc[] value is a prescribed traction. ]*/ 	fprintf(outfile,"\nBoundary Conditions\n\n");	fprintf(outfile,"	  Prescribed Value			  Prescribed Value\n");	fprintf(outfile,"Node   X-direction		Code	   Y-direction		Code\n");		for( i = 1; i<= N; i++)	{ 		fscanf(infile,"%d %f %d %f",&Code[2*i-1],&Bc[2*i-1],														&Code[2*i],&Bc[2*i]);   	 	   fprintf(outfile,"%2d \t %10.4f \t\t %2d \t %10.4f \t\t %2d\n",i,	   Bc[2*i-1],Code[2*i-1],Bc[2*i-1],Code[2*i]);										 	 	}	if( L)	{		fprintf(outfile,"\nInterior Point Coordinates\n");		fprintf(outfile,"\nPoint 	   Xi 	  	 	   Yi\n"); 		for(i=1;i<=L;i++)		{			fscanf(infile,"%f %f",&Xi[i],&Yi[i]);			fprintf(outfile,"%2d \t %10.4f \t %10.4f\n",i,Xi[i],Yi[i]);		    }		  }    		for(i=1;i<=80;i++)			fprintf(outfile,"*");		fprintf(outfile,"\n");  		fclose(infile);		fclose(outfile);}

⌨️ 快捷键说明

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