title job1
$....MARC input file produced by Marc Mentat 2017.1.0 (64bit)
$...................................
$....input file using extended precision
extended
$...................................
sizing 0 100 121 0
alloc 25
elements 3
version 13
table 0 0 2 1 1 0 0 1
processor 1 1 1 0
$no list
all points
no echo 1 2 3
end
$...................
solver
8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
optimize 11
points
7 1.000000000000000+0 0.000000000000000+0 0.000000000000000+0
8 1.000000000000000+1 0.000000000000000+0 0.000000000000000+0
15 6.12323399573677-17 1.000000000000000+0 0.000000000000000+0
16 0.000000000000000+0 1.000000000000000+1 0.000000000000000+0
connectivity
0 0 1 0 1 1 0 0 0
1 3 12 13 2 1
2 3 13 14 3 2
3 3 14 15 4 3
4 3 15 16 5 4
5 3 16 17 6 5
6 3 17 18 7 6
7 3 18 19 8 7
8 3 19 20 9 8
9 3 20 21 10 9
10 3 21 22 11 10
11 3 23 24 13 12
12 3 24 25 14 13
13 3 25 26 15 14
14 3 26 27 16 15
15 3 27 28 17 16
16 3 28 29 18 17
17 3 29 30 19 18
18 3 30 31 20 19
19 3 31 32 21 20
20 3 32 33 22 21
21 3 34 35 24 23
22 3 35 36 25 24
23 3 36 37 26 25
24 3 37 38 27 26
25 3 38 39 28 27
26 3 39 40 29 28
27 3 40 41 30 29
28 3 41 42 31 30
29 3 42 43 32 31
30 3 43 44 33 32
31 3 45 46 35 34
32 3 46 47 36 35
33 3 47 48 37 36
34 3 48 49 38 37
35 3 49 50 39 38
36 3 50 51 40 39
37 3 51 52 41 40
38 3 52 53 42 41
39 3 53 54 43 42
coordinates
3 121 0 1
1 1.000000000000000+0 0.000000000000000+0 0.000000000000000+0
2 9.894434504817674-1 1.449194890231615-1 0.000000000000000+0
3 9.558632461069742-1 2.938119377115879-1 0.000000000000000+0
4 8.973756499953726-1 4.412674277525846-1 0.000000000000000+0
5 8.138260360510751-1 5.811085811149188-1 0.000000000000000+0
6 7.071067811865476-1 7.071067811865476-1 0.000000000000000+0
7 5.811085811149190-1 8.138260360510753-1 0.000000000000000+0
8 4.412674277525846-1 8.973756499953726-1 0.000000000000000+0
9 2.938119377115880-1 9.558632461069740-1 0.000000000000000+0
10 1.449194890231618-1 9.894434504817674-1 0.000000000000000+0
11 2.18241585825745-16 1.000000000000000+0 0.000000000000000+0
12 1.090000000000000+0 0.000000000000000+0 0.000000000000000+0
13 1.084510927125266+0 1.644918453121334-1 0.000000000000000+0
14 1.055554855713800+0 3.346644660942546-1 0.000000000000000+0
15 1.001024805998978+0 5.045632331609336-1 0.000000000000000+0
16 9.205406158528394-1 6.672928710563322-1 0.000000000000000+0
17 8.157933208433636-1 8.157933208433636-1 0.000000000000000+0
18 6.672928710563322-1 9.205406158528392-1 0.000000000000000+0
19 5.045632331609336-1 1.001024805998978+0 0.000000000000000+0
20 3.346644660942547-1 1.055554855713800+0 0.000000000000000+0
21 1.644918453121337-1 1.084510927125266+0 0.000000000000000+0
22 2.38263630459991-16 1.090000000000000+0 0.000000000000000+0
23 1.360000000000000+0 0.000000000000000+0 0.000000000000000+0
24 1.369079850267447+0 2.230784887064253-1 0.000000000000000+0
25 1.353397582474839+0 4.567171493297264-1 0.000000000000000+0
26 1.310237337466211+0 6.933911694047396-1 0.000000000000000+0
27 1.238603116154034+0 9.241649010673230-1 0.000000000000000+0
28 1.139630472961694+0 1.139630472961694+0 0.000000000000000+0
29 9.241649010673232-1 1.238603116154034+0 0.000000000000000+0
30 6.933911694047396-1 1.310237337466211+0 0.000000000000000+0
31 4.567171493297264-1 1.353397582474839+0 0.000000000000000+0
32 2.230784887064256-1 1.369079850267447+0 0.000000000000000+0
33 2.98329764362728-16 1.360000000000000+0 0.000000000000000+0
34 1.810000000000000+0 0.000000000000000+0 0.000000000000000+0
35 1.841260224163052+0 3.202903095818325-1 0.000000000000000+0
36 1.845732994462190+0 6.584708021329012-1 0.000000000000000+0
37 1.819880532730269+0 1.004616824864984+0 0.000000000000000+0
38 1.761870476949361+0 1.346763444054014+0 0.000000000000000+0
39 1.672063491925692+0 1.672063491925692+0 0.000000000000000+0
40 1.346763444054014+0 1.761870476949361+0 0.000000000000000+0
define node set apply1_nodes
11 22 33 44 55 66 77 88 99 110 121
define node set apply2_nodes
1 12 23 34 45 56 67 78 89 100 111
define edgemt set apply3_edges
96:0 to 100:0
sizing 0 100 121 0
alloc 25
elements 3
fcode 发表于 2020-3-16 18:01
对 marc 不了解。
你得先确定,你要读取的这些数据,是多少个?
个数是确定的,不变的。还是需要从输出文件 ...
fcode 发表于 2020-3-16 22:10
所以,你并没有回答我“如何确定points,coordinates和coonectivity的大小”
4.85 KB, 下载次数: 1
Program www_fcode_cn implicit none
Character(len=512) :: cStr
integer :: k , nUnit = 0 , nNode = 0
Character(len=*) , parameter :: C_SIZING = 'sizing' , &
C_POINTS = 'points' , &
C_CONNECTIVITY = 'connectivity' , &
C_COORDINATES = 'coordinates'
integer , allocatable :: connectivity(:,:)
real , allocatable :: coordinates(:,:)
Open(12,File="model1_job1.dat")
Do
read(12,'(a512)',ioStat=k) cStr
if(k/=0) exit
cStr = adjustl(cStr)
if( cStr(:len(C_SIZING)) == C_SIZING ) then
read(cStr,*) cStr , k , nUnit , nNode
else if( cStr(:len(C_POINTS)) == C_POINTS ) then
!//此处可读取points
else if( cStr(:len(C_CONNECTIVITY)) == C_CONNECTIVITY ) then
read(12,'(a512)',ioStat=k) cStr
if(k/=0) exit
if( nUnit <= 0 ) cycle
Allocate( connectivity(6,nUnit) )
read(12,*) connectivity
else if( cStr(:len(C_COORDINATES)) == C_COORDINATES ) then
read(12,'(a512)',ioStat=k) cStr
if(k/=0) exit
if( nNode <= 0 ) cycle
Allocate( coordinates(4,nNode) )
read(12,*) coordinates
end if
End Do
Close(12)
Open(12,File="out.txt")
Do k = 1 , size(connectivity,2)
write(12,*) connectivity(:,k)
End Do
Do k = 1 , size(coordinates,2)
write(12,*) coordinates(:,k)
End Do
Close(12)
End Program www_fcode_cn
2.16 KB, 下载次数: 0
5.1 KB, 下载次数: 0
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |