11 double precision :: xp(1:ndim),wp(1:nw)
12 character(*) :: variable_type
13 integer,
intent(in) :: igrid
15 double precision :: dxb^D,xd^D,xb^L,temp
16 integer :: ixI^L,ixO^L
17 integer :: ixbl^D,ix^D,ixA^L,j,ingrid
18 double precision :: factor(0:1^D&)
25 {
if (xp(^db)>xbmin^db .and. xp(^db)<xbmax^db) ingrid=ingrid+1\}
27 if (ingrid==ndim)
then
29 ^d&ixbl^d=floor((xp(^d)-ps(igrid)%x(ixomin^dd,^d))/dxb^d)+ixomin^d\
30 ^d&xd^d=(xp(^d)-ps(igrid)%x(ixbl^dd,^d))/dxb^d\
35 factor(ix^d)={abs(1-ix^d-xd^d)*}
38 select case(variable_type)
44 call mpistop(
"get_point_w_ingrid: Unknown variable type!")
50 wp(j)=wp(j)+factor(ix^d)*ps(igrid)%w(ixbl^d+ix^d,j)
54 select case(variable_type)
60 call mpistop(
"get_point_w_ingrid: Unknown variable type!")
64 wp(iw_mag(1):iw_mag(
ndir))=0.d0
68 temp=ps(igrid)%w(ixbl^d+ix^d,iw_mag(j))+&
69 ps(igrid)%B0(ixbl^d+ix^d,j,0)
70 wp(iw_mag(j))=wp(iw_mag(j))+factor(ix^d)*temp
72 temp=ps(igrid)%w(ixbl^d+ix^d,iw_mag(j))
73 wp(iw_mag(j))=wp(iw_mag(j))+factor(ix^d)*temp
79 call mpistop(
"get_point_w_ingrid: The point is not in given grid!")
87 double precision :: xp(1:ndim),wp(1:nw)
88 character(*) :: variable_type
90 double precision :: x3d(3)
91 integer :: indomain,ipe,igrid,j
94 {
if (xp(^db)>=xprobmin^db .and. xp(^db)<xprobmax^db) indomain=indomain+1\}
95 if (indomain==ndim)
then
109 call mpi_bcast(wp,nw,mpi_double_precision,ipe,
icomm,
ierrmpi)
118 double precision :: xp(1:ndim),wc(1:nw)
119 character(*) :: variable_type
121 double precision :: x3d(3)
122 double precision :: dxb^D,xb^L
123 integer :: indomain,ixO^L,ixb^D,ixA^L,ixI^L
124 integer :: ipe,igrid,j
127 {
if (xp(^db)>=xprobmin^db .and. xp(^db)<xprobmax^db) indomain=indomain+1\}
128 if (indomain==ndim)
then
145 ^d&ixb^d=floor((xp(^d)-xbmin^d)/dxb^d)+ixomin^d\
150 select case(variable_type)
154 wc(j)=ps(igrid)%w(ixb^d,j)
159 wc(j)=ps(igrid)%w(ixb^d,j)
162 call mpistop(
"get_point_w: Unknown variable type!")
167 wc(iw_mag(1):iw_mag(
ndir))=0.d0
170 wc(iw_mag(j))=ps(igrid)%w(ixb^d,iw_mag(j))+&
171 ps(igrid)%B0(ixb^d,j,0)
173 wc(iw_mag(j))=ps(igrid)%w(ixb^d,iw_mag(j))
179 call mpi_bcast(wc,nw,mpi_double_precision,ipe,
icomm,
ierrmpi)
188 double precision :: xp(1:ndim)
189 integer :: ipe,igrid,ixc^D
191 double precision :: x3d(1:3)
192 double precision :: dxb^D,xb^L
193 integer :: indomain,ixO^L,j
194 integer :: datas(1:ndim+2)
197 {
if (xp(^db)>=xprobmin^db .and. xp(^db)<xprobmax^db) indomain=indomain+1\}
199 if (indomain==ndim)
then
213 ^d&ixc^d=floor((xp(^d)-xbmin^d)/dxb^d)+ixomin^d\
219 call mpi_bcast(datas,ndim+2,mpi_integer,ipe,
icomm,
ierrmpi)
subroutine mpistop(message)
Exit MPI-AMRVAC with an error message.
This module contains definitions of global parameters and variables and some generic functions/subrou...
integer ixghi
Upper index of grid block arrays.
integer, parameter rpxmin
integer icomm
The MPI communicator.
integer mype
The rank of the current MPI task.
integer ndir
Number of spatial dimensions (components) for vector variables.
integer ixm
the mesh range (within a block with ghost cells)
integer ierrmpi
A global MPI error return code.
logical b0field
split magnetic field as background B0 field
double precision, dimension(:,:), allocatable rnode
Corner coordinates.
integer, parameter rpxmax
integer, parameter ixglo
Lower index of grid block arrays (always 1)
Module with shared functionality for all the particle movers.
subroutine find_particle_ipe(x, igrid_particle, ipe_particle)
This module defines the procedures of a physics module. It contains function pointers for the various...
procedure(sub_convert), pointer phys_to_primitive
procedure(sub_convert), pointer phys_to_conserved
character(len=name_len) physics_type
String describing the physics type of the simulation.
subroutine get_point_w(xp, wp, variable_type)
subroutine get_cell_index(xp, ipe, igrid, ixcD)
subroutine get_cell_w(xp, wc, variable_type)
subroutine get_point_w_ingrid(igrid, xp, wp, variable_type)