mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 21:55:41 -04:00
added cmfd timing and options printout
This commit is contained in:
parent
c201a71372
commit
cdef60136f
5 changed files with 34 additions and 8 deletions
|
|
@ -19,10 +19,11 @@ cmfd_data.o: mesh.o
|
|||
cmfd_data.o: mesh_header.o
|
||||
|
||||
cmfd_execute.o: cmfd_data.o
|
||||
cmfd_output.o : cmfd_output.o
|
||||
cmfd_execute.o: cmfd_output.o
|
||||
cmfd_execute.o: cmfd_power_solver.o
|
||||
cmfd_execute.o: cmfd_slepc_solver.o
|
||||
cmfd_execute.o: cmfd_snes_solver.o
|
||||
cmfd_execute.o: timing.o
|
||||
|
||||
cmfd_input.o: datatypes.o
|
||||
cmfd_input.o: error.o
|
||||
|
|
|
|||
|
|
@ -5,7 +5,8 @@ module cmfd_execute
|
|||
use cmfd_power_solver, only: cmfd_power_execute
|
||||
use cmfd_slepc_solver, only: cmfd_slepc_execute
|
||||
use cmfd_snes_solver, only: cmfd_snes_execute
|
||||
use global, only: cmfd,cmfd_only
|
||||
use global, only: cmfd,cmfd_only,time_cmfd
|
||||
use timing, only: timer_start,timer_stop
|
||||
|
||||
implicit none
|
||||
|
||||
|
|
@ -24,6 +25,9 @@ contains
|
|||
|
||||
integer :: ierr ! petsc error code
|
||||
|
||||
! begin timer
|
||||
call timer_start(time_cmfd)
|
||||
|
||||
! set up cmfd
|
||||
if(.not. cmfd_only) call set_up_cmfd()
|
||||
|
||||
|
|
@ -33,8 +37,12 @@ contains
|
|||
! execute snes solver
|
||||
call cmfd_snes_execute()
|
||||
|
||||
! stop timer
|
||||
call timer_stop(time_cmfd)
|
||||
|
||||
! print results
|
||||
print *,'SNES Eigenvalue is:',cmfd%keff
|
||||
print *,'CMFD Time:',time_cmfd%elapsed,' seconds.'
|
||||
|
||||
! finalize slepc
|
||||
call SlepcFinalize(ierr)
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@ contains
|
|||
call PCGetType(pc,pctype,ierr)
|
||||
|
||||
! display information to user
|
||||
write(*,'(/,A)') 'SLEPC SOLVER OPTIONS:'
|
||||
write(*,*) '---------------------'
|
||||
write(*,*) 'EPS TYPE IS: ',epstype
|
||||
write(*,*) 'ST TYPE IS: ',sttype
|
||||
write(*,*) 'KSP TYPE IS: ',ksptype
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ implicit none
|
|||
type(prod_operator) :: prod
|
||||
|
||||
Mat :: jac ! jacobian matrix
|
||||
Mat :: jacpc ! preconditioned jacobian matrix
|
||||
Vec :: resvec ! residual vector
|
||||
Vec :: xvec ! results
|
||||
KSP :: ksp ! linear solver context
|
||||
|
|
@ -95,6 +96,8 @@ contains
|
|||
|
||||
subroutine init_solver()
|
||||
|
||||
character(LEN=20) :: snestype,ksptype,pctype
|
||||
|
||||
! create SNES context
|
||||
call SNESCreate(PETSC_COMM_SELF,snes,ierr)
|
||||
|
||||
|
|
@ -111,11 +114,25 @@ contains
|
|||
|
||||
! set matrix free finite difference
|
||||
call MatCreateSNESMF(snes,jac,ierr)
|
||||
call SNESSetJacobian(snes,jac,jac,MatMFFDComputeJacobian,PETSC_NULL,ierr)
|
||||
call MatCreateSNESMF(snes,jacpc,ierr)
|
||||
call SNESSetJacobian(snes,jac,jacpc,MatMFFDComputeJacobian,PETSC_NULL,ierr)
|
||||
|
||||
! set SNES options
|
||||
call SNESSetFromOptions(snes,ierr)
|
||||
|
||||
! get all types and print
|
||||
call SNESGetType(snes,snestype,ierr)
|
||||
call KSPGetType(ksp,ksptype,ierr)
|
||||
call PCGetType(pc,pctype,ierr)
|
||||
|
||||
|
||||
! display information to user
|
||||
write(*,'(/,A)') 'SNES SOLVER OPTIONS:'
|
||||
write(*,*) '---------------------'
|
||||
write(*,*) 'SNES TYPE IS: ',snestype
|
||||
write(*,*) 'KSP TYPE IS: ',ksptype
|
||||
write(*,*) 'PC TYPE IS: ',pctype
|
||||
|
||||
end subroutine init_solver
|
||||
|
||||
!===============================================================================
|
||||
|
|
@ -197,9 +214,9 @@ contains
|
|||
|
||||
end subroutine compute_nonlinear_residual
|
||||
|
||||
!==============================================================================
|
||||
!===============================================================================
|
||||
! EXTRACT_RESULTS
|
||||
!==============================================================================
|
||||
!===============================================================================
|
||||
|
||||
subroutine extract_results()
|
||||
|
||||
|
|
|
|||
|
|
@ -204,9 +204,7 @@ module global
|
|||
type(cmfd_obj) :: cmfd
|
||||
|
||||
! Timing objects
|
||||
type(Timer) :: time_cmfd ! timer for whole calculation
|
||||
type(Timer) :: time_mat ! timer for mat building
|
||||
type(Timer) :: time_eigen ! timer for eigenvalue calculation
|
||||
type(Timer) :: time_cmfd ! timer for whole cmfd calculation
|
||||
|
||||
! Flag for CMFD only
|
||||
logical :: cmfd_only = .FALSE.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue