afivo-streamer 1.1
1D/2D/3D streamer simulations with AMR
Loading...
Searching...
No Matches
m_user_methods.f90
Go to the documentation of this file.
1!> This module contains all the methods that users can customize
3#include "../afivo/src/cpp_macros.h"
4 use m_af_all
5 use m_types
6
7 implicit none
8 public
9
10 !< [method_list]
11 !> User-defined refinement routine
12 procedure(af_subr_ref), pointer :: user_refine => null()
13
14 !> If defined, call this routine after setting initial conditions
15 procedure(af_subr), pointer :: user_initial_conditions => null()
16
17 !> If defined, call this routine after a new voltage pulse starts
18 procedure(af_subr), pointer :: user_new_pulse_conditions => null()
19
20 !> To set custom boundary conditions for the electric potential
21 procedure(af_subr_bc), pointer :: user_potential_bc => null()
22
23 !> To set a user-defined gas number density
24 procedure(gas_dens_func), pointer :: user_gas_density => null()
25
26 !> To set the field amplitude manually
27 procedure(field_func), pointer :: user_field_amplitude => null()
28
29 !> Generic procedure that is called every time step
30 procedure(generic_subr), pointer :: user_generic_method => null()
31
32 !> To write a custom log file
33 procedure(log_subr), pointer :: user_write_log => null()
34
35 !> To add entries to the log file
36 procedure(log_vars), pointer :: user_log_variables => null()
37
38 !> Custom level-set function to define an electrode
39 procedure(mg_func_lsf), pointer :: user_lsf => null()
40
41 !> Function to get boundary value for level set function
42 procedure(mg_func_lsf), pointer :: user_lsf_bc => null()
43 !< [method_list]
44
45 integer, parameter :: user_max_log_vars = 20
46
47 interface
48 !< [interface_list]
49 subroutine log_subr(tree, filename, out_cnt)
50 import
51 type(af_t), intent(in) :: tree
52 character(len=*), intent(in) :: filename
53 integer, intent(in) :: out_cnt
54 end subroutine log_subr
55
56 subroutine log_vars(tree, n_vars, var_names, var_values)
57 import
58 type(af_t), intent(in) :: tree
59 integer, intent(out) :: n_vars
60 character(len=name_len), intent(inout) :: var_names(user_max_log_vars)
61 real(dp), intent(inout) :: var_values(user_max_log_vars)
62 end subroutine log_vars
63
64 function gas_dens_func(box, IJK) result(dens)
65 import
66 type(box_t), intent(in) :: box
67 integer, intent(in) :: ijk
68 real(dp) :: dens
69 end function gas_dens_func
70
71 function field_func(tree, time) result(amplitude)
72 import
73 type(af_t), intent(in) :: tree
74 real(dp), intent(in) :: time
75 real(dp) :: amplitude
76 end function field_func
77
78 logical function bool_subr(tree, time)
79 import
80 type(af_t), intent(in) :: tree
81 real(dp), intent(in) :: time
82 end function bool_subr
83
84 subroutine generic_subr(tree, time)
85 import
86 type(af_t), intent(in) :: tree
87 real(dp), intent(in) :: time
88 end subroutine generic_subr
89 !< [interface_list]
90 end interface
91
92end module m_user_methods
Module with basic types.
Definition m_types.f90:2
This module contains all the methods that users can customize.
integer, parameter user_max_log_vars
procedure(mg_func_lsf), pointer user_lsf_bc
Function to get boundary value for level set function.
procedure(gas_dens_func), pointer user_gas_density
To set a user-defined gas number density.
procedure(field_func), pointer user_field_amplitude
To set the field amplitude manually.
procedure(generic_subr), pointer user_generic_method
Generic procedure that is called every time step.
procedure(af_subr), pointer user_initial_conditions
If defined, call this routine after setting initial conditions.
procedure(log_subr), pointer user_write_log
To write a custom log file.
procedure(af_subr_bc), pointer user_potential_bc
To set custom boundary conditions for the electric potential.
procedure(log_vars), pointer user_log_variables
To add entries to the log file.
procedure(mg_func_lsf), pointer user_lsf
Custom level-set function to define an electrode.
procedure(af_subr_ref), pointer user_refine
User-defined refinement routine.
procedure(af_subr), pointer user_new_pulse_conditions
If defined, call this routine after a new voltage pulse starts.