📄 inter2.c
字号:
#include "cbox2.h"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; } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -