12 double precision :: xp(1:ndim),wp(1:nw)
13 character(*) :: variable_type
14 integer,
intent(in) :: igrid
16 double precision :: dxb^D,xd^D,xb^L,temp
17 double precision :: factor(0:1^D&)
18 integer :: ixI^L,ixO^L
19 integer :: ixbl^D,ix^D,ixA^L,j,ingrid
26 {
if (xp(^db)>xbmin^db .and. xp(^db)<xbmax^db) ingrid=ingrid+1\}
28 if (ingrid==ndim)
then
30 ^d&ixbl^d=floor((xp(^d)-ps(igrid)%x(ixomin^dd,^d))/dxb^d)+ixomin^d\
31 ^d&xd^d=(xp(^d)-ps(igrid)%x(ixbl^dd,^d))/dxb^d\
36 factor(ix^d)={abs(1-ix^d-xd^d)*}
39 select case(variable_type)
45 call mpistop(
"get_point_w_ingrid: Unknown variable type!")
51 wp(j)=wp(j)+factor(ix^d)*ps(igrid)%w(ixbl^d+ix^d,j)
55 select case(variable_type)
61 call mpistop(
"get_point_w_ingrid: Unknown variable type!")
65 wp(iw_mag(1):iw_mag(
ndir))=0.d0
69 temp=ps(igrid)%w(ixbl^d+ix^d,iw_mag(j))+&
70 ps(igrid)%B0(ixbl^d+ix^d,j,0)
71 wp(iw_mag(j))=wp(iw_mag(j))+factor(ix^d)*temp
73 temp=ps(igrid)%w(ixbl^d+ix^d,iw_mag(j))
74 wp(iw_mag(j))=wp(iw_mag(j))+factor(ix^d)*temp
80 call mpistop(
"get_point_w_ingrid: The point is not in given grid!")
88 double precision :: xp(1:ndim),wp(1:nw)
89 character(*) :: variable_type
91 double precision :: x3d(3)
92 integer :: indomain,ipe,igrid,j
95 {
if (xp(^db)>=xprobmin^db .and. xp(^db)<xprobmax^db) indomain=indomain+1\}
96 if (indomain==ndim)
then
110 call mpi_bcast(wp,nw,mpi_double_precision,ipe,
icomm,
ierrmpi)
119 double precision :: xp(1:ndim),wc(1:nw)
120 character(*) :: variable_type
122 double precision :: x3d(3)
123 double precision :: dxb^D,xb^L
124 integer :: indomain,ixO^L,ixb^D,ixA^L,ixI^L
125 integer :: ipe,igrid,j
128 {
if (xp(^db)>=xprobmin^db .and. xp(^db)<xprobmax^db) indomain=indomain+1\}
129 if (indomain==ndim)
then
146 ^d&ixb^d=floor((xp(^d)-xbmin^d)/dxb^d)+ixomin^d\
151 select case(variable_type)
155 wc(j)=ps(igrid)%w(ixb^d,j)
160 wc(j)=ps(igrid)%w(ixb^d,j)
163 call mpistop(
"get_point_w: Unknown variable type!")
168 wc(iw_mag(1):iw_mag(
ndir))=0.d0
171 wc(iw_mag(j))=ps(igrid)%w(ixb^d,iw_mag(j))+&
172 ps(igrid)%B0(ixb^d,j,0)
174 wc(iw_mag(j))=ps(igrid)%w(ixb^d,iw_mag(j))
180 call mpi_bcast(wc,nw,mpi_double_precision,ipe,
icomm,
ierrmpi)
189 double precision :: xp(1:ndim)
190 integer :: ipe,igrid,ixc^D
192 double precision :: x3d(1:3)
193 double precision :: dxb^D,xb^L
194 integer :: indomain,ixO^L,j
195 integer :: datas(1:ndim+2)
198 {
if (xp(^db)>=xprobmin^db .and. xp(^db)<xprobmax^db) indomain=indomain+1\}
200 if (indomain==ndim)
then
214 ^d&ixc^d=floor((xp(^d)-xbmin^d)/dxb^d)+ixomin^d\
220 call mpi_bcast(datas,ndim+2,mpi_integer,ipe,
icomm,
ierrmpi)
subroutine, public 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 of a physical block without 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)