Skip to content

Commit

Permalink
Merge pull request #2 from ukaea/dev-mijin-readme
Browse files Browse the repository at this point in the history
Dev mijin readme
  • Loading branch information
SMijin committed Jun 29, 2023
2 parents 48bd14e + f88db56 commit 3dcbfed
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 8 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# CHANGELOG

## v1.1.0, 2023-06-28

- Solver and integrator improvements

### New Features

- The BDE integrator internal controller now attempts to reduce the number of substeps back to 1 after every 50 successful integrations
- Command line PETSc support for setting up the KSP solver object has been implemented. The command line ksp_type takes precedent over the integrator
options. This now allows for command line customization of the KSP object. Note that tolerances are still set from config options.


## v1.0.0, 2023-06-21

- Initial release
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ export PETSC_ARCH=arch-linux-c-opt
export PATH=$PATH:/home/installs/petsc
export PATH=$PATH:/home/installs/hdf5
export PATH=$PATH:/home/installs/json-fortran/jsonfortran-gnu-8.2.5
export PATH=/home/mpich-install/bin:$PATH
export PATH=$PATH:/home/mpich-install/bin:$PATH
export LD_LIBRARY_PATH=/home/mpich-install/lib:$LD_LIBRARY_PATH
```
NOTE: Some of the above paths might have to be set differently depending on your system setup.
NOTE: Some of the above paths might have to be set differently depending on your system setup and you might have to define the ones you need after the corresponding installation. Another option is to export the paths before the start of the installation process.

## Building ReMKiT1D

Expand Down
15 changes: 9 additions & 6 deletions src/modules/basic_integrators/implicit_PicardBDE_integrator.f90
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,17 @@ module implicit_PicardBDE_integrator_class

type ,public :: InternalControllerOptions

integer(ik) :: currentNumSubsteps = 1
integer(ik) :: stepMultiplier = 2
integer(ik) :: stepDecrament = 1
integer(ik) :: currentNumSubsteps = 1 !! The current number of sub- timesteps
integer(ik) :: stepMultiplier = 2 !! Which number to multiply the current number of substeps when a solve failure is detected
integer(ik) :: stepDecrament = 1 !! By how much to decrament the current number of timesteps when the number of nonlinear iterations drops below minNonlinIters

integer(ik) :: minNonlinIters = 5
integer(ik) :: minNonlinIters = 5 !! Number of nonlinear iterations below which the number of substeps gets reduced

integer(ik) :: maxRestarts = 3
integer(ik) :: restartCount = 0
integer(ik) :: maxRestarts = 3 !! Maximum number of consecutive solver restart attempts before critical failure is announced
integer(ik) :: restartCount = 0 !! Counter for consecutive number of solver restars

integer(ik) :: consolidationInterval = 50 !! How many integration calls before currentNumSubsteps is again reduced to 1
integer(ik) :: stepsSinceLastConsolidation = 0 !! Counter for steps since last consolidation to 1 substep

end type InternalControllerOptions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@ module subroutine integrateBDE(this,manipulatedModeller,outputVars,inputVars)
call tryIntegrate(this,manipulatedModeller,outputVars,inputVars,numSteps,dt,solveSuccess)
if (solveSuccess) then
this%internalControlOpts%restartCount = 0
this%internalControlOpts%stepsSinceLastConsolidation = this%internalControlOpts%stepsSinceLastConsolidation + 1

if (this%internalControlOpts%stepsSinceLastConsolidation >= this%internalControlOpts%consolidationInterval) then
this%internalControlOpts%currentNumSubsteps = 1
this%internalControlOpts%stepsSinceLastConsolidation = 0
call printMessage(this%integratorName//": Consolidating internal BDE steps")
end if
exit
end if
end do
Expand Down
3 changes: 3 additions & 0 deletions src/modules/solver_support/petsc_controller_procedures.f90
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ module subroutine createPETScObjs(this)
call KSPSetType(this%objs(i)%solver,this%options%kspSolverType,ierr)
CHKERRQ(ierr)

call KSPSetFromOptions(this%objs(i)%solver,ierr)
CHKERRQ(ierr)

call KSPGetPC(this%objs(i)%solver,this%objs(i)%preconditioner,ierr)
CHKERRQ(ierr)

Expand Down

0 comments on commit 3dcbfed

Please sign in to comment.