Revision 495
(checked in by cbc, 12 years ago)
|
Initial import of Stark code.
|
Line | |
---|
1 |
function write_inp_2d(inpfile,x,y,in,scalar) |
---|
2 |
% |
---|
3 |
% Determine required indexes |
---|
4 |
% |
---|
5 |
size(x); |
---|
6 |
nn=ans(1) |
---|
7 |
size(in); |
---|
8 |
ne=ans(1) |
---|
9 |
size(scalar); |
---|
10 |
nsca=ans(2) |
---|
11 |
% |
---|
12 |
% Open and write file |
---|
13 |
% |
---|
14 |
fid=fopen(inpfile,'w'); |
---|
15 |
fprintf(fid,'%6.0f %6.0f %1.0f 0 0\n',nn,ne,nsca); |
---|
16 |
for i=1:nn |
---|
17 |
fprintf(fid,'%6.0f %9.4e %9.4e 0.0\n',i,x(i),y(i)); |
---|
18 |
end |
---|
19 |
for i=1:ne |
---|
20 |
fprintf(fid,'%6.0f 1 tri %6.0f %6.0f %6.0f\n',i,in(i,1),in(i,2),in(i,3)); |
---|
21 |
end |
---|
22 |
fprintf(fid,'%1.0f',nsca); |
---|
23 |
for i=1:nsca |
---|
24 |
fprintf(fid,' %1.0f',1); |
---|
25 |
end |
---|
26 |
fprintf(fid,'\n'); |
---|
27 |
for i=1:nsca |
---|
28 |
fprintf(fid,'sca%1.0f ,m\n',i); |
---|
29 |
end |
---|
30 |
for i=1:nn |
---|
31 |
fprintf(fid,'%6.0f ',i); |
---|
32 |
for j=1:nsca |
---|
33 |
fprintf(fid,'%9.4e ',scalar(i,j)); |
---|
34 |
end |
---|
35 |
fprintf(fid,'\n'); |
---|
36 |
end |
---|
37 |
return |
---|
38 |
|
---|