implicit_diffusion Program

Read in the inital distribution from a SRIM file convert the depth coordinates in x from angstroms to cm convert the ion deposition source from atoms/cm^3 / atoms/cm^2 to just atoms/cm^3 by multiplying by the fluence Create a mesh Lets actually create a stiffness matrix, dissipation matrix, source term, history term, and forcing term The source term never changes, so we can calculate this only once The dissipation matrix and history dissipation matrix never change, so we can calculate this only once now we can go through the time steps initialize all of the matices and vectors to zero construct the first term of the forcing element Loop through the mesh elements and construct the terms find the mesh spacing now we can create the stiffness matrix Then, solve the matrix and print the solution


Variables

Type AttributesNameInitial
real(kind=8), allocatable, dimension(:):: x_source
real(kind=8), allocatable, dimension(:):: s_source
real(kind=8), allocatable, dimension(:):: x
real(kind=8) :: Phi
real(kind=8) :: D
real(kind=8) :: x_total
real(kind=8) :: delta_x
real(kind=8) :: delta_x_min
integer(kind=4) :: n_x
real(kind=8) :: t_final
real(kind=8) :: delta_t
real(kind=8) :: t
integer(kind=4) :: n_t
integer(kind=4) :: i
integer(kind=4) :: j
integer(kind=4) :: n
real(kind=8), allocatable, dimension(:,:):: K
real(kind=8), allocatable, dimension(:,:):: M
real(kind=8), allocatable, dimension(:,:):: Mkm1
real(kind=8), allocatable, dimension(:,:):: A
real(kind=8), allocatable, dimension(:):: Ckm1
real(kind=8), allocatable, dimension(:):: l
real(kind=8), allocatable, dimension(:):: S
real(kind=8), allocatable, dimension(:):: b
real(kind=8), allocatable, dimension(:):: Mkm1Ckm1
real(kind=8), allocatable, dimension(:):: C
real(kind=8) :: delta_xj
real(kind=8) :: delta_xjm1
real(kind=8) :: k_r
logical :: debug =.FALSE.
real(kind=8) :: t_save
real(kind=8) :: t_step
integer(kind=4) :: n_file