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

📄 xinput.m

📁 别人的边界元程序
💻 M
字号:
function zx=xinput()

%%   *****input the data used in this bem program *****   
%%
global gi ome
global mtype nord
global x y z
global icod kcd fi tk tq
global nodbs numbs
global l cx cy cz 

%%  open the data files
fidr=fopen('data.txt','r');
fidw=fopen('bem3.out','w');
%%   input nodes information
s=fgetl(fidr);
fprintf(fidw,strcat(s,'\n'));
s=fgetl(fidr);
gss=sscanf(s,'%i %i %i %i');
nodbs=gss(1);
numbs=gss(2);
mtype=gss(3);
ksym=gss(4);

for i=1:nodbs
    s=fgetl(fidr);
    gs=sscanf(s,'%i %f %f %f %f %i %i');
    x(i)=gs(2);
    y(i)=gs(3);
    z(i)=gs(4);
    fi(i)=gs(5);
    kcd(i)=gs(6);
end
%%  input element information
for ie=1:numbs
    s=fgetl(fidr);
    gs=sscanf(s,'%i %i %i %i');
    nord(ie,:)=gs(:);
end

tk(:,:)=0;
tq(:,:)=0;

for j=1:nodbs
    for ie=1:numbs
        for i=1:4
            if j==nord(ie,i)
                icod(ie,i)=kcd(j)+1;  
                switch icod(ie,i)
                    case 1
                        tk(ie,i)=fi(j);
                    case 2
                        tq(ie,i)=fi(j);
                end                
            end
        end
    end
end
%%  inner point information
s=fgetl(fidr);
l=sscanf(s,'%i');
for in=1:l
    s=fgetl(fidr);
    gs=sscanf(s,'%f %f %f');
    cx(in)=gs(1);
    cy(in)=gs(2);
    cz(in)=gs(3);
end
%%
gi(1,:)=0.9324695142;
gi(2,:)=0.6612093865;
gi(3,:)=0.2386191861;
gi(4,:)=-0.2386191861;
gi(5,:)=-0.6612093865;
gi(6,:)=-0.9324695142;

ome(1,:)=0.1713244924;
ome(2,:)=0.3607615731;
ome(3,:)=0.4679139346;
ome(4,:)=0.4679139346;
ome(5,:)=0.3607615731;
ome(6,:)=0.1713244924;
%%
fclose(fidr);
fclose(fidw);
zx=1;
return

⌨️ 快捷键说明

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