19 integer,
intent(in) :: ixI^L, ixO^L
20 double precision,
intent(in) :: x(ixI^S,1:ndim)
21 double precision,
intent(inout) :: B(ixI^S,1:ndir)
23 double precision :: xsincos(ixI^S),xsinsin(ixI^S),xcos(ixI^S)
24 double precision :: rr0(ixI^S),mdotr(ixI^S)
30 rr0(ixo^s)=dsqrt((x(ixo^s,1)-
x1_dip)**2 &
33 if(any(rr0(ixo^s)<smalldouble))
call mpistop(
"dipole center at cell center")
37 xsincos(ixo^s)=(x(ixo^s,1)-
x1_dip)/rr0(ixo^s)
38 xsinsin(ixo^s)=(x(ixo^s,2)-
x2_dip)/rr0(ixo^s)
39 xcos(ixo^s) =(x(ixo^s,3)-
x3_dip)/rr0(ixo^s)
40 mdotr(ixo^s)=
mx*xsincos(ixo^s)+
my*xsinsin(ixo^s)+
mz*xcos(ixo^s)
41 b(ixo^s,1)=(3.0d0*xsincos(ixo^s)*mdotr(ixo^s)-
mx)/rr0(ixo^s)**3
42 b(ixo^s,2)=(3.0d0*xsinsin(ixo^s)*mdotr(ixo^s)-
my)/rr0(ixo^s)**3
43 b(ixo^s,3)=(3.0d0*xcos(ixo^s) *mdotr(ixo^s)-
mz)/rr0(ixo^s)**3
subroutine, public mpistop(message)
Exit MPI-AMRVAC with an error message.
sets up a magnetic dipole in a 3D cartesian box
double precision phi_dipole
double precision mu_dipole
subroutine dipole(ixIL, ixOL, x, B)
double precision theta_dipole
This module contains definitions of global parameters and variables and some generic functions/subrou...