-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstep-relax.f90
76 lines (70 loc) · 2.59 KB
/
step-relax.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
!------------------------------------------------------------------------------!
! NDSPMHD: A Smoothed Particle (Magneto)Hydrodynamics code for (astrophysical) !
! fluid dynamics simulations in 1, 2 and 3 spatial dimensions. !
! !
! (c) 2002-2015 Daniel Price !
! !
! http://users.monash.edu.au/~dprice/ndspmhd !
! daniel.price@monash.edu -or- dprice@cantab.net (forwards to current address) !
! !
! NDSPMHD comes with ABSOLUTELY NO WARRANTY. !
! This is free software; and you are welcome to redistribute !
! it under the terms of the GNU General Public License !
! (see LICENSE file for details) and the provision that !
! this notice remains intact. If you modify this file, please !
! note section 2a) of the GPLv2 states that: !
! !
! a) You must cause the modified files to carry prominent notices !
! stating that you changed the files and the date of any change. !
! !
! ChangeLog: !
!------------------------------------------------------------------------------!
!----------------------
! Relax the particles
!----------------------
subroutine step
use dimen_mhd
use debug
use loguns
use bound
use options
use part
use part_in
use rates
use eos
use timestep, only:C_cour,dtcourant,dt
!
!--define local variables
!
implicit none
integer :: i
!
!--allow for tracing flow
!
if (trace) write(iprint,*) ' Entering subroutine relax'
do i=1,npart
xin(:,i) = x(:,i)
enddo
polyk = 1.
gamma = 2.
iener = 0
!
!--shift positions
!
do i=1,npart
if (itype(i).eq.itypebnd .or. itype(i).eq.itypebnd2) then ! fixed particles
x(:,i) = xin(:,i)
else
x(:,i) = xin(:,i) + 0.5*dt**2*force(1:ndim,i)
endif
vel(:,i) = 0.
enddo
!
!--calculate all derivatives
!
call derivs
dt = C_cour*dtcourant
if (any(ibound.ne.0)) call boundary ! inflow/outflow/periodic boundary conditions
if (trace) write (iprint,*) ' Exiting subroutine relax'
return
end subroutine step