Skip to content

Commit

Permalink
binary vtu write works, need to make both xdmf and vtk work together,…
Browse files Browse the repository at this point in the history
… commit as a backup
  • Loading branch information
Ankit Chakraborty committed Mar 13, 2023
1 parent 952d2d3 commit 3615852
Show file tree
Hide file tree
Showing 11 changed files with 444 additions and 159 deletions.
6 changes: 5 additions & 1 deletion trunk/problems/POISSON/ULTRAWEAK_DPG/common/HpAdapt.F90
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ subroutine HpAdapt
if (i .eq. istep) write(*,*)
enddo

70 continue

open(22,file="error.dat",status='replace')
! write(4,*) nr_elem_ref
Expand All @@ -266,6 +265,11 @@ subroutine HpAdapt
enddo
close(22)


70 continue



!-----------------------------------------------------------------------
! REFINE AND UPDATE MESH
!-----------------------------------------------------------------------
Expand Down
34 changes: 13 additions & 21 deletions trunk/problems/POISSON/ULTRAWEAK_DPG/common/refine_DPG.F90
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@
! It also displays dof, residuals and
! relevant errors at each step.
!
! arguments:
!
! in:
! Irefine = 0 if no refinement -> only display
! = 1 if uniform refinements
! = 2 if anisotropic refinements (provide kref)
! = 3 if adaptive refinements
! Nreflag = 1 for h-refinements
! = 2 for p-refinements
! = 3 for h- or p-refinement, depending
! upon the element size
! Factor - if element error \ge Factor*max_error
! then the element is refined
! Nflag - integer vector of length NR_PHYSA to indicate
! which PHYS Attribute one should compute the error for
! PhysNick - nickname for PHYS Attribute: physNick = HEVQ
! e.g., physNick = 1001 means 1H1 and 1L2 variable, etc.
! Ires - logical, .true. if compute residual is true
! out:
! Nstop = 1 if refinement did not increase dof
!
!---------------------------------------------------------------------
!
Expand All @@ -60,7 +40,7 @@ subroutine refine_DPG
! integer, intent(out) :: Nstop

integer, parameter :: adap_strat = 1 !0 is for greedy strat and 1 is for Doerfler
! parameters below were input to the function before but currently used as finxed parameters for debug
! parameters below were input to the function before but currently used as fixed parameters for debug
integer, parameter :: physNick = 1 !if exact then adapting to reduce in error L2 solution u
integer, parameter :: max_step = 20
real(8), parameter :: Factor = 0.75
Expand Down Expand Up @@ -249,6 +229,18 @@ subroutine refine_DPG
if (i .eq. istep) write(*,*)
enddo

open(22,file="error.dat",status='replace')
! write(4,*) nr_elem_ref
do i = 1,istep

write(22,*) i,nelem_mesh(i),nrdof_tot_mesh(i),nrdof_con_mesh(i),residual_mesh(i),rate_mesh(i), &
error_mesh(i),rel_error_mesh(i),rate_error_mesh(i)

enddo
close(22)



70 continue

!-----------------------------------------------------------------------
Expand Down
11 changes: 8 additions & 3 deletions trunk/problems/POISSON/ULTRAWEAK_DPG/exec_job_new.F90
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ subroutine exec_job_new()
write(*,*) '=================='
endif

!..distribute mesh initially
!..distribute mesh initially
call distr_mesh
!..set Zoltan partitioner
call zoltan_w_set_lb(0)
Expand Down Expand Up @@ -52,8 +52,13 @@ subroutine exec_job_new()
call mumps_sc('G')
endif
call exact_error
call HpAdapt

! call HpAdapt
call refine_DPG
if( (i .gt. 0) .and. (modulo(i,5) .eq. 0)) then
if(RANK .eq. ROOT) write(*,*) "Redistributing the mesh"
call MPI_BARRIER (MPI_COMM_WORLD, ierr)
call distr_mesh
endif
enddo

!solving on the last mesh
Expand Down
24 changes: 15 additions & 9 deletions trunk/problems/POISSON/ULTRAWEAK_DPG/my_paraview_driver.F90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ subroutine my_paraview_driver(IParAttr)
!use data_structure3D, only: NRCOMS
use environment, only: QUIET_MODE
use paraview, only: PARAVIEW_DUMP_ATTR,FILE_VIS, &
VLEVEL,PARAVIEW_DUMP_GEOM, VIS_FORMAT,SECOND_ORDER_VIS
VLEVEL,PARAVIEW_DUMP_GEOM, VIS_FORMAT,SECOND_ORDER_VIS,iParAttr_VTU
use mpi_param, only: RANK,ROOT
!
implicit none
Expand All @@ -25,6 +25,7 @@ subroutine my_paraview_driver(IParAttr)
!-------------------------------------------------------------------------------------------
!
PARAVIEW_DUMP_GEOM = .true.
PARAVIEW_DUMP_ATTR = .false.
!
!..load files for visualization upscale
if (.not. initialized) then
Expand All @@ -50,10 +51,13 @@ subroutine my_paraview_driver(IParAttr)
endif
!
! -- GEOMETRY --
allocate(iParAttr_VTU(NR_PHYSA))
iParAttr_VTU = iParAttr(1:NR_PHYSA)

call paraview_geom

!
! -- PHYSICAL ATTRIBUTES --
! !
! ! -- PHYSICAL ATTRIBUTES --
if (.not. PARAVIEW_DUMP_ATTR) goto 90
!
!..loop over rhs's
Expand All @@ -73,15 +77,15 @@ subroutine my_paraview_driver(IParAttr)
!
select case(DTYPE(iphys))
!
! -- H1 --
! ! -- H1 --
case('contin')
call paraview_attr_scalar(id,idx)
!
! -- H(curl) --
! !
! ! -- H(curl) --
case('tangen')
call paraview_attr_vector(id,idx)
! !
! -- H(div) --
! ! !
! ! -- H(div) --
case('normal')
call paraview_attr_vector(id,idx)
! !
Expand All @@ -103,8 +107,10 @@ subroutine my_paraview_driver(IParAttr)
enddo
!..end loop over rhs's
enddo
! !

! ! !
90 continue
deallocate(iParAttr_VTU)
! !
if (RANK .eq. ROOT) then
call paraview_end ! [CLOSES THE XMF FILE, WRITES FOOTER]
Expand Down
Loading

0 comments on commit 3615852

Please sign in to comment.