Newer
Older
MODULE definitions
type structure
integer,dimension(:),pointer::octree
integer noctree,nnode,nleaves
integer nelemr,nlsf
double precision,dimension(:),pointer::x,y,z
Dave Whipp
committed
double precision,dimension(:),pointer::u,v,w,wiso,temp,pressure,strain
double precision,dimension(:),pointer::nodal_pressure,spressure
double precision,dimension(:),pointer::e2d,eviscosity
double precision,dimension(:),pointer::crit,dilatr,yield_ratio,frict_angle
integer,dimension(:,:),pointer::icon,iconr
double precision,dimension(:,:),pointer:: lsf
integer,dimension(:),pointer::on(:),is_plastic,matnum
logical, dimension(:), pointer :: whole_leaf_in_fluid
end type structure
type sheet
integer nsurface,nt
double precision,dimension(:),pointer::r,s,x,y,z,xn,yn,zn,u,v,w
integer,dimension(:,:),pointer::icon
integer nhull,levelt,itype,material
end type sheet
type cloud
double precision,dimension(:),pointer::x,y,z,x0,y0,z0,strain,lsf0,temp,press
integer,dimension(:),pointer::tag
end type cloud
END MODULE definitions
!==============================================================================!
!==============================================================================!
! |
! ||===\\ |
! || \\ |
! || || //==\\ || || //==|| ||/==\\ |
! || || || || || || || || || || |
! || // || || || || || || || |
! ||===// \\==// \\==\\ \\==\\ || |
! |
!==============================================================================!
!==============================================================================!
! |
! POST PROCESSING Apr. 2008 |
! |
!==============================================================================!
!==============================================================================!
program data_postprocessing
use definitions
implicit none
type (sheet),dimension(:),allocatable::surface
type(structure),SAVE :: ov
integer :: ie,mer,nn,ner,i,i1,i2,i3,i4,i5,kfx,kfy,kfz,kft
integer :: iunit,ilsf,nne,is,k,npcl,j,np,nl,npclv
integer :: output_u_field
integer :: output_v_field
integer :: output_w_field
integer :: output_velo_vect
integer :: output_preiso_velo_vect
integer :: output_press_fieldn
integer :: output_press_fielde
integer :: output_smooth_press_fielde
integer :: output_countnode_field
integer :: output_elem_matnum
integer :: output_e2d_fielde
integer :: output_e2d_fieldn
integer :: output_eviscosity_fielde
integer :: output_is_plastic_fielde
integer :: output_yield_ratio_fielde
integer :: output_frict_angle_fielde
integer :: output_crit_field
integer :: output_strain_field
integer :: output_lsf_field
integer :: output_surface_icon
integer :: output_strain_tensor
integer :: output_ps
integer :: output_cubes
integer :: output_rivers
integer :: output_regular
integer :: output_cloud
integer :: output_cloud0
integer iproc,nproc,ierr,nnn,nnne,nnnep,levelmax,ix,iy,iz,nlinks,iordermin
integer iconmin,iconmax
integer,dimension(:),allocatable::nstrain,donor,order
integer,dimension(:),allocatable::levs,li
integer,dimension(:),allocatable::invoid,elvoid,rtf,ftr
integer myicon(100),nstep,ndir,iter,ii,lsf,levmax
integer vermajor,verminor,verstat,verrev
integer input_vermajor,input_verminor
integer output_vermajor,output_verminor,output_verstat,output_verrev
logical,dimension(:),allocatable::influid,do_it,subset_leaves,instrain
character clsf*3,c4*4,cc4*4,dir*128
double precision :: eps,dil,current_time,activation_time,zmin,xx,yy,zz,maxe2d,dist
double precision, allocatable, dimension (:) :: ov_nodee2d, ov_nodecrit
double precision, allocatable, dimension (:) :: countnode
Dave Whipp
committed
double precision,dimension(:,:),allocatable::s,n1,n2,n3,zisodisp
double precision,dimension(:,:,:),allocatable::strain,strainn
double precision,dimension(:),allocatable::xi,yi,zi,ui,vi,wi,si,ei
double precision,dimension(:),allocatable::s11,s12,s13,s22,s23,s33,str11,str12,str13,str22,str23,str33
double precision,dimension(:),allocatable::azimuth1,azimuth3,dip1,dip3
double precision zmax,dz,l1,l2,l3,n11,n12,n13,n21,n22,n23,n31,n32,n33,con,dxy
double precision :: sselemx,sselemy,sselemz,xminls,yminls,zminls,usum,vsum,wsum
double precision :: uvwsum,disp,wmod
integer icut
!==============================================================================!
!==============================================================================!
call system('clear')
nne=8
! Post-processor version number
! vermajor is incremented for major rewrites
! verminor is incremented for significant revisions or changes to the input or
! output files
! verstat is used to designated the current code status: 0=alpha, 1=beta, 2=rc
! 3=release
! verrev is incremented for minor changes and bugfixes
vermajor=0
verminor=2
verstat=0
write (*,'(a)') '!------------------------------------------------------------------------------|'
write (*,'(a)') '!------------------------------------------------------------------------------|'
write (*,'(a)') '! |'
write (*,'(a)') '! 8888888b. .d88888b. 888 888 d8888 8888888b. |'
write (*,'(a)') '! 888 "Y88b d88P" "Y88b 888 888 d88888 888 Y88b |'
write (*,'(a)') '! 888 888 888 888 888 888 d88P888 888 888 |'
write (*,'(a)') '! 888 888 888 888 888 888 d88P 888 888 d88P |'
write (*,'(a)') '! 888 888 888 888 888 888 d88P 888 8888888P" |'
write (*,'(a)') '! 888 888 888 888 888 888 d88P 888 888 T88b |'
write (*,'(a)') '! 888 .d88P Y88b. .d88P Y88b. .d88P d8888888888 888 T88b |'
write (*,'(a)') '! 8888888P" "Y88888P" "Y88888P" d88P 888 888 T88b |'
write (*,'(a)') '! |'
write (*,'(a,i1,a,i1,a,i1,a,i1,a)') '! DOUAR-WSMP post-processor version ',vermajor,'.',verminor,'.',verstat,'.',verrev,' |'
write (*,'(a)') '!------------------------------------------------------------------------------|'
write (*,'(a)') '!------------------------------------------------------------------------------|'
write (*,'(a)') '1. Please enter the directory name containing DOUAR output.'
write (*,'(a)') ' NOTE: The directory name should be relative to one level above the working'
write (*,'(a)') ' directory. The default value is "OUT" (i.e., "../OUT")'
read (*,'(a)') dir
ndir=len_trim(dir)
if (ndir.eq.0) then
ndir=3
dir(1:ndir)='OUT'
endif
write (*,'(a)') '2. Please enter the output time step.'
read*,nstep
write (c4,'(i4)') nstep
if (nstep.lt.1000) c4(1:1)='0'
if (nstep.lt.100) c4(1:2)='00'
if (nstep.lt.10) c4(1:3)='000'
write (*,'(a)') '3. Is the output file a debug file? ("y" or "n")'
read (*,'(a)') cs
select case (cs)
case ('y','Y','yes','Yes')
write (*,'(a)') '3a. Please enter the debug file grid iteration number: '
read*,iter
write (cc4,'(i4)') iter
if (iter.lt.1000) cc4(1:1)='0'
if (iter.lt.100) cc4(1:2)='00'
if (iter.lt.10) cc4(1:3)='000'
write (*,'(a)') 'Output file is not a debug file.'
write (*,'(a)') 'Error: Response must be either "y" or "n". Please rerun the post-processor.'
write (*,'(a)') '4. Is this a nested model? ("y" or "n")'
select case (trim(nestin))
case ('y','Y','yes','Yes')
nest=.true.
case ('n','N','no','No')
nest=.false.
case default
write (*,'(a)') 'Error: Response must be either "y" or "n". Please rerun the post-processor.'
write (*,'(a)') 'Exiting...'
!==============================================================================
!==============================================================================
write(*,'(a)') ''
write(*,'(a)') '**************************************************************************'
write(*,'(a)') '--------------------------------------------------------------------------'
write(*,'(a)') '--------------------------------------------------------------------------'
write(*,'(a)') '------------------- VTK file production in progress ----------------------'
write(*,'(a)') '--------------------------------------------------------------------------'
write(*,'(a)') '--------------------------------------------------------------------------'
write(*,'(a,a,a,a,a,a,a,a,a)') 'Processing output file ', '../'//dir(1:ndir)//'/time_'//c4//'_'//cc4//'.bin'
open(unit=7,file='../'//dir(1:ndir)//'/time_'//c4//'_'//cc4//'.bin',status='old',form='unformatted')
else
write(*,'(a,a,a,a,a,a,a)') 'Processing output file ', '../'//dir(1:ndir)//'/time_'//c4//'.bin'
open(unit=7,file='../'//dir(1:ndir)//'/time_'//c4//'.bin',status='old',form='unformatted')
end if
write(*,'(a)') '--------------------------------------------------------------------------'
open(unit=77,file='input_of_outputs.txt',status='old')
read(77,*) input_vermajor
read(77,*) input_verminor
write(*,'(a,i1,a,i1)') 'Post-processor input file version ',input_vermajor,'.',input_verminor
if (vermajor/=input_vermajor .or. verminor/=input_verminor) then
write (*,'(a)') 'Error: Post-processor version and post input file version do not agree.'
write (*,'(a,i1,a,i1)') 'Post-processor version: ',vermajor,'.',verminor
write (*,'(a,i1,a,i1)') 'Post input file version: ',input_vermajor,'.',input_verminor
write (*,'(a)') 'Unable to continue. Exiting.'
stop
endif
write(*,'(a)') '--------------------------------------------------------------------------'
read(77,*) output_w_field
read(77,*) output_velo_vect
read(77,*) output_preiso_velo_vect
read(77,*) output_press_fieldn
read(77,*) output_press_fielde
read(77,*) output_smooth_press_fielde
read(77,*) output_countnode_field
read(77,*) output_temp_field
read(77,*) output_elem_matnum
read(77,*) output_e2d_fielde
read(77,*) output_e2d_fieldn
read(77,*) output_eviscosity_fielde
read(77,*) output_is_plastic_fielde
read(77,*) output_yield_ratio_fielde
read(77,*) output_frict_angle_fielde
read(77,*) output_crit_field
read(77,*) output_strain_field
read(77,*) output_lsf_field
read(77,*) output_surface_icon
read(77,*) output_strain_tensor
read(77,*) output_ps
read(77,*) output_cubes
read(77,*) output_rivers
read(77,*) output_regular
read(77,*) output_cloud
read(77,*) output_cloud0
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
write(*,'(a,l)') 'output u field ->',(output_u_field==1)
write(*,'(a,l)') 'output v field ->',(output_v_field==1)
write(*,'(a,l)') 'output w field ->',(output_w_field==1)
write(*,'(a,l)') 'output velo vectors ->',(output_velo_vect==1)
write(*,'(a,l)') 'output preiso velo vectors->',(output_preiso_velo_vect==1)
write(*,'(a,l)') 'output iso velo vectors ->',(output_preiso_velo_vect==1)
write(*,'(a,l)') 'output disp field ->',(output_disp_field==1)
write(*,'(a,l)') 'output node press field ->',(output_press_fieldn==1)
write(*,'(a,l)') 'output raw press field ->',(output_press_fielde==1)
write(*,'(a,l)') 'output smooth press field ->',(output_smooth_press_fielde==1)
write(*,'(a,l)') 'output countnode field ->',(output_countnode_field==1)
write(*,'(a,l)') 'output temp field ->',(output_temp_field==1)
write(*,'(a,l)') 'output elem material # ->',(output_elem_matnum==1)
write(*,'(a,l)') 'output elemental e2d field->',(output_e2d_fielde==1)
write(*,'(a,l)') 'output nodal e2d field ->',(output_e2d_fieldn==1)
write(*,'(a,l)') 'output elem eff viscosity ->',(output_eviscosity_fielde==1)
write(*,'(a,l)') 'output element is plastic ->',(output_is_plastic_fielde==1)
write(*,'(a,l)') 'output element yield ratio->',(output_yield_ratio_fielde==1)
write(*,'(a,l)') 'output elem friction angle->',(output_frict_angle_fielde==1)
write(*,'(a,l)') 'output element dilat rate ->',(output_dilatr_fielde==1)
write(*,'(a,l)') 'output crit field ->',(output_crit_field==1)
write(*,'(a,l)') 'output strain field ->',(output_strain_field==1)
write(*,'(a,l)') 'output lsf field ->',(output_lsf_field==1)
write(*,'(a,l)') 'output surfaces icon ->',(output_surface_icon==1)
write(*,'(a,l)') 'output strain tensor ->',(output_strain_tensor==1)
write(*,'(a,l)') 'output principal stresses ->',(output_ps==1)
write(*,'(a,l)') 'output elemental fields ->',(output_cubes==1)
write(*,'(a,l)') 'output rivers ->',(output_rivers==1)
write(*,'(a,l)') 'output regular ->',(output_regular==1)
write(*,'(a,l)') 'output zisodisp ->',(output_zisodisp==1)
write(*,'(a,l)') 'output cloud ->',(output_cloud==1)
write(*,'(a,l)') 'output cloud0 ->',(output_cloud0==1)
write(*,'(a)') '--------------------------------------------------------------------------'
!==============================================================================!
!==============================================================================!
read(7) output_vermajor,output_verminor,output_verstat,output_verrev
if (vermajor/=output_vermajor .or. verminor/=output_verminor) then
write (*,'(a)') 'Error: Post-processor version and DOUAR version do not agree.'
write (*,'(a,i1,a,i1)') 'Post-processor version: ',vermajor,'.',verminor
write (*,'(a,i1,a,i1)') 'DOUAR version: ',output_vermajor,'.',output_verminor
write (*,'(a)') 'Unable to continue. Exiting.'
stop
else
write (*,'(a,i1,a,i1,a,i1,a,i1)') 'Reading output from DOUAR-WSMP v',output_vermajor,'.',output_verminor,'.',output_verstat,'.',output_verrev
endif
write(*,'(a)') '--------------------------------------------------------------------------'
read (7) ov%noctree,ov%nnode,ov%nleaves,ner,ov%nlsf,npcl,current_time
nn=ov%nnode
allocate(ov%on(nn))
allocate(ov%x(nn),ov%y(nn),ov%z(nn))
Dave Whipp
committed
allocate(ov%u(nn),ov%v(nn),ov%w(nn),ov%wiso(nn))
allocate(ov%pressure(ov%nleaves),ov%strain(nn))
allocate(ov%e2d(ov%nleaves),ov%eviscosity(ov%nleaves),ov%is_plastic(ov%nleaves))
allocate(ov%dilatr(ov%nleaves),ov%whole_leaf_in_fluid(ov%nleaves))
allocate(ov%crit(ov%nleaves),ov%matnum(ov%nleaves),ov%yield_ratio(ov%nleaves))
allocate(ov%frict_angle(ov%nleaves))
allocate(ov%temp(nn))
allocate(ov%lsf(nn,ov%nlsf))
allocate(influid(nn))
allocate(invoid(nn))
allocate(rtf(nn),ftr(nn),elvoid(nn))
allocate(surface(ov%nlsf))
allocate(ov%nodal_pressure(nn),ov%spressure(ov%nleaves))
allocate(ov%icon(8,ov%nleaves))
allocate(ov%octree(ov%noctree))
allocate(cl%x(npcl),cl%y(npcl),cl%z(npcl),cl%x0(npcl),cl%y0(npcl),cl%z0(npcl))
allocate(cl%strain(npcl),cl%lsf0(npcl),cl%temp(npcl),cl%press(npcl))
allocate(cl%tag(npcl))
!========================
!=====[nodal values]=====
!========================
read(7)(ov%x(i),ov%y(i),ov%z(i), &
ov%u(i),ov%v(i),ov%w(i), &
ov%lsf(i,1:ov%nlsf), &
ov%temp(i), &
ov%nodal_pressure(i), &
ov%strain(i), &
kfx,kfy,kfz,kft,i=1,nn)
!======================
!=====[icon array]=====
!======================
read(7) (ov%icon(1:8,ie), &
ov%pressure(ie), &
ov%spressure(ie), &
ov%eviscosity(ie), &
ov%is_plastic(ie), &
ov%dilatr(ie), &
ov%frict_angle(ie), &
ov%whole_leaf_in_fluid(ie), &
ie=1,ov%nleaves)
!==============================
!=====[octree information]=====
!==============================
read(7) (ov%octree(i),i=1,ov%noctree)
!================================
!=====[bad face information]=====
!================================
mer=ner ! mer=1
if(ner.gt.mer)mer=ner
allocate(ov%iconr(9,mer))
read(7) (ov%iconr(1:9,ie),ie=1,ner)
ov%nelemr=ner
!============================
!=====[void information]=====
!============================
read (7) (invoid(i),elvoid(i),ftr(i),rtf(i),influid(i),i=1,nn)
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
ov%on=0
do i=1,nn
if (influid(i)) ov%on(i)=1
enddo
read(7) (i5,i=1,ner)
!==============================================================
!=====[measure work, strain, compute principal directions]=====
!==============================================================
allocate (s (3,ov%nleaves))
allocate (n1(3,ov%nleaves))
allocate (n2(3,ov%nleaves))
allocate (n3(3,ov%nleaves))
allocate (strain(3,3,ov%nleaves))
call find_volumes (ov%icon,ov%octree,ov%noctree,ov%nleaves,ov%lsf,ov%nlsf,ov%nnode,influid, &
ov%x,ov%y,ov%z,ov%u,ov%v,ov%w,s,n1,n2,n3,strain)
! rescaling of the values for plotting purposes
s=s/maxval(abs(s))*.01
strain=strain/maxval(abs(strain))*.01
!===============================
!=====[surface information]=====
!===============================
do is=1,ov%nlsf
read(7) surface(is)%nsurface,activation_time,surface(is)%nt
allocate (surface(is)%x(surface(is)%nsurface), &
surface(is)%y(surface(is)%nsurface), &
surface(is)%z(surface(is)%nsurface), &
surface(is)%xn(surface(is)%nsurface), &
surface(is)%yn(surface(is)%nsurface), &
surface(is)%zn(surface(is)%nsurface), &
surface(is)%r(surface(is)%nsurface), &
surface(is)%s(surface(is)%nsurface), &
surface(is)%u(surface(is)%nsurface), &
surface(is)%v(surface(is)%nsurface), &
surface(is)%w(surface(is)%nsurface), &
surface(is)%icon(3,surface(is)%nt))
if (cs=='y') then
read (7) (surface(is)%r(i),surface(is)%s(i), &
surface(is)%x(i),surface(is)%y(i),surface(is)%z(i), &
surface(is)%xn(i),surface(is)%yn(i),surface(is)%zn(i), &
i=1,surface(is)%nsurface)
else
read (7) (surface(is)%r(i),surface(is)%s(i), &
surface(is)%x(i),surface(is)%y(i),surface(is)%z(i), &
surface(is)%xn(i),surface(is)%yn(i),surface(is)%zn(i), &
surface(is)%u(i),surface(is)%v(i),surface(is)%w(i), &
i=1,surface(is)%nsurface)
end if
read (7) (surface(is)%icon(1:3,i),i=1,surface(is)%nt)
end do
Dave Whipp
committed
!=============================
!=====[cloud information]=====
!=============================
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
!read (7) (dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpdp, &
! dumpi, &
! i=1,npcl)
read (7) (cl%x(i), &
cl%y(i), &
cl%z(i), &
cl%x0(i), &
cl%y0(i), &
cl%z0(i), &
cl%strain(i), &
cl%lsf0(i), &
cl%temp(i), &
cl%press(i), &
cl%tag(i), &
i=1,npcl)
Dave Whipp
committed
!================================
!=====[isostasy information]=====
!================================
read (7) nb
dxy=1.d0/real(nb)
allocate(zisodisp(nb+1,nb+1))
read (7) ((zisodisp(i,j),j=1,nb+1),i=1,nb+1)
Dave Whipp
committed
!============================
!=====[nest information]=====
!============================
read(7) sselemx,sselemy,sselemz,xminls,yminls,zminls
close(7)
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
!==============================================================================
!==============================================================================
!=====[C -> N]=================================================================
!==============================================================================
!==============================================================================
allocate(countnode(ov%nnode))
allocate(ov_nodee2d(ov%nnode))
allocate(ov_nodecrit(ov%nnode))
ov_nodee2d = 0.d0
ov_nodecrit = 0.d0
countnode = 0.d0
do i=1,ov%nleaves
do j=1,8
k=ov%icon(j,i)
ov_nodee2d(k) = ov_nodee2d(k) + ov%e2d(i)
ov_nodecrit(k) = ov_nodecrit(k) + ov%crit(i)
countnode(k) = countnode(k) + 1
end do
end do
do i=1,ov%nnode
if (countnode(i).gt.0.d0) then
ov_nodee2d(i) = ov_nodee2d(i) / countnode(i)
ov_nodecrit(i) = ov_nodecrit(i) / countnode(i)
end if
end do
Dave Whipp
committed
! Convert coordinates if using a nest
if (nest) then
ov%x=ov%x*sselemx+xminls
ov%y=ov%y*sselemy+yminls
ov%z=ov%z*sselemz+zminls
do is=1,ov%nlsf
surface(is)%x=surface(is)%x*sselemx+xminls
surface(is)%y=surface(is)%y*sselemy+yminls
surface(is)%z=surface(is)%z*sselemz+zminls
enddo
Dave Whipp
committed
endif
!==============================================================================
!==============================================================================
write(*,'(a,i10)') 'octree length ',ov%noctree
write(*,'(a,i10)') 'nb of nodes ',ov%nnode
write(*,'(a,i10)') 'nb of leaves ',ov%nleaves
write(*,'(a,i10)') 'nb of bad faces ',ner
write(*,'(a,i10)') 'nb of lsf ',ov%nlsf
write(*,*) '--------------------------------------------------------------------------'
write(*,'(a,2f30.20)') 'x range : ',minval(ov%x(1:nn)), maxval(ov%x(1:nn))
write(*,'(a,2f30.20)') 'y range : ',minval(ov%y(1:nn)), maxval(ov%y(1:nn))
write(*,'(a,2f30.20)') 'z range : ',minval(ov%z(1:nn)), maxval(ov%z(1:nn))
write(*,'(a,2f30.20)') 'u range : ',minval(ov%u(1:nn)), maxval(ov%u(1:nn))
write(*,'(a,2f30.20)') 'v range : ',minval(ov%v(1:nn)), maxval(ov%v(1:nn))
write(*,'(a,2f30.20)') 'w range : ',minval(ov%w(1:nn)), maxval(ov%w(1:nn))
write(*,'(a,2f30.20)') 'w (iso) range : ',minval(ov%wiso(1:nn)), maxval(ov%wiso(1:nn))
write(*,'(a,2f30.20)') 'pressure range : ',minval(ov%pressure), maxval(ov%pressure)
write(*,'(a,2f30.20)') 'smooth pressure range : ',minval(ov%spressure), maxval(ov%spressure)
write(*,'(a,2f30.20)') 'pressure (nodes) range : ',minval(ov%nodal_pressure),maxval(ov%nodal_pressure)
write(*,'(a,2f30.20)') 'e2d range : ',minval(ov%e2d), maxval(ov%e2d)
write(*,'(a,2f30.20)') 'e2d (nodes) range : ',minval(ov_nodee2d), maxval(ov_nodee2d)
write(*,'(a,2f30.20)') 'yield ratio range : ',minval(ov%yield_ratio), maxval(ov%yield_ratio)
write(*,'(a,2f30.20)') 'friction angle range : ',minval(ov%frict_angle), maxval(ov%frict_angle)
write(*,'(a,2f30.20)') 'dilatation rate range : ',minval(ov%dilatr), maxval(ov%dilatr)
write(*,'(a,2f30.20)') 'crit range : ',minval(ov%crit), maxval(ov%crit)
write(*,'(a,2f30.20)') 'crit (nodes) range : ',minval(ov_nodecrit), maxval(ov_nodecrit)
write(*,'(a,2f30.20)') 'strain range : ',minval(ov%strain(1:nn)), maxval(ov%strain(1:nn))
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
do is=1,ov%nlsf
write(*,*) '--------------------------------------------------------------------------'
write(*,'(a,i3)') 'surface',is
write(*,'(a,i7,a)') 'surface counts ',surface(is)%nsurface, ' points'
write(*,'(a,i7,a)') 'surface counts ',surface(is)%nt, ' triangles'
write(*,'(a,2f30.20)') 'surf%x range : ',minval(surface(is)%x),maxval(surface(is)%x)
write(*,'(a,2f30.20)') 'surf%y range : ',minval(surface(is)%y),maxval(surface(is)%y)
write(*,'(a,2f30.20)') 'surf%z range : ',minval(surface(is)%z),maxval(surface(is)%z)
end do
nnn=0
nnne=0
do i=1,nn
if (invoid(i).eq.0) nnn=nnn+1
enddo
do i=1,ov%nleaves
if (elvoid(i).eq.0) nnne=nnne+1
enddo
!==============================================================================
!=====[producing cubes.vtk]====================================================
!==============================================================================
if (output_cubes==1) then
!=====[selection of leaves we are interested in]====
allocate(subset_leaves(ov%nleaves))
maxe2d=maxval(ov%e2d)
subset_leaves=.false.
do i=1,ov%nleaves
xx=ov%x(ov%icon(1,i))
yy=ov%y(ov%icon(1,i))
zz=ov%z(ov%icon(1,i))
if (.not.(xx.gt..5d0 .and. yy.gt. .5d0) .and. ov%e2d(i)>0.06 *maxe2d) subset_leaves(i)=.true.
end do
!subset_leaves=ov%whole_leaf_in_fluid
nl=count(subset_leaves)
!np=8*nl
np=8*ov%nleaves
iunit=30
open(unit=iunit,file='cubes.vtk')
write(iunit,'(a)')'# vtk DataFile Version 3.0'
write(iunit,'(a)')'velocities'
write(iunit,'(a)')'ASCII'
write(iunit,'(a)')'DATASET UNSTRUCTURED_GRID'
write(iunit,'(a7,i10,a6)')'POINTS ',np,' float'
do i=1,ov%nleaves
!if (subset_leaves(i)) then
do k=1,8
xx=ov%x(ov%icon(k,i))
yy=ov%y(ov%icon(k,i))
zz=ov%z(ov%icon(k,i))
end do
!end if
enddo
write(iunit,'(A6, 2I10)') 'CELLS ',nl,(1+8)*nl
do ie=1,ov%nleaves
if (subset_leaves(ie)) then
write(iunit,'(9I10)') 8 , ((ie-1)*8+i-1,i=1,8)
end if
end do
write(iunit,'(A11, I10)') 'CELL_TYPES ',nl
do ie=1,ov%nleaves
if (subset_leaves(ie)) then
write(iunit,'(I2)') 11
end if
end do
write(iunit,'(a11,i10)')'POINT_DATA ',np
write(iunit,'(a)')'SCALARS e2d float 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,ov%nleaves
if (abs(ov%e2d(i)).ge.1.d98) ov%e2d(i)=sign(1.d98,ov%e2d(i))
if (abs(ov%e2d(i)).le.1.d-99) ov%e2d(i)=0.d0
write(iunit,'(e13.6)') ov%e2d(i)
end do
end do
write(iunit,'(a)')'SCALARS w float 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,ov%nleaves
if (abs(wsum).ge.1.d98) wsum=sign(1.d98,wsum)
if (abs(wsum).le.1.d-99) wsum=0.d0
write(iunit,'(e13.6)') wsum
end do
end do
write(iunit,'(a)')'SCALARS v float 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,ov%nleaves
if (abs(vsum).ge.1.d98) vsum=sign(1.d98,vsum)
if (abs(vsum).le.1.d-99) vsum=0.d0
write(iunit,'(e13.6)') vsum
end do
end do
write(iunit,'(a)')'SCALARS u float 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,ov%nleaves
do k=1,8
if (abs(usum).ge.1.d98) usum=sign(1.d98,usum)
if (abs(usum).le.1.d-99) usum=0.d0
write(iunit,'(e13.6)') usum
end do
end do
write(iunit,'(a)')'SCALARS uvw float 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,ov%nleaves
do k=1,8
uvwsum=sqrt((sum(ov%u(ov%icon(:,i)))/8.d0)**2+(sum(ov%v(ov%icon(:,i)))/8.d0)**2+(sum(ov%w(ov%icon(:,i)))/8.d0)**2)
if (abs(uvwsum).ge.1.d98) uvwsum=sign(1.d98,uvwsum)
if (abs(uvwsum).le.1.d-99) uvwsum=0.d0
write(iunit,'(e13.6)') uvwsum
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
end do
end do
write(*,*) '--------------------------------------------------------------------------'
write(*,*) 'opla I am done producing cubes.vtk'
end if
!==============================================================================
!======[producing strain.vtk]==================================================
!==============================================================================
if (output_strain_tensor/=0) then
nnnep=0
levelmax=2
allocate (instrain(ov%nleaves))
instrain=.FALSE.
do i=1,ov%nleaves
if (elvoid(i).eq.0) then
xx=sum(ov%x(ov%icon(:,i)))/8.d0
yy=sum(ov%y(ov%icon(:,i)))/8.d0
zz=sum(ov%z(ov%icon(:,i)))/8.d0
xx=xx*(2.d0**levelmax)
yy=yy*(2.d0**levelmax)
zz=zz*(2.d0**levelmax)
ix=int(xx)
iy=int(yy)
iz=int(zz)
if (abs(xx-float(ix)-0.5d0).lt.1.d-6 .and. &
abs(yy-float(iy)-0.5d0).lt.1.d-6 .and. &
abs(zz-float(iz)-0.5d0).lt.1.d-6) instrain(i)=.TRUE.
if (instrain(i)) nnnep=nnnep+1
endif
enddo
!print*,'here',nnne,nnnep
iunit=30
open(unit=iunit,file='strain.vtk')
write(iunit,'(a)')'# vtk DataFile Version 3.0'
write(iunit,'(a)')'sigma1'
write(iunit,'(a)')'ASCII'
write(iunit,'(a)')'DATASET UNSTRUCTURED_GRID'
write(iunit,'(a7,i10,a6)')'POINTS ',nnnep,' float'
do i=1,ov%nleaves
if (elvoid(i).eq.0) then
xx=sum(ov%x(ov%icon(:,i)))/8.d0
yy=sum(ov%y(ov%icon(:,i)))/8.d0
zz=sum(ov%z(ov%icon(:,i)))/8.d0
if (instrain(i)) write(iunit,'(3f16.11)') xx,yy,zz
endif
enddo
write(iunit,'(a11,i10)')'POINT_DATA ',nnnep
write(iunit,'(a)')'TENSORS strain float'
do i=1,ov%nleaves
if (elvoid(i).eq.0) then
xx=sum(ov%x(ov%icon(:,i)))/8.d0
yy=sum(ov%y(ov%icon(:,i)))/8.d0
zz=sum(ov%z(ov%icon(:,i)))/8.d0
if (instrain(i)) then
!if (strain(1,:,i).ge.1.d98) strain(1,:,i)=1.d98
!if (strain(1,:,i).le.1.d-99) strain(1,:,i)=0.d0
!if (strain(2,:,i).ge.1.d98) strain(2,:,i)=1.d98
!if (strain(2,:,i).le.1.d-99) strain(2,:,i)=1.d0
!if (strain(3,:,i).ge.1.d98) strain(3,:,i)=1.d98
!if (strain(3,:,i).le.1.d-99) strain(3,:,i)=1.d0
write(iunit,'(3e13.6)') strain(1,:,i)
write(iunit,'(3e13.6)') strain(2,:,i)
write(iunit,'(3e13.6)') strain(3,:,i)
endif
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
endif
enddo
close (iunit)
deallocate (instrain)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing strain.vtk '
end if
!==============================================================================
!======[produce compressive.vtk file]==========================================
!==============================================================================
if (output_ps/=0) then
allocate(do_it(ov%nleaves))
np=0
do i=1,ov%nleaves
zz=sum(ov%z(ov%icon(:,i)))/8.d0 !criterion
if (zz<.3d0) then
np=np+1
do_it(i)=.true.
end if
end do
write(*,*) '--------------------------------------------------------------------------'
write(*,*) 'subset of points in compressive.vtk:',np
iunit=30
open(unit=iunit,file='compressive.vtk')
write(iunit,'(a)')'# vtk DataFile Version 3.0'
write(iunit,'(a)')'sigma1'
write(iunit,'(a)')'ASCII'
write(iunit,'(a)')'DATASET UNSTRUCTURED_GRID'
write(iunit,'(a7,i10,a6)')'POINTS ',np,' float'
do i=1,ov%nleaves
if (do_it(i)) then
xx=sum(ov%x(ov%icon(:,i)))/8.d0
yy=sum(ov%y(ov%icon(:,i)))/8.d0
zz=sum(ov%z(ov%icon(:,i)))/8.d0
write(iunit,'(3f16.11)') xx,yy,zz
end if
enddo
write(iunit,'(a11,i10)')'POINT_DATA ', np
write(iunit,'(a)')'VECTORS sigma1head+ float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') n1(1:3,i)*s(1,i)
enddo
write(iunit,'(a)')'VECTORS sigma1head- float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') -n1(1:3,i)*s(1,i)
enddo
write(iunit,'(a)')'VECTORS sigma3tail+ float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') n2(1:3,i)*s(2,i)
enddo
write(iunit,'(a)')'VECTORS sigma3tail- float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') -n2(1:3,i)*s(2,i)
enddo
write(iunit,'(a)')'VECTORS sigma2head+ float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') n3(1:3,i)*min(0.d0,s(3,i))
enddo
write(iunit,'(a)')'VECTORS sigma2head- float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') -n3(1:3,i)*min(0.d0,s(3,i))
enddo
write(iunit,'(a)')'VECTORS sigma2tail+ float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') n3(1:3,i)*max(0.d0,s(3,i))
enddo
write(iunit,'(a)')'VECTORS sigma2tail- float'
do i=1,ov%nleaves
if (do_it(i)) &
write(iunit,'(3e15.4)') -n3(1:3,i)*max(0.d0,s(3,i))
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
enddo
close (iunit)
deallocate(do_it)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing compressive.vtk '
end if
!==============================================================================
!======[produce visu.vtk file]=================================================
!==============================================================================
!iunit=30
!open(unit=iunit,file='cut.dat')
!do i=1,nnn ! loop over nodes
! x=ov%x(rtf(i))
! y=ov%y(rtf(i))
! z=ov%z(rtf(i))
! icut=3 ! icut between 0 and 64 for uniform level 6
! ! example , cross section in plane given by x=value
! xcut=icut*2.d0**(-6) ! background uniform grid level is 6
! dxyz=2.d0**(-7) ! higher level grid in boxes is 7
! if (abs(x-xcut)<1.d-6 ) then ! select nodes that are only on the plane
! if (mod(nint(y/dxyz),2)==0) then ! les coordonnees des noeuds surla grille de niveau 7 divisees par dxy vont prendre les valeurs 0 a 128
! if (mod(nint(z/dxyz),2)==0) then
! write(iunit,*) x,y,z
! end if
! end if
! end if
!enddo
!close(iunit)
iunit=30
open(unit=iunit,file='visu.vtk')
write(iunit,'(a)')'# vtk DataFile Version 3.0'
write(iunit,'(a)')'velocities'
write(iunit,'(a)')'ASCII'
write(iunit,'(a)')'DATASET UNSTRUCTURED_GRID'
write(iunit,'(a7,i10,a6)')'POINTS ',nnn,' float'
do i=1,nnn
write(iunit,'(3f16.11)')ov%x(rtf(i)),ov%y(rtf(i)),ov%z(rtf(i))
enddo
write(iunit,'(A6, 2I10)') 'CELLS ',nnne,(1+nne)*nnne
iconmin=nn
iconmax=0
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
myicon(1:nne)=ftr(ov%icon(1:nne,ie))-1
do k=1,nne
iconmin=min(iconmin,myicon(k))
iconmax=max(iconmax,myicon(k))
enddo
write(iunit,'(9I10)')nne,myicon(1:nne)
endif
enddo
!print*,iconmin,iconmax
write(iunit,'(A11, I10)') 'CELL_TYPES ',nnne
do ie=1,nnne
write(iunit,'(I2)')11 ! octree (8 nodes)
end do
write(iunit,'(a11,i10)')'POINT_DATA ',nnn
if(output_u_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%u(rtf(i))).ge.1.d98) ov%u(rtf(i))=sign(1.d98,ov%u(rtf(i)))
if (abs(ov%u(rtf(i))).le.1.d-99) ov%u(rtf(i))=0.d0
write(iunit,'(e13.6)') ov%u(rtf(i))
enddo
end if
if(output_v_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%v(rtf(i))).ge.1.d98) ov%v(rtf(i))=sign(1.d98,ov%v(rtf(i)))
if (abs(ov%v(rtf(i))).le.1.d-99) ov%v(rtf(i))=0.d0
write(iunit,'(e13.6)') ov%v(rtf(i))
enddo
end if
if(output_w_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%w(rtf(i))).ge.1.d98) ov%w(rtf(i))=sign(1.d98,ov%w(rtf(i)))
if (abs(ov%w(rtf(i))).le.1.d-99) ov%w(rtf(i))=0.d0
write(iunit,'(e13.6)') ov%w(rtf(i))
enddo
end if
if(output_disp_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
disp=sqrt(ov%u(rtf(i))**2+ov%v(rtf(i))**2+ov%w(rtf(i))**2)
if (abs(disp).ge.1.d98) disp=sign(1.d98,disp)
if (abs(disp).le.1.d-99) disp=0.d0
write(iunit,'(e13.6)') disp
if(output_press_fieldn==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%nodal_pressure(rtf(i))).ge.1.d98) then
ov%nodal_pressure(rtf(i))=sign(1.d98,ov%nodal_pressure(rtf(i)))
endif
if (abs(ov%nodal_pressure(rtf(i))).le.1.d-99) then
ov%nodal_pressure(rtf(i))=0.d0
endif
write(iunit,'(e13.6)') ov%nodal_pressure(rtf(i))
if(output_countnode_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
if (abs(countnode(rtf(i))).ge.1.d98) then
countnode(rtf(i))=sign(1.d98,countnode(rtf(i)))
endif
if (abs(countnode(rtf(i))).le.1.d-99) countnode(rtf(i))=0.d0
write(iunit,'(e13.6)') countnode(rtf(i))
enddo
end if
if(output_e2d_fieldn==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov_nodee2d(rtf(i))).ge.1.d98) then
ov_nodee2d(rtf(i))=sign(1.d98,ov_nodee2d(rtf(i)))
endif
if (abs(ov_nodee2d(rtf(i))).le.1.d-99) ov_nodee2d(rtf(i))=0.d0
write(iunit,'(e13.6)') ov_nodee2d(rtf(i))
enddo
end if
if(output_crit_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov_nodecrit(rtf(i))).ge.1.d98) then
ov_nodecrit(rtf(i))=sign(1.d98,ov_nodecrit(rtf(i)))
endif
if (abs(ov_nodecrit(rtf(i))).le.1.d-99) ov_nodecrit(rtf(i))=0.d0
write(iunit,'(e13.6)') ov_nodecrit(rtf(i))
enddo
end if
if(output_strain_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%strain(rtf(i))).ge.1.d98) then
ov%strain(rtf(i))=sign(1.d98,ov%strain(rtf(i)))
endif
if (abs(ov%strain(rtf(i))).le.1.d-99) ov%strain(rtf(i))=0.d0
write(iunit,'(e13.6)') ov%strain(rtf(i))
enddo
end if
if(output_temp_field==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%temp(rtf(i))).ge.1.d98) then
ov%temp(rtf(i))=sign(1.d98,ov%temp(rtf(i)))
endif
if (abs(ov%temp(rtf(i))).le.1.d-99) ov%temp(rtf(i))=0.d0
write(iunit,'(e13.6)') ov%temp(rtf(i))
enddo
end if
if(output_lsf_field==1) then
do ilsf=1,ov%nlsf
write (clsf,'(i2)') ilsf
if (ilsf.lt.10) clsf(1:1)='0'
write(iunit,'(a)')'SCALARS lsf'//clsf//' double 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do i=1,nnn
if (abs(ov%lsf(rtf(i),ilsf)).ge.1.d98) then
ov%lsf(rtf(i),ilsf)=sign(1.d98,ov%lsf(rtf(i),ilsf))
endif
if (abs(ov%lsf(rtf(i),ilsf)).le.1.d-99) ov%lsf(rtf(i),ilsf)=0.d0
write(iunit,'(e13.6)') ov%lsf(rtf(i),ilsf)
if(output_velo_vect==1) then
if (abs(ov%u(rtf(i))).ge.1.d98) ov%u(rtf(i))=sign(1.d98,ov%u(rtf(i)))
if (abs(ov%u(rtf(i))).le.1.d-99) ov%u(rtf(i))=0.d0
if (abs(ov%v(rtf(i))).ge.1.d98) ov%v(rtf(i))=sign(1.d98,ov%v(rtf(i)))
if (abs(ov%v(rtf(i))).le.1.d-99) ov%v(rtf(i))=0.d0
if (abs(ov%w(rtf(i))).ge.1.d98) ov%w(rtf(i))=sign(1.d98,ov%w(rtf(i)))
if (abs(ov%w(rtf(i))).le.1.d-99) ov%w(rtf(i))=0.d0
write(iunit,'(3e17.6)')ov%u(rtf(i)),ov%v(rtf(i)),ov%w(rtf(i))
enddo
endif
if(output_preiso_velo_vect==1) then
if (abs(ov%u(rtf(i))).ge.1.d98) ov%u(rtf(i))=sign(1.d98,ov%u(rtf(i)))
if (abs(ov%u(rtf(i))).le.1.d-99) ov%u(rtf(i))=0.d0
if (abs(ov%v(rtf(i))).ge.1.d98) ov%v(rtf(i))=sign(1.d98,ov%v(rtf(i)))
if (abs(ov%v(rtf(i))).le.1.d-99) ov%v(rtf(i))=0.d0
wmod=ov%w(rtf(i))-ov%wiso(rtf(i))
if (abs(wmod).ge.1.d98) wmod=sign(1.d98,wmod)
if (abs(wmod).le.1.d-99) wmod=0.d0
write(iunit,'(3e17.6)')ov%u(rtf(i)),ov%v(rtf(i)),wmod
Dave Whipp
committed
enddo
endif
if(output_iso_velo_vect==1) then
Dave Whipp
committed
do i=1,nnn
if (abs(ov%wiso(rtf(i))).ge.1.d98) ov%wiso(rtf(i))=sign(1.d98,ov%wiso(rtf(i)))
if (abs(ov%wiso(rtf(i))).le.1.d-99) ov%wiso(rtf(i))=0.d0
write(iunit,'(3e17.6)')0.d0,0.d0,ov%wiso(rtf(i))
if (output_strain_tensor/=0) then
allocate (strainn(3,3,nnn),nstrain(nnn))
strainn=0.d0
nstrain=0
do ie=1,nnne
if (elvoid(ie).eq.0) then
do k=1,nne
strainn(:,:,ftr(ov%icon(k,ie)))=strainn(:,:,ftr(ov%icon(k,ie)))+strain(:,:,ie)
nstrain(ftr(ov%icon(k,ie)))=nstrain(ftr(ov%icon(k,ie)))+1
enddo
endif
enddo
do i=1,nnn
if (nstrain(i).ne.0) strainn(:,:,i)=strainn(:,:,i)/nstrain(i)
enddo
!if (strainn(1,:,i).ge.1.d98) strainn(1,:,i)=1.d98
!if (strainn(1,:,i).le.1.d-99) strainn(1,:,i)=1.d0
!if (strainn(2,:,i).ge.1.d98) strainn(2,:,i)=1.d98
!if (strainn(2,:,i).le.1.d-99) strainn(2,:,i)=1.d0
!if (strainn(3,:,i).ge.1.d98) strainn(3,:,i)=1.d98
!if (strainn(3,:,i).le.1.d-99) strainn(3,:,i)=1.d0
write(iunit,'(3e13.6)') strainn(1,:,i)
write(iunit,'(3e13.6)') strainn(2,:,i)
write(iunit,'(3e13.6)') strainn(3,:,i)
enddo
deallocate (strainn,nstrain)
write(iunit,'(a10,i10)')'CELL_DATA ', nnne
if (output_e2d_fielde==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%e2d(ie)).ge.1.d98) ov%e2d(ie)=sign(1.d98,ov%e2d(ie))
if (abs(ov%e2d(ie)).le.1.d-99) ov%e2d(ie)=0.d0
write(iunit,'(e13.6)') ov%e2d(ie)
endif
enddo
end if
if(output_press_fielde==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%pressure(ie)).ge.1.d98) then
ov%pressure(ie)=sign(1.d98,ov%pressure(ie))
endif
if (abs(ov%pressure(ie)).le.1.d-99) ov%pressure(ie)=0.d0
write(iunit,'(e13.6)') ov%pressure(ie)
endif
enddo
end if
if(output_smooth_press_fielde==1) then
write(iunit,'(a)')'SCALARS smooth_pressure_e double 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%spressure(ie)).ge.1.d98) then
ov%spressure(ie)=sign(1.d98,ov%spressure(ie))
endif
if (abs(ov%spressure(ie)).le.1.d-99) ov%spressure(ie)=0.d0
write(iunit,'(e13.6)') ov%spressure(ie)
endif
enddo
end if
if(output_eviscosity_fielde==1) then
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%eviscosity(ie)).ge.1.d98) then
ov%eviscosity(ie)=sign(1.d98,ov%eviscosity(ie))
endif
if (abs(ov%eviscosity(ie)).le.1.d-99) ov%eviscosity(ie)=0.d0
write(iunit,'(e13.6)') ov%eviscosity(ie)
endif
enddo
end if
if(output_is_plastic_fielde==1) then
write(iunit,'(a)')'SCALARS is_plastic_e integer 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
write(iunit,'(I10)') ov%is_plastic(ie)
endif
if (output_yield_ratio_fielde==1) then
write(iunit,'(a)')'SCALARS yield_ratio double 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%yield_ratio(ie)).ge.1.d98) then
ov%yield_ratio(ie)=sign(1.d98,ov%yield_ratio(ie))
endif
if (abs(ov%yield_ratio(ie)).le.1.d-99) ov%yield_ratio(ie)=0.d0
write(iunit,'(e13.6)') ov%yield_ratio(ie)
endif
enddo
end if
if (output_frict_angle_fielde==1) then
write(iunit,'(a)')'SCALARS frict_angle double 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%frict_angle(ie)).ge.1.d98) then
ov%frict_angle(ie)=sign(1.d98,ov%frict_angle(ie))
endif
if (abs(ov%frict_angle(ie)).le.1.d-99) ov%frict_angle(ie)=0.d0
write(iunit,'(e13.6)') ov%frict_angle(ie)
endif
enddo
end if
if (output_dilatr_fielde==1) then
write(iunit,'(a)')'SCALARS dilatation_rate double 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
if (abs(ov%dilatr(ie)).ge.1.d98) then
ov%dilatr(ie)=sign(1.d98,ov%dilatr(ie))
endif
if (abs(ov%dilatr(ie)).le.1.d-99) ov%dilatr(ie)=0.d0
write(iunit,'(e13.6)') ov%dilatr(ie)
enddo
end if
if (output_elem_matnum==1) then
write(iunit,'(a)')'SCALARS material_number integer 1'
write(iunit,'(a)')'LOOKUP_TABLE default'
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
write(iunit,'(I10)') ov%matnum(ie)
endif
enddo
end if
close(iunit)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing visu.vtk '
deallocate(countnode)
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
!==============================================================================
!======[produce norm<i>.vtk file]==============================================
!==============================================================================
if (output_surface_icon==1) then
do is=1,ov%nlsf
write(cs,'(i1)') is
open(unit=30,file='norm'//cs//'.vtk')
write(30,'(a)')'# vtk DataFile Version 3.0'
write(30,'(a)')'surface'
write(30,'(a)')'ASCII'
write(30,'(a)')'DATASET UNSTRUCTURED_GRID'
write(30,'(a7,i10,a6)')'POINTS ',surface(is)%nsurface,' float'
do i=1,surface(is)%nsurface
write(30,'(3f16.11)')surface(is)%x(i),surface(is)%y(i),surface(is)%z(i)
enddo
write(30,'(a6, 2I10)') 'CELLS ',surface(is)%nt,(1+3)*surface(is)%nt
do i=1,surface(is)%nt
write(30,'(9I10)')3,surface(is)%icon(1:3,i)-1
enddo
write(30,'(A11, I10)') 'CELL_TYPES ',surface(is)%nt
do i=1,surface(is)%nt
write(30,'(I2)')5 ! octree (8 nodes)
end do
write(30,'(a11,i10)') 'POINT_DATA ',surface(is)%nsurface
write(30,'(a)')'SCALARS z float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,surface(is)%nsurface
enddo
if (is.eq.1) then
write(30,'(a)')'SCALARS erosion_rate float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,surface(is)%nsurface
enddo
write(30,'(a)')'SCALARS rock_uplift float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,surface(is)%nsurface
enddo
endif
write(30,'(a)') 'VECTORS normal float'
do i=1,surface(is)%nsurface
write(30,'(3e17.6)') surface(is)%xn(i),surface(is)%yn(i),surface(is)%zn(i)
end do
write(30,'(a)') 'VECTORS vel float'
do i=1,surface(is)%nsurface
write(30,'(3e17.6)') surface(is)%u(i),surface(is)%v(i),surface(is)%w(i)
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
end do
close(30)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing norm'//cs//'.vtk'
enddo
end if
!==============================================================================
!======[produce rivers.vtk file]==============================================
!==============================================================================
if (output_rivers==1) then
allocate (donor(surface(1)%nsurface),order(surface(1)%nsurface))
call rivers (surface(1)%icon,surface(1)%nt,surface(1)%x,surface(1)%y,surface(1)%z, &
surface(1)%nsurface,donor,order)
iordermin=3
nlinks=0
do i=1,surface(1)%nsurface
if (order(i).gt.iordermin.and.donor(i).gt.0) nlinks=nlinks+1
enddo
open(unit=30,file='rivers.vtk')
write(30,'(a)')'# vtk DataFile Version 3.0'
write(30,'(a)')'rivers'
write(30,'(a)')'ASCII'
write(30,'(a)')'DATASET UNSTRUCTURED_GRID'
write(30,'(a7,i10,a6)')'POINTS ',surface(1)%nsurface,' float'
do i=1,surface(1)%nsurface
write(30,'(3f16.11)')surface(1)%x(i),surface(1)%y(i),surface(1)%z(i)+.001
enddo
write(30,'(a6, 2I10)') 'CELLS ',nlinks,(1+2)*nlinks
do i=1,surface(1)%nsurface
if (order(i).gt.iordermin.and.donor(i).gt.0) write(30,'(9I10)')2,i-1,donor(i)-1
enddo
write(30,'(A11, I10)') 'CELL_TYPES ',nlinks
do i=1,nlinks
write(30,'(I2)')3 ! octree (2 nodes)
end do
close(30)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing rivers.vtk'
deallocate (donor,order)
end if
!==============================================================================
!======[produce regular.vtk file]==============================================
!==============================================================================
if (output_regular==1) then
allocate (levs(ov%nleaves))
call octree_find_element_level (ov%octree,ov%noctree,levs,ov%nleaves)
levmax=maxval(levs)
zmax=maxval(surface(1)%z)
dz=1.d0/(2.d0**levmax)
nz=(zmax/dz)+1
allocate (str11(ov%nnode),str12(ov%nnode),str13(ov%nnode), &
str22(ov%nnode),str23(ov%nnode),str33(ov%nnode),nstrain(ov%nnode))
nstrain=0
str11=0.;str12=0.;str13=0.
str22=0.;str23=0.;str33=0.
do ie=1,ov%nleaves
if (elvoid(ie).eq.0) then
do k=1,nne
i=ov%icon(k,ie)
str11(i)=str11(i)+strain(1,1,ie)
str12(i)=str12(i)+strain(1,2,ie)
str13(i)=str13(i)+strain(1,3,ie)
str22(i)=str22(i)+strain(2,2,ie)
str23(i)=str23(i)+strain(2,3,ie)
str33(i)=str33(i)+strain(3,3,ie)
nstrain(i)=nstrain(i)+1
enddo
endif
enddo
do i=1,ov%nnode
if (nstrain(i).ne.0) then
str11(i)=str11(i)/nstrain(i)
str12(i)=str12(i)/nstrain(i)
str13(i)=str13(i)/nstrain(i)
str22(i)=str22(i)/nstrain(i)
str23(i)=str23(i)/nstrain(i)
str33(i)=str33(i)/nstrain(i)
endif
enddo
!print*,minval(str11),maxval(str11)
!print*,minval(str12),maxval(str12)
!print*,minval(str13),maxval(str13)
!print*,minval(str22),maxval(str22)
!print*,minval(str23),maxval(str23)
!print*,minval(str33),maxval(str33)
ni=nz*(2**levmax+1)*(2**levmax+1)
allocate (xi(ni),yi(ni),zi(ni),ui(ni),vi(ni),wi(ni),si(ni),ei(ni),li(ni), &
s11(ni),s12(ni),s13(ni),s22(ni),s23(ni),s33(ni))
do k=1,nz
do j=1,2**levmax+1
do i=1,2**levmax+1
ijk=ijk+1
xi(ijk)=(i-1)*dz
yi(ijk)=(j-1)*dz
zi(ijk)=(k-1)*dz
call octree_interpolate_many (12,ov%octree,ov%noctree,ov%icon,ov%nleaves,ov%nnode, &
xi(ijk),yi(ijk),zi(ijk), &
ov%u,ui(ijk),ov%v,vi(ijk),ov%w,wi(ijk), &
ov%strain,si(ijk),ov_nodee2d,ei(ijk),ov%lsf(1,1),li(ijk), &
str11,s11(ijk),str12,s12(ijk),str13,s13(ijk), &
str22,s22(ijk),str23,s23(ijk),str33,s33(ijk))
enddo
enddo
enddo
!print*,minval(s11),maxval(s11)
!print*,minval(s12),maxval(s12)
!print*,minval(s13),maxval(s13)
!print*,minval(s22),maxval(s22)
!print*,minval(s23),maxval(s23)
!print*,minval(s33),maxval(s33)
deallocate (str11,str12,str13,str22,str23,str33,strain)
do i=1,2**levmax+1
do j=1,2**levmax+1
do k=1,nz
ijk=ijk+1
! if (li(ijk).gt.0.) then
! if (k.eq.1) stop 'error in lsf1'
! ui(ijk)=ui(ijk-1)
! vi(ijk)=vi(ijk-1)
! wi(ijk)=wi(ijk-1)
! si(ijk)=si(ijk-1)
! ei(ijk)=ei(ijk-1)
! endif
enddo
enddo
enddo
allocate (azimuth1(ni),azimuth3(ni),dip1(ni),dip3(ni))
azimuth1=0.d0
azimuth3=0.d0
dip1=0.d0
dip3=0.d0
do i=1,ni
call PS (s11(i),s22(i),s33(i),s12(i),s23(i),s13(i),l1,l2,l3, &
n11,n12,n13, &
n21,n22,n23, &
n31,n32,n33)
if (n11.ne.0.d0 .or. n12.ne.0.d0) azimuth1(i)=atan2(n12,n11)
if (abs(n13).le.1.d0) dip1(i)=asin(n13)
if (n31.ne.0.d0 .or. n32.ne.0.d0) azimuth3(i)=atan2(n32,n31)
if (abs(n33).le.1.d0) dip3(i)=asin(n33)
enddo
con=45.d0/atan(1.d0)
azimuth1=azimuth1*con
azimuth3=azimuth3*con
dip1=dip1*con
dip3=dip3*con
open(unit=30,file='regular.vtk')
write(30,'(a)')'# vtk DataFile Version 3.0'
write(30,'(a)')'regular'
write(30,'(a)')'ASCII'
write(30,'(a)')'DATASET STRUCTURED_POINTS'
write(30,'(a,3i10)') 'DIMENSIONS',2**levmax+1,2**levmax+1,nz
write(30,'(a,3f16.11)') 'ORIGIN',0.,0.,0.
write(30,'(a,3f16.11)') 'SPACING',dz,dz,dz
write(30,'(a11,i10)')'POINT_DATA ',(2**levmax+1)*(2**levmax+1)*nz
write(30,'(a)')'VECTORS Velocity float'
do i=1,(2**levmax+1)*(2**levmax+1)*nz
write(30,'(3e15.4)') ui(i),vi(i),wi(i)
enddo
write(30,'(a)')'SCALARS Strain float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,(2**levmax+1)*(2**levmax+1)*nz
enddo
write(30,'(a)')'SCALARS StrainRate float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,(2**levmax+1)*(2**levmax+1)*nz
enddo
! write(30,'(a)')'SCALARS azimuth_sigma1 float 1'
! write(30,'(a)')'LOOKUP_TABLE default'
! do i=1,(2**levmax+1)*(2**levmax+1)*nz
! enddo
! write(30,'(a)')'SCALARS dip_sigma1 float 1'
! write(30,'(a)')'LOOKUP_TABLE default'
! do i=1,(2**levmax+1)*(2**levmax+1)*nz
! enddo
! write(30,'(a)')'SCALARS azimuth_sigma3 float 1'
! write(30,'(a)')'LOOKUP_TABLE default'
! do i=1,(2**levmax+1)*(2**levmax+1)*nz
! enddo
! write(30,'(a)')'SCALARS dip_sigma3 float 1'
! write(30,'(a)')'LOOKUP_TABLE default'
! do i=1,(2**levmax+1)*(2**levmax+1)*nz
! enddo
write(30,'(a)')'TENSORS StrainDot float'
do i=1,(2**levmax+1)*(2**levmax+1)*nz
write(30,'(3e14.6)') s11(i),s12(i),s13(i)
write(30,'(3e14.6)') s12(i),s22(i),s23(i)
write(30,'(3e14.6)') s13(i),s23(i),s33(i)
enddo
close(30)
deallocate (xi,yi,zi,ui,vi,wi,si,ei,li,s11,s12,s13,s22,s23,s33)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing regular.vtk '
write(*,*) '--------------------------------------------------------------------------'
endif
!==============================================================================
!======[produce zisodisp.vtk file]=============================================
!==============================================================================
open(unit=30,file='zisodisp.vtk')
write(30,'(a)')'# vtk DataFile Version 3.0'
write(30,'(a)')'zisodisp'
write(30,'(a)')'ASCII'
write(30,'(a)')'DATASET UNSTRUCTURED_GRID'
write(30,'(a7,i10,a6)')'POINTS ',int((nb+1)**2.d0),' float'
write(30,'(3f16.11)') (i-1)*dxy,(j-1)*dxy,zisodisp(i,j)
write(30,'(a6, 2I10)') 'CELLS ',int(nb**2.d0),int((4+1)*nb**2.d0)
write(30,'(9I10)')4,ptcnt,ptcnt+1,ptcnt+1+(nb+1),ptcnt+(nb+1)
ptcnt=ptcnt+1
enddo
ptcnt=ptcnt+1
enddo
write(30,'(A11, I10)') 'CELL_TYPES ',int(nb**2.d0)
do j=1,nb
do i=1,nb
write(30,'(I2)')9 ! VTK quad (4 nodes)
enddo
enddo
write(30,'(a11,i10)') 'POINT_DATA ',int((nb+1)**2.d0)
write(30,'(a)')'SCALARS zisodisp float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do j=1,nb+1
do i=1,nb+1
!write(30,'(a11,i10)') 'POINT_DATA ',int((nb+1)**2.d0)
write(30,'(a)')'SCALARS zisoslx float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do j=1,nb+1
do i=1,nb+1
if (i==1) then
write(30,'(e13.6)') (zisodisp(i+1,j)-zisodisp(i,j))/dxy
write(30,'(e13.6)') (zisodisp(i,j)-zisodisp(i-1,j))/dxy
write(30,'(e13.6)') ((zisodisp(i,j)-zisodisp(i-1,j))/dxy+&
(zisodisp(i+1,j)-zisodisp(i,j))/dxy)/2.d0
endif
enddo
enddo
close(30)
write(*,*) '--------------------------------------------------------------------------'
write(*,*)'opla I am done producing zisodisp.vtk'
end if
!==============================================================================
!======[produce cloud.vtk file]================================================
!==============================================================================
if (output_cloud==1) then
npclv=0
do i=1,npcl
if (lsf0(i).le.0.d0) npclv=npclv+1
enddo
open(unit=30,file='cloud.vtk')
write(30,'(a)')'# vtk DataFile Version 3.0'
write(30,'(a)')'DOUAR cloud output'
write(30,'(a)')'ASCII'
write(30,'(a)')'DATASET UNSTRUCTURED_GRID'
write(30,'(a7,i10,a6)')'POINTS ',npclv,' float'
if (lsf0(i).le.0.d0) then
write(iunit,'(3f16.11)') cl%x(i),cl%y(i),cl%z(i)
endif
write(30,'(a6, 2I10)') 'CELLS ',1,npclv+1
write(30,'(256I10)') npclv,(i-1,i=1,npclv)
write(30,'(A11, I10)') 'CELL_TYPES ',1
write(30,'(I10)') 2
write(30,'(a11,i10)') 'POINT_DATA ',npclv
write(30,'(a)')'SCALARS strain float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,npcl
if (lsf0(i).le.0.d0) then
write(iunit,'(f16.11)') cl%strain(i)
endif
enddo
write(30,'(a)')'SCALARS lsf0 float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,npcl
if (lsf0(i).le.0.d0) then
write(iunit,'(f16.11)') cl%lsf0(i)
endif
enddo
write(30,'(a)')'SCALARS temp float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,npcl
if (lsf0(i).le.0.d0) then
write(iunit,'(f16.11)') cl%temp(i)
endif
enddo
write(30,'(a)')'SCALARS press float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,npcl
if (lsf0(i).le.0.d0) then
write(iunit,'(f16.11)') cl%press(i)
endif
enddo
write(30,'(a)')'SCALARS tag integer 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,npcl
if (lsf0(i).le.0.d0) then
write(iunit,'(I10)') cl%tag(i)
endif
enddo
close(30)
write(*,*) '--------------------------------------------------------------------------'
write(*,*) 'Finished producing cloud.vtk'
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
!==============================================================================
!======[produce cloud0.vtk file]================================================
!==============================================================================
if (output_cloud0==1) then
open(unit=30,file='cloud0.vtk')
write(30,'(a)')'# vtk DataFile Version 3.0'
write(30,'(a)')'DOUAR cloud0 output'
write(30,'(a)')'ASCII'
write(30,'(a)')'DATASET UNSTRUCTURED_GRID'
write(30,'(a7,i10,a6)')'POINTS ',npcl,' float'
do i=1,npcl
write(iunit,'(3f16.11)') cl%x0(i),cl%y0(i),cl%z0(i)
enddo
write(30,'(a6, 2I10)') 'CELLS ',1,npcl+1
write(30,'(256I10)') npcl,(i-1,i=1,npcl)
write(30,'(A11, I10)') 'CELL_TYPES ',1
write(30,'(I10)') 2
write(30,'(a11,i10)') 'POINT_DATA ',npcl
write(30,'(a)')'SCALARS z0 float 1'
write(30,'(a)')'LOOKUP_TABLE default'
do i=1,npcl
write(iunit,'(f16.11)') cl%z0(i)
enddo
close(30)
write(*,*) '--------------------------------------------------------------------------'
write(*,*) 'Finished producing cloud0.vtk'
end if
write(*,*) '**************************************************************************'