[Fortran] 纯文本查看 复制代码
program Mesh_reflection
implicit none
integer::i_node,i_element
integer::n_node1,n_element1,n_node2,n_element2
integer,allocatable::ij_element1(:,:),ij_element2(:,:)
real(8),allocatable::coordinate_n1(:,:),coordinate_n2(:,:),stress_1(:,:),stress_2(:,:)
open(unit=4,file="data.txt")
open(unit=5,file="mdata_new.txt")
read(4,*)n_node1,n_element1
read(5,*)n_node2,n_element2
allocate(ij_element1(n_node1,4),ij_element2(n_node2,4),coordinate_n1(n_node1,2),coordinate_n2(n_node2,2) ,stress_1(n_node1,4),stress_2(n_node2,4))
!读入数据.
do i_node=1,n_node1
read(4,*)coordinate_n1(i_node,1),coordinate_n1(i_node,2)
end do
do i_element=1,n_element1
read(4,*)ij_element1(i_element,:)
end do
do i_node=1,n_node2
read(5,*)coordinate_n2(i_node,:)
end do
do i_element=1,n_element2
read(5,*)ij_element2(i_element,:)
enddo
write(4,*)coordinate_n1(i_node,1),coordinate_n1(i_node,2)
endprogram