亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? be2.c

?? 邊界元程序
?? C
字號:
#include "cbox2.h"main(){	float X[82],Y[82],F[81],Bc[161],Xi[21],Yi[21],u[21],D;	int Code[161];	float G[81][162],H[81][81],q1[21],q2[21];	int Twice,Dim;		/*[Dim= Maximum dimension of the system AX = F; it is the same as the	 maximum number of nodes, or maximum number of elements ]*/			Dim = 80;	Twice = 2*Dim;			/*[	Read Data	]*/		Input2(Xi,Yi,X,Y,Code,Bc);		/*[ Compute matrices G and H, and form the system A X = F ]*/			Sys2(X,Y,G,H,F,Bc,Code,Dim,Twice);			/*[Solve the system AX = F ]*/		Solve(H,F,&D,N,Dim);	/*[ Compute the potential and fluxes at interior points ]*/	Inter2(F,Bc,Code,Xi,Yi,X,Y,u,q1,q2); 		/*[ Output the solution at boundary nodes and interior points ]*/		Out2(X,Y,F,Bc,Xi,Yi,u,q1,q2);}	void Input2(Xi,Yi,X,Y,Code,Bc)			float Xi[21],Yi[21],X[82],Y[82],Bc[161];	int Code[161];{	FILE  *infile, *outfile;	int   i,j,k,lnsize;	char Title[80],line1[100]; 	lnsize = 100;		printf("\nNOTE: FIRST LINE IN THE INPUT FILE SHOULD BE EITHER BLANK OR THE TITLE NOT DATA \n"); 		printf("\n Enter the name of the input file:");        scanf("%s", inname);        printf("\n Enter the name of the output file:");        scanf("%s", 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",&N,&L);				fprintf(outfile," \nNumber of Boundary Elements = %d \n",N);		fprintf(outfile," \nNumber of InteriorPoints = %d \n",L);			fprintf(outfile," \nCoordinates of the Extreme Points");		fprintf(outfile,"  of the  Boundary Elements  \n \n"); 		fprintf(outfile,"Point      X          Y\n");		for(i=1;i<=N;i++)		{			fscanf(infile,"%f %f",&X[i],&Y[i]);			fprintf(outfile,"%2d   %10.4f %10.4f\n",i,X[i],Y[i]);		}		/*[	Read boundary conditions in Bc[] vector. If Code[i] = 0, the Bc value is a known potential;  if Code[i] = 1, the Bc[] value is a known potential derivative (flux). Two Boundary conditions are read per element.  One node may have two values of the potential derivative but only one value of the potential ]*/	fprintf(outfile," \nBoundary  Conditions \n\n");	fprintf(outfile,"               First Node             Second Node\n");	fprintf(outfile,"               Prescribed             Prescribed\n");	fprintf(outfile,"Element     CODE   Value           CODE    Value\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\t\t%2d %10.4f\t\t\t%2d %10.4f\n",				i,Code[2*i -1],Bc[2*i -1],Code[2*i],Bc[2*i]);	}	/*[ Read coordinates of the interior points ]*/	fprintf(outfile,"\nInterior Point Coordinates\n\n");	fprintf(outfile,"       Xi         Yi\n");			for(i=1;i<=L;i++)		{			fscanf(infile,"%f %f \n",&Xi[i],&Yi[i]);			fprintf(outfile," %10.4f %10.4f\n",Xi[i],Yi[i]);		}	fclose(infile);	fclose(outfile);			}void Inter2(F,Bc,Code,Xi,Yi,X,Y,u,q1,q2)	float F[81],Bc[161],Xi[21],Yi[21],X[82],Y[82],u[21],q1[21],q2[21];				int   Code[161];	{		float A1,B1,A2,B2,q11,q21,q12,q22,u11,u21,u12,u22,temp;		int i,j,k;				/*[ This Subroutine computes the values of the potential and the potential derivatives (fluxes) at the interior points ]*/ 					/*[ Rearrange the F and Bc arrays to store all values of the potential in F and all valus of the derivative in Bc ]*/						for(i=1;i<=N;i++)		{			for(j=1;j<=2;j++)			{				if( Code[2*i - 2+j] <= 0)				{					if(!((i != N) || (j!=2)))					{						if(Code[1] >0)						{							temp       = F[1];							F[1]    = Bc[2*N];							Bc[2*N] = temp;						}						else							Bc[2*N] = Bc[1];					}					else					{						if((i == 1) ||(j == 2)|| (Code[2*i -2] == 1))						{							temp 	= F[i-1+j];							F[i-1+j] = Bc[2*i-2+j];							Bc[2*i-2+j] = temp;						}						else							Bc[2*i-1] = Bc[2*i-2];					}				}			}		}					/*[ Compute the potential and fluxes at interior points ]*/				if(L)		{			for(k=1;k<=L;k++)			{				u[k]   = 0.0;				q1[k] = 0.0;				q2[k] = 0.0;					for(j=1;j<=N;j++)				{					Quad2(Xi[k],Yi[k],X[j],Y[j],X[j+1],Y[j+1],					&A1,&A2,&B1,&B2,&q11,&q21,&q12,&q22,					&u11,&u21,&u12,&u22,1);										if((j - N) < 0)					{						u[k]   += Bc[2*j-1]*B1 + Bc[2*j]*B2 - 									F[j]*A1 - F[j+1]*A2;						q1[k] += Bc[2*j-1]*u11+Bc[2*j]*u12-									F[j]*q11-F[j+1]*q12;							q2[k] += Bc[2*j-1]*u21+Bc[2*j]*u22-									F[j]*q21-F[j+1]*q22;					}					else					{						u[k]   += Bc[2*j-1]*B1+ Bc[2*j]*B2-F[j]									*A1-F[1]*A2;						q1[k] += Bc[2*j-1]*u11+Bc[2*j]*u12									- F[j]*q11-F[1]*q12;						q2[k] += Bc[2*j-1]*u21+Bc[2*j]*u22									- F[j]*q21-F[1]*q22;					}				}				u[k]   /= 2.0 * pi;				q1[k] /= 2.0 * pi;				q2[k] /= 2.0 * pi;  		 	}		} 	}	void Out2(X,Y,F,Bc,Xi,Yi,u,q1,q2)	float 	X[82],Y[82],F[81],Bc[161],Xi[21],Yi[21],u[21],q1[21],q2[21];{				FILE *outfile;		int i,j,k;			outfile = fopen(outname,"a");				fprintf(outfile," \n\n\nSolution: \n\n");		fprintf(outfile,"Boundary Nodes \n");				fprintf(outfile,"          (X,Y)               u       Prenodal q  Postnodal q\n");		fprintf(outfile,"(%10.4f, %10.4f) %10.4f %10.4f %10.4f\n",				X[1],Y[1],F[1],Bc[2*N],Bc[1]); 		for(i=2;i<=N;i++)			fprintf(outfile,"(%10.4f, %10.4f) %10.4f %10.4f %10.4f\n",				X[i],Y[i],F[i],Bc[2*i-2],Bc[2*i-1]); 		if(L)		{			fprintf(outfile,"\n\nInterior Points \n");			fprintf(outfile,"          (Xi,Yi)            u          q_x          q_y\n");			for(i=1;i<=L;i++)				fprintf(outfile,"(%10.4f, %10.4f) %10.4f %10.4f  %10.4f\n",Xi[i],Yi[i],u[i],q1[i],q2[i]);		}		fclose(outfile);}void Quad2(Xp,Yp,X1,Y1,X2,Y2,A1,A2,B1,B2,			q11,q21,q12,q22,u11,u21,u12,u22,K)	float  Xp,Yp,X1,Y1,X2,Y2,*A1,*A2,*B1,*B2;float *q11,*q21,*q12,*q22,*u11,*u21,*u12,*u22;int    K;{		/*[ This function computes the integral of several non-singular functions along the boundary elements using a four points Gauss Quadrature. 	When K = 0, The off-diagonal coefficients of the matrices H and G are computed. When K= 1, all coefficients needed for computation of the potential and fluxes at interior points are computed. Ra = Radius = Distance from the collocation point to the Gauss integration points on the boundary elements; nx,ny = Components of the unit normal to the element; rx,ry,rn = Radius derivatives. See section 5.3 ]*/float Xg[5],Yg[5];float Ax,Ay,Bx,By,HL,nx,ny,Ra,rx,ry,rn,F1,F2,G,H,ux,uy,qx,qy;int   i; float Z[] =  {0.0, 0.86113631, -0.86113631, 0.33998104, -0.33998104};float W[] = {0.0, 0.34785485,  0.34785485, 0.65214515,  0.65214515};	Ax = (X2 - X1)/2.0;	Bx = (X2 + X1)/2.0;	Ay = (Y2 - Y1)/2.0;	By = (Y2 + Y1)/2.0;	HL = sqrt(SQ(Ax) + SQ(Ay));	nx =  Ay/HL;	ny = -Ax/HL;	(*A1) = 0.0;	(*A2) = 0.0;	(*B1) = 0.0;	(*B2) = 0.0;	(*q11) = 0.0;	(*q21) = 0.0;	(*q12) = 0.0;	(*q22) = 0.0;	(*u11) = 0.0;	(*u21) = 0.0;	(*u12) = 0.0;	(*u22) = 0.0;	/*[ Compute the terms to be included in the matrices G and H, or the terms needed to compute the potential and fluxes at interior points ]*/	for(i=1;i<=4;i++)	{		Xg[i] = Ax * Z[i] + Bx;		Yg[i] = Ay * Z[i] + By;		Ra = sqrt( SQ(Xp - Xg[i]) + SQ(Yp - Yg[i]));		rx = (Xg[i]-Xp)/Ra;		ry = (Yg[i]-Yp)/Ra;		rn = rx*nx + ry*ny;		F1 = ( 1.0 - Z[i])/2.0;		F2 = ( 1.0 + Z[i])/2.0;		if(K > 0)		{			ux = rx*W[i]*HL/Ra;			uy = ry*W[i]*HL/Ra;			qx = -((2.0*SQ(rx)-1.0)*nx+2.0* rx*ry*ny)*W[i]*HL/SQ(Ra);			qy = -((2.0*SQ(ry)-1.0)*ny+2.0* rx*ry*nx)*W[i]*HL/SQ(Ra);			(*q11) += qx*F1;			(*q12) += qx*F2;			(*q21) += qy*F1;			(*q22) += qy*F2;			(*u11) += ux*F1;			(*u12) += ux*F2;			(*u21) += uy*F1;			(*u22) += uy*F2;		}		H = rn * W[i]*HL/Ra;		G = log(1.0/Ra)*W[i]*HL;		(*A1) -= F1*H;		(*A2) -= F2*H;		(*B1) += F1*G;		(*B2) += F2*G;	}}	void Diag2(X1,Y1,X2,Y2,B1,B2)float X1,Y1,X2,Y2,*B1,*B2; {	/*[ This function computes the parts of the G matrix coefficients for  integrals along an element that includes the collocation point ]*/	float Li;	 Li  = sqrt(SQ(X2 -X1) + SQ(Y2 - Y1));	(*B1) = Li*(1.5 - log(Li))/2.0;	(*B2) = Li*(0.5 - log(Li))/2.0;}/*[function Solve :Solution of the linear systems of equations by the Gauss elimination method providing for interchanging rows when encountering a zero diagonal coeficient.A : Syestem MatrixB:  Originally it contains the independent coefficients.  After solutions it	contains the values of the syestem unknowns.                            				   				N:  Actual number of unknowns.Dim: Row and Column Dimension of A. ]*/void Solve(A,B,D,N,Dim)	float A[81][81],B[81],*D;  /*[ D is assigned some value here ]*/  	int N,Dim;{	int N1,i,j,k,i1,l,k1,found;	float c;	/*[ found is a flag which is used to check if any non zero coeff is found ]*/				N1 = N - 1;	for(k=1;k<=N1;k++)	{		k1 = k + 1;		c = A[k][k];				if( (fabs(c) - tol) <=0 )		{			found = 0;			for(j=k1;j<=N;j++)  /*[Interchange rows to get Nonzero ]*/		        {            	if( (fabs(A[j][k]) - tol) <=0.0 )                 {				 	for(l=k;l<=N;l++)                    {                     	c = A[k][l];                        A[k][l] = A[j][l];                        A[j][l] = c;                     }				  		c = B[k];				  		B[k] = B[j];				  		B[j] = c;				  		c = A[k][k];						found = 1;		/*[ coeff is found ]*/						break;				}			}		 }		if(!found)		{			printf("Singularity in Row %d 1",k);	   		(*D) = 0.0;          	    	return;   /*[ If no coeff is found the control is transferred to main ]*/		}		/*[ Divide row by diagonal coefficient ]*/		  		c = A[k][k];		for(j = k1;j<=N;j++)		   A[k][j] /= c;		B[k] /= c;   /*[ Eliminate unknown X[k] from row i ]*/		for(i = k1;i<=N; i++)		{		  c = A[i][k];		  for(j = k1;j<= N;j++)		 	A[i][j] -= c*A[k][j];		  B[i] -= c*B[k];		}	}/*[ Compute the last unknown ]*/	if((fabs(A[N][N]) - tol) > 0.0)	{	   B[N] /= A[N][N];/*[Apply back substitution to compute the remaining unknowns  ]*/	   for(l = 1;l<= N1;l++)	   {	      k = N - l;	      k1 = k +1;	      for(j = k1;j<=N;j++)			B[k] -= A[k][j]*B[j];	   }/*[Compute the value of the determinent ]*/	(*D) = 1.0;	for(i=1;i<=N;i++)	  (*D) *= A[i][i];   }  else  {  		printf("Singularity in Row %d 2",k);	   	(*D) = 0.0;   }            return;	}	 void Sys2(X,Y,G,H,F,Bc,Code,Dim,No)	float X[82],Y[82],G[81][162],H[81][81],F[81],Bc[161];	int   Code[161],Dim,No;{	/*[ This function computes the matrices G and H, and forms the system  A X = F; H is a square matrix (N,N); G is a rectangular matrix (N,2*N) ]*/		int NN,i,j,k,NF,NS,jj;	float A1,B1,A2,B2,q11,q21,q12,q22,u11,u21,u12,u22,ch;			NN = 2*N;	for(i=1;i<=N;i++)	{		for(j=1;j<=N;j++)			H[i][j] = 0.0;		for(j=1;j<=NN;j++)			G[i][j] = 0.0;	}	/*[ Compute the coeffitients of G and H  ]*/			X[N+1] = X[1];		Y[N+1] = Y[1];				for(i=1;i<=N;i++)		{			NF = i+1;			NS = i+N-2;			for(jj=NF;jj<=NS;jj++)			{				if((jj - N) > 0)					j = jj-N;				else					j = jj;				Quad2(X[i],Y[i],X[j],Y[j],X[j+1],Y[j+1],&A1,&A2,&B1,&B2,				&q11,&q21,&q12,&q22,&u11,&u21,&u12,&u22,0);							if((j-N) <0)					H[i][j+1] += A2;				else					H[i][1]   += A2;								H[i][j]    += A1;				G[i][2*j-1] = B1;				G[i][2*j]   = B2;				H[i][i]	   -= A1 + A2;			}						NF = i+N-1;			NS = i+N;			for(jj=NF;jj<=NS;jj++)			{				if((jj-N) > 0)					j = jj- N;				else					j = jj;				Diag2(X[j],Y[j],X[j+1],Y[j+1],&B1,&B2);				if((jj - NF) <= 0)				{					ch = B1;					B1 = B2;					B2 = ch;				}				G[i][2*j-1] = B1;				G[i][2*j]	= B2;			}		/*[ Add one to the diagonal coefficients for exterior problems ]*/						if(H[i][i] < 0.0)					H[i][i] += 2. * pi;		}					/*[ Reorder the columns of the system of Equations as in (5.28)	and form the system Matrix A which is stored in H ]*/		for(i=1;i<=N;i++)	{		for(j=1;j<=2;j++)		{			if(Code[2*i -2+j] <= 0)			{				if(!((i != N) || (j != 2)))					{					if(Code[1] > 0)					{						for(k=1;k<=N;k++)						{							ch      = H[k][1];							H[k][1] = -G[k][2*N]; 							G[k][2*N] = -ch;						}					}					else					{						for(k=1;k<=N;k++)						{							H[k][1] -= G[k][2*N];							G[k][2*N] = 0.0;						}					}				}				else				{					if((i == 1) || (j >1) || (Code[2*i-2] == 1))					{						for(k=1;k<=N;k++)						{							ch 				= H[k][i-1+j];							H[k][i-1+j]  	= -G[k][2*i - 2+j];							G[k][2*i - 2+j] = -ch;						}					}					else					{						for(k=1;k<=N;k++)						{							H[k][i] -= G[k][2*i-1];							G[k][2*i-1] = 0.0;						}					}				}			}		}	}																									/*[ Form the right-side vector F which is stored in F  ]*/ 			for(i=1;i<=N;i++)	{		F[i] = 0.0;		for(j=1;j<=NN;j++)			F[i] += G[i][j] * Bc[j];	}  }	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧洲国产日韩| 国产亚洲欧美日韩在线一区| 国产成人免费在线| 国产福利一区在线| 国产成人欧美日韩在线电影| 成人午夜伦理影院| 99re这里都是精品| 欧美亚洲禁片免费| 日韩亚洲欧美一区二区三区| 欧美大片一区二区| 国产色产综合产在线视频| 久久蜜桃一区二区| 国产精品免费丝袜| 亚洲一区中文在线| 婷婷中文字幕一区三区| 免费精品视频最新在线| 国产美女精品在线| 91麻豆福利精品推荐| 在线看国产一区| 欧美一区二区在线观看| 久久久久99精品国产片| 国产日本一区二区| 亚洲午夜久久久久久久久电影院 | 日韩亚洲欧美中文三级| 欧美tickling挠脚心丨vk| 久久久久久久久久电影| 亚洲欧洲精品一区二区精品久久久| 亚洲麻豆国产自偷在线| 免费在线观看日韩欧美| 成人免费视频国产在线观看| 欧美少妇bbb| 国产视频一区二区在线观看| 一区二区三区美女| 国产麻豆精品一区二区| 色婷婷国产精品| 久久免费的精品国产v∧| 一区二区三区精品| 粉嫩av亚洲一区二区图片| 精品视频在线看| 国产精品久久久久天堂| 全国精品久久少妇| 在线观看免费亚洲| 国产片一区二区三区| 视频一区欧美精品| 91成人国产精品| 国产精品色在线| 久久精品国产999大香线蕉| 色婷婷久久久综合中文字幕| 精品久久久久香蕉网| 视频一区欧美日韩| 欧美亚洲日本一区| 国产精品第四页| 国产精品综合在线视频| 日韩一区二区在线播放| 首页综合国产亚洲丝袜| 91福利精品第一导航| 中文字幕av不卡| 日本不卡一区二区三区高清视频| 国产91高潮流白浆在线麻豆 | 中国色在线观看另类| 麻豆精品在线视频| 欧美高清你懂得| 亚洲国产精品精华液网站| 91黄色免费版| 亚洲激情在线播放| 91视频免费播放| 国产精品久久福利| 99久久婷婷国产精品综合| 国产性色一区二区| 国产精品自拍网站| 久久男人中文字幕资源站| 激情综合色播激情啊| 日韩精品一区在线观看| 日本aⅴ免费视频一区二区三区| 欧美日韩aaaaaa| 亚洲成人一二三| 欧美精品乱码久久久久久| 亚洲无线码一区二区三区| 欧美性欧美巨大黑白大战| 亚洲制服丝袜在线| 欧美酷刑日本凌虐凌虐| 国产精品69毛片高清亚洲| 久久九九久精品国产免费直播| 国产一区二区三区四区在线观看| 久久久国产精品午夜一区ai换脸 | 亚洲国产精品av| 成人激情黄色小说| 亚洲欧美韩国综合色| 色综合久久99| 亚洲综合偷拍欧美一区色| 欧美日韩高清影院| 久久99精品久久久久久国产越南| 26uuu亚洲综合色| 国产成人免费视频网站| 亚洲欧美怡红院| 欧美久久高跟鞋激| 黄页网站大全一区二区| 国产精品久久久久久久裸模| 色综合欧美在线| 日韩不卡手机在线v区| 国产午夜亚洲精品午夜鲁丝片| va亚洲va日韩不卡在线观看| 亚洲福利电影网| 久久久精品2019中文字幕之3| 91在线观看成人| 青青草91视频| 亚洲精选免费视频| 日韩免费福利电影在线观看| av一区二区三区| 免费日韩伦理电影| 中文字幕一区二区视频| 欧美一区二区播放| 777午夜精品视频在线播放| 国模少妇一区二区三区| 亚洲自拍偷拍图区| 中文字幕 久热精品 视频在线| 欧美日韩午夜影院| 国产iv一区二区三区| 日韩高清欧美激情| 亚洲精品国产a| 国产视频一区二区在线| 日韩欧美中文字幕精品| 色视频成人在线观看免| 国产不卡在线播放| 久久66热偷产精品| 亚洲一区二三区| 国产精品入口麻豆九色| 欧美精品一区二区三区一线天视频| 在线国产亚洲欧美| av电影在线观看不卡| 国精产品一区一区三区mba桃花 | 欧美日韩激情一区| 不卡欧美aaaaa| 国产一区不卡在线| 蜜桃在线一区二区三区| 亚洲国产一区二区视频| 自拍偷拍国产亚洲| 久久久无码精品亚洲日韩按摩| 欧美一区二区在线观看| 欧美日韩精品一区二区三区蜜桃| 91久久精品一区二区三区| 成人一区二区三区中文字幕| 国精品**一区二区三区在线蜜桃| 日韩av在线播放中文字幕| 亚洲成人动漫在线免费观看| 亚洲精品中文在线观看| 国产精品久久久久久久久免费桃花 | 久久这里只有精品首页| 69p69国产精品| 91福利视频网站| 欧美在线制服丝袜| 在线一区二区视频| 精品视频在线免费| 69堂成人精品免费视频| 6080亚洲精品一区二区| 91精品久久久久久蜜臀| 欧美日韩黄视频| 日韩一级片网址| 精品国一区二区三区| 精品国产一区二区精华| 亚洲精品在线网站| 久久欧美中文字幕| 久久精品亚洲麻豆av一区二区 | 免费久久99精品国产| 日韩影院免费视频| 麻豆传媒一区二区三区| 久久99久久久久| 国产成人在线网站| 波多野结衣中文字幕一区二区三区| 成人免费观看视频| 91色在线porny| 欧美日韩免费一区二区三区视频 | 久久精品国产一区二区| 久草这里只有精品视频| 国产91色综合久久免费分享| 成人视屏免费看| 欧洲亚洲国产日韩| 欧美一区二区在线观看| 国产欧美一区二区三区网站| 亚洲色图一区二区| 日韩vs国产vs欧美| 国产精品亚洲а∨天堂免在线| 不卡av电影在线播放| 欧美老女人在线| 亚洲欧洲美洲综合色网| 免费视频最近日韩| av不卡一区二区三区| 911国产精品| 中文字幕一区二区三区乱码在线| 午夜伊人狠狠久久| 国产成人在线视频网站| 91麻豆国产福利在线观看| 日韩欧美国产一二三区| 一区二区三区免费网站| 国内精品伊人久久久久影院对白| 99re成人精品视频| 欧美精品一区二区高清在线观看| 综合激情网...| 丁香啪啪综合成人亚洲小说| 久久久久久久综合色一本|