34 sdeg, xx_loc, yy_loc, zz_loc, cs_nnz_loc, &
43 integer*4 :: nm, nel_loc, nn_loc, cs_nnz_loc, mpi_id
44 integer*4 :: ie, inode, nn, im
46 integer*4 :: ic1, ic2, ic3, ic4, ic5, ic6, ic7, ic8
48 real*8 :: lambda, mu, qs, qp, dum, gamma
50 integer*4,
dimension(nm) :: sdeg, tag_mat
51 integer*4,
dimension(nn_loc) :: loc_n_num, mat_id
52 integer*4,
dimension(0:cs_nnz_loc) :: cs_loc
54 real*8,
dimension(nm,4) :: prop_mat
55 real*8,
dimension(nn_loc) :: xx_loc, yy_loc, zz_loc
56 real*8,
dimension(nn_loc) :: rho, vs, vp, poisn
58 character*70 :: file_nhe_proc, file_nhe_new, mpi_file
69 nel_loc = cs_loc(0) - 1
72 im = cs_loc(cs_loc(ie -1) + 0 )
73 mat_id(cs_loc(cs_loc(ie-1) + 1 : cs_loc(ie)-1)) = im
78 rho(inode) = prop_mat(mat_id(inode),1);
79 lambda = prop_mat(mat_id(inode),2);
80 mu = prop_mat(mat_id(inode),3);
81 gamma = prop_mat(mat_id(inode),4)
83 vs(inode) = sqrt(mu/rho(inode))
84 vp(inode) = sqrt((lambda/rho(inode)) + (2.d0*vs(inode)**2.d0))
85 dum = (vp(inode)/vs(inode))**2.d0
86 poisn(inode) = 0.5d0*(dum-2)/(dum-1)
90 if (mpi_id.eq.0)
write(*,
'(A)')
91 if (mpi_id.eq.0)
write(*,
'(A)')
'------Writing VTK file - Mechanical Properties----------'
94 unit_mpi = 2500 + mpi_id
96 write(file_nhe_proc,
'(A10,I5.5,A4)')
'DIS_X_PROC', mpi_id,
'.vtk'
98 if(len_trim(mpi_file) .ne. 70)
then
99 file_nhe_new = mpi_file(1:len_trim(mpi_file)) //
'/' // file_nhe_proc
101 file_nhe_new = file_nhe_proc
105 open(unit_mpi,file=file_nhe_new,status=
'replace')
106 write(unit_mpi,
'(a)')
'# vtk DataFile Version 3.1'
107 write(unit_mpi,
'(a)')
'material model VTK file'
108 write(unit_mpi,
'(a)')
'ASCII'
109 write(unit_mpi,
'(a)')
'DATASET UNSTRUCTURED_GRID'
110 write(unit_mpi,
'(a,i12,a)')
'POINTS ', nn_loc,
' float'
114 write(unit_mpi,
'(3e20.12)') xx_loc(inode),yy_loc(inode),zz_loc(inode)
119 write(unit_mpi,
'(a,i12,i12)')
"CELLS ",nel_loc,nel_loc*9
121 im = cs_loc(cs_loc(ie -1) + 0 )
124 ic1 = cs_loc(cs_loc(ie -1) + nn*nn*(1 -1) + nn*(1 -1) + 1) - 1
125 ic2 = cs_loc(cs_loc(ie -1) + nn*nn*(1 -1) + nn*(1 -1) + nn) - 1
126 ic3 = cs_loc(cs_loc(ie -1) + nn*nn*(1 -1) + nn*(nn -1) + nn) - 1
127 ic4 = cs_loc(cs_loc(ie -1) + nn*nn*(1 -1) + nn*(nn -1) + 1) - 1
128 ic5 = cs_loc(cs_loc(ie -1) + nn*nn*(nn -1) + nn*(1 -1) + 1) - 1
129 ic6 = cs_loc(cs_loc(ie -1) + nn*nn*(nn -1) + nn*(1 -1) + nn) - 1
130 ic7 = cs_loc(cs_loc(ie -1) + nn*nn*(nn -1) + nn*(nn -1) + nn) - 1
131 ic8 = cs_loc(cs_loc(ie -1) + nn*nn*(nn -1) + nn*(nn -1) + 1) - 1
133 write(unit_mpi,
'(9i12)') 8, ic1, ic2, ic3, ic4, ic5, ic6, ic7, ic8
138 write(unit_mpi,
'(a,i12)')
"CELL_TYPES ",nel_loc
139 write(unit_mpi,
'(6i12)') (12,ie=1,nel_loc)
184 if (mpi_id.eq.0)
write(*,
'(A)')
'Completed.'
subroutine write_vtk_mesh(nn_loc, loc_n_num, nm, tag_mat, prop_mat, sdeg, xx_loc, yy_loc, zz_loc, cs_nnz_loc, cs_loc, mpi_id)
...Writing VTK file to visualise in Paraview