MPI-AMRVAC  2.2
The MPI - Adaptive Mesh Refinement - Versatile Advection Code
Data Types | Functions/Subroutines | Variables
mod_physics Module Reference

This module defines the procedures of a physics module. It contains function pointers for the various supported routines. An actual physics module has to set these pointers to its implementation of these routines. More...

Data Types

type  iw_methods
 Type for special methods defined per variable. More...
 
interface  sub_add_source
 
interface  sub_add_source_geom
 
interface  sub_angmomfix
 
interface  sub_boundary_adjust
 
interface  sub_check_params
 
interface  sub_check_w
 
interface  sub_convert
 
interface  sub_face_to_center
 
interface  sub_get_aux
 
interface  sub_get_cbounds
 
interface  sub_get_cmax
 
interface  sub_get_dt
 
interface  sub_get_flux
 
interface  sub_get_pthermal
 
interface  sub_get_v_idim
 
interface  sub_get_var
 
interface  sub_global_source
 Add global source terms on complete domain (potentially implicit) More...
 
interface  sub_modify_wLR
 
interface  sub_small_values
 
interface  sub_update_faces
 
interface  sub_write_info
 

Functions/Subroutines

subroutine phys_check ()
 
subroutine dummy_init_params
 
subroutine dummy_check_params
 
subroutine dummy_modify_wlr (ixIL, ixOL, wLC, wRC, wLp, wRp, s, idir)
 
subroutine dummy_add_source_geom (qdt, ixIL, ixOL, wCT, w, x)
 
subroutine dummy_add_source (qdt, ixIL, ixOL, wCT, w, x, qsourcesplit, active)
 
subroutine dummy_get_aux (clipping, w, x, ixIL, ixOL, subname)
 
subroutine dummy_check_w (primitive, ixIL, ixOL, w, w_flag)
 
subroutine dummy_get_pthermal (w, x, ixIL, ixOL, pth)
 
subroutine dummy_boundary_adjust
 
subroutine dummy_write_info (fh)
 
subroutine dummy_angmomfix (fC, x, wnew, ixIL, ixOL, idim)
 
subroutine dummy_small_values (primitive, w, x, ixIL, ixOL, subname)
 
subroutine dummy_update_faces (ixIL, ixOL, qdt, wprim, fC, fE, sCT, s)
 
subroutine dummy_face_to_center (ixOL, s)
 

Variables

character(len=name_len) physics_type = ""
 String describing the physics type of the simulation. More...
 
integer phys_wider_stencil = 0
 To use wider stencils in flux calculations. A value of 1 will extend it by one cell in both directions, in any dimension. More...
 
logical phys_req_diagonal = .true.
 Whether the physics routines require diagonal ghost cells, for example for computing a curl. More...
 
integer, dimension(:, :), allocatable flux_type
 Array per direction per variable, which can be used to specify that certain fluxes have to be treated differently. More...
 
integer, parameter flux_default = 0
 Indicates a normal flux. More...
 
integer, parameter flux_tvdlf = 1
 Indicates the flux should be treated with tvdlf. More...
 
integer, parameter flux_no_dissipation = 2
 Indicates dissipation should be omitted. More...
 
type(iw_methods), dimension(max_nw) phys_iw_methods
 Special methods defined per variable. More...
 
procedure(sub_check_params), pointer phys_check_params => null()
 
procedure(sub_convert), pointer phys_to_conserved => null()
 
procedure(sub_convert), pointer phys_to_primitive => null()
 
procedure(sub_modify_wlr), pointer phys_modify_wlr => null()
 
procedure(sub_get_cmax), pointer phys_get_cmax => null()
 
procedure(sub_get_cbounds), pointer phys_get_cbounds => null()
 
procedure(sub_get_flux), pointer phys_get_flux => null()
 
procedure(sub_get_v_idim), pointer phys_get_v_idim => null()
 
procedure(sub_get_dt), pointer phys_get_dt => null()
 
procedure(sub_add_source_geom), pointer phys_add_source_geom => null()
 
procedure(sub_add_source), pointer phys_add_source => null()
 
procedure(sub_global_source), pointer phys_global_source => null()
 
procedure(sub_get_aux), pointer phys_get_aux => null()
 
procedure(sub_check_w), pointer phys_check_w => null()
 
procedure(sub_get_pthermal), pointer phys_get_pthermal => null()
 
procedure(sub_boundary_adjust), pointer phys_boundary_adjust => null()
 
procedure(sub_write_info), pointer phys_write_info => null()
 
procedure(sub_angmomfix), pointer phys_angmomfix => null()
 
procedure(sub_small_values), pointer phys_handle_small_values => null()
 
procedure(sub_update_faces), pointer phys_update_faces => null()
 
procedure(sub_face_to_center), pointer phys_face_to_center => null()
 

Detailed Description

This module defines the procedures of a physics module. It contains function pointers for the various supported routines. An actual physics module has to set these pointers to its implementation of these routines.

Function/Subroutine Documentation

◆ dummy_add_source()

subroutine mod_physics::dummy_add_source ( double precision, intent(in)  qdt,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, 1:nw), intent(in)  wCT,
double precision, dimension(ixi^s, 1:nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:ndim), intent(in)  x,
logical, intent(in)  qsourcesplit,
logical, intent(inout)  active 
)

Definition at line 330 of file mod_physics.t.

◆ dummy_add_source_geom()

subroutine mod_physics::dummy_add_source_geom ( double precision, intent(in)  qdt,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s, 1:nw), intent(inout)  wCT,
double precision, dimension(ixi^s, 1:nw), intent(inout)  w,
double precision, dimension(ixi^s, 1:^nd), intent(in)  x 
)

Definition at line 322 of file mod_physics.t.

◆ dummy_angmomfix()

subroutine mod_physics::dummy_angmomfix ( double precision, dimension(ixi^s,1:nwflux,1:ndim), intent(inout)  fC,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
double precision, dimension(ixi^s,1:nw), intent(inout)  wnew,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
integer, intent(in)  idim 
)

Definition at line 386 of file mod_physics.t.

◆ dummy_boundary_adjust()

subroutine mod_physics::dummy_boundary_adjust ( )

Definition at line 371 of file mod_physics.t.

◆ dummy_check_params()

subroutine mod_physics::dummy_check_params ( )

Definition at line 311 of file mod_physics.t.

◆ dummy_check_w()

subroutine mod_physics::dummy_check_w ( logical, intent(in)  primitive,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,nw), intent(in)  w,
integer, dimension(ixg^t), intent(inout)  w_flag 
)

Definition at line 350 of file mod_physics.t.

◆ dummy_face_to_center()

subroutine mod_physics::dummy_face_to_center ( integer, intent(in)  ixO,
integer, intent(in)  L,
type(state s 
)

Definition at line 414 of file mod_physics.t.

◆ dummy_get_aux()

subroutine mod_physics::dummy_get_aux ( logical, intent(in)  clipping,
double precision, dimension(ixi^s,nw), intent(inout)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
character(len=*)  subname 
)

Definition at line 341 of file mod_physics.t.

◆ dummy_get_pthermal()

subroutine mod_physics::dummy_get_pthermal ( double precision, dimension(ixi^s, nw), intent(in)  w,
double precision, dimension(ixi^s, 1:ndim), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s), intent(out)  pth 
)

Definition at line 360 of file mod_physics.t.

Here is the call graph for this function:

◆ dummy_init_params()

subroutine mod_physics::dummy_init_params ( )

Definition at line 308 of file mod_physics.t.

◆ dummy_modify_wlr()

subroutine mod_physics::dummy_modify_wlr ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, dimension(ixi^s,1:nw), intent(inout)  wLC,
double precision, dimension(ixi^s,1:nw), intent(inout)  wRC,
double precision, dimension(ixi^s,1:nw), intent(inout)  wLp,
double precision, dimension(ixi^s,1:nw), intent(inout)  wRp,
type(state s,
integer, intent(in)  idir 
)

Definition at line 314 of file mod_physics.t.

◆ dummy_small_values()

subroutine mod_physics::dummy_small_values ( logical, intent(in)  primitive,
double precision, dimension(ixi^s,1:nw), intent(inout)  w,
double precision, dimension(ixi^s,1:ndim), intent(in)  x,
integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
character(len=*), intent(in)  subname 
)

Definition at line 394 of file mod_physics.t.

◆ dummy_update_faces()

subroutine mod_physics::dummy_update_faces ( integer, intent(in)  ixI,
integer, intent(in)  L,
integer, intent(in)  ixO,
  L,
double precision, intent(in)  qdt,
double precision, dimension(ixi^s,1:nw), intent(in)  wprim,
double precision, dimension(ixi^s,1:nwflux,1:ndim), intent(in)  fC,
double precision, dimension(ixi^s,7-2*ndim:3), intent(inout)  fE,
type(state sCT,
type(state s 
)

Definition at line 403 of file mod_physics.t.

◆ dummy_write_info()

subroutine mod_physics::dummy_write_info ( integer, intent(in)  fh)
Parameters
[in]fhFile handle

Definition at line 374 of file mod_physics.t.

◆ phys_check()

subroutine mod_physics::phys_check ( )

Definition at line 235 of file mod_physics.t.

Here is the call graph for this function:

Variable Documentation

◆ flux_default

integer, parameter mod_physics::flux_default = 0

Indicates a normal flux.

Definition at line 29 of file mod_physics.t.

◆ flux_no_dissipation

integer, parameter mod_physics::flux_no_dissipation = 2

Indicates dissipation should be omitted.

Definition at line 33 of file mod_physics.t.

◆ flux_tvdlf

integer, parameter mod_physics::flux_tvdlf = 1

Indicates the flux should be treated with tvdlf.

Definition at line 31 of file mod_physics.t.

◆ flux_type

integer, dimension(:, :), allocatable mod_physics::flux_type

Array per direction per variable, which can be used to specify that certain fluxes have to be treated differently.

Definition at line 26 of file mod_physics.t.

◆ phys_add_source

procedure(sub_add_source), pointer mod_physics::phys_add_source => null()

Definition at line 55 of file mod_physics.t.

◆ phys_add_source_geom

procedure(sub_add_source_geom), pointer mod_physics::phys_add_source_geom => null()

Definition at line 54 of file mod_physics.t.

◆ phys_angmomfix

procedure(sub_angmomfix), pointer mod_physics::phys_angmomfix => null()

Definition at line 62 of file mod_physics.t.

◆ phys_boundary_adjust

procedure(sub_boundary_adjust), pointer mod_physics::phys_boundary_adjust => null()

Definition at line 60 of file mod_physics.t.

◆ phys_check_params

procedure(sub_check_params), pointer mod_physics::phys_check_params => null()

Definition at line 45 of file mod_physics.t.

◆ phys_check_w

procedure(sub_check_w), pointer mod_physics::phys_check_w => null()

Definition at line 58 of file mod_physics.t.

◆ phys_face_to_center

procedure(sub_face_to_center), pointer mod_physics::phys_face_to_center => null()

Definition at line 65 of file mod_physics.t.

◆ phys_get_aux

procedure(sub_get_aux), pointer mod_physics::phys_get_aux => null()

Definition at line 57 of file mod_physics.t.

◆ phys_get_cbounds

procedure(sub_get_cbounds), pointer mod_physics::phys_get_cbounds => null()

Definition at line 50 of file mod_physics.t.

◆ phys_get_cmax

procedure(sub_get_cmax), pointer mod_physics::phys_get_cmax => null()

Definition at line 49 of file mod_physics.t.

◆ phys_get_dt

procedure(sub_get_dt), pointer mod_physics::phys_get_dt => null()

Definition at line 53 of file mod_physics.t.

◆ phys_get_flux

procedure(sub_get_flux), pointer mod_physics::phys_get_flux => null()

Definition at line 51 of file mod_physics.t.

◆ phys_get_pthermal

procedure(sub_get_pthermal), pointer mod_physics::phys_get_pthermal => null()

Definition at line 59 of file mod_physics.t.

◆ phys_get_v_idim

procedure(sub_get_v_idim), pointer mod_physics::phys_get_v_idim => null()

Definition at line 52 of file mod_physics.t.

◆ phys_global_source

procedure(sub_global_source), pointer mod_physics::phys_global_source => null()

Definition at line 56 of file mod_physics.t.

◆ phys_handle_small_values

procedure(sub_small_values), pointer mod_physics::phys_handle_small_values => null()

Definition at line 63 of file mod_physics.t.

◆ phys_iw_methods

type(iw_methods), dimension(max_nw) mod_physics::phys_iw_methods

Special methods defined per variable.

Definition at line 43 of file mod_physics.t.

◆ phys_modify_wlr

procedure(sub_modify_wlr), pointer mod_physics::phys_modify_wlr => null()

Definition at line 48 of file mod_physics.t.

◆ phys_req_diagonal

logical mod_physics::phys_req_diagonal = .true.

Whether the physics routines require diagonal ghost cells, for example for computing a curl.

Definition at line 22 of file mod_physics.t.

◆ phys_to_conserved

procedure(sub_convert), pointer mod_physics::phys_to_conserved => null()

Definition at line 46 of file mod_physics.t.

◆ phys_to_primitive

procedure(sub_convert), pointer mod_physics::phys_to_primitive => null()

Definition at line 47 of file mod_physics.t.

◆ phys_update_faces

procedure(sub_update_faces), pointer mod_physics::phys_update_faces => null()

Definition at line 64 of file mod_physics.t.

◆ phys_wider_stencil

integer mod_physics::phys_wider_stencil = 0

To use wider stencils in flux calculations. A value of 1 will extend it by one cell in both directions, in any dimension.

Definition at line 18 of file mod_physics.t.

◆ phys_write_info

procedure(sub_write_info), pointer mod_physics::phys_write_info => null()

Definition at line 61 of file mod_physics.t.

◆ physics_type

character(len=name_len) mod_physics::physics_type = ""

String describing the physics type of the simulation.

Definition at line 14 of file mod_physics.t.