Afivo
0.3
|
This module contains routines for including flat surfaces between changes in epsilon (some material property). This can for example be used to include flat dielectrics in electrostatic computations. More...
Data Types | |
type | surface_t |
Type for a single surface. More... | |
type | surfaces_t |
Type for storing all the surfaces on a mesh. More... | |
interface | value_func |
Functions/Subroutines | |
subroutine, public | surface_initialize (tree, i_eps, diel, n_variables) |
Initialize a set of surfaces based on the value of epsilon. More... | |
integer function | get_new_surface_ix (diel) |
Get index for new surface. More... | |
subroutine, public | surface_set_values (tree, diel, iv, user_func) |
Set values on a dielectric with a user-defined function. More... | |
subroutine, public | surface_set_weighted_sum (diel, i_out, i_in, w_in) |
Set surface variable to a weighted sum of other variables. More... | |
subroutine, public | surface_copy_variable (diel, i_in, i_out) |
Copy surface variable to another index. More... | |
subroutine, public | surface_get_integral (tree, diel, i_surf, surf_int) |
Compute integral of surface variable. More... | |
subroutine, public | surface_update_after_refinement (tree, diel, ref_info) |
Update the dielectric surface after the mesh has been refined. More... | |
subroutine | prolong_surface_from_parent (tree, diel, p_ix, p_id) |
Prolong a parent surface to newly created child surfaces. More... | |
subroutine | restrict_surface_to_parent (tree, diel, ix) |
Restrict a child surface to its parent. More... | |
subroutine, public | surface_get_refinement_links (diel, refinement_links) |
Get an array of pairs of boxes (their indices) across a surface. This can be used in af_adjust_refinement to prevent refinement jumps over the surface. More... | |
subroutine, public | surface_surface_charge_to_rhs (tree, diel, i_sigma, i_rhs, fac) |
Map surface charge to a cell-centered right-hand side. More... | |
subroutine | surface_charge_to_rhs (boxes, surface, i_sigma, i_rhs, fac) |
Routine that implements the mapping of surface charge to a cell-centered right-hand side. More... | |
subroutine, public | surface_inside_layer_to_surface (tree, diel, i_cc, i_sigma, fac, clear_cc, clear_surf) |
Map first layer inside the dielectric to surface density. More... | |
subroutine | inside_layer_to_surface (boxes, surface, i_cc, i_sigma, fac, clear_cc, clear_surf) |
Map first layer inside the dielectric to surface density. More... | |
subroutine, public | surface_correct_field_fc (tree, diel, i_sigma, i_fld, i_phi, fac) |
Compute the electric field at face centers near surfaces. More... | |
subroutine, public | surface_correct_field_cc (tree, diel, i_sigma, i_fld, i_phi, fac) |
Compute the electric field at cell centers near surfaces. More... | |
subroutine, public | surface_get_surface_cell (tree, diel, x, ix_surf, ix_cell) |
subroutine, public | surface_write_output (tree, diel, i_vars, var_names, output_name, output_cnt) |
Write surface quantities to a separate output file. More... | |
Variables | |
integer, parameter, public | surface_none = -1 |
Value indicating there is no surface. More... | |
This module contains routines for including flat surfaces between changes in epsilon (some material property). This can for example be used to include flat dielectrics in electrostatic computations.
subroutine, public m_af_surface::surface_initialize | ( | type(af_t), intent(inout) | tree, |
integer, intent(in) | i_eps, | ||
type(surfaces_t), intent(inout) | diel, | ||
integer, intent(in) | n_variables | ||
) |
Initialize a set of surfaces based on the value of epsilon.
[in,out] | tree | Initialized grid |
[in] | i_eps | Which variable stores epsilon |
[in,out] | diel | The dielectric surface |
[in] | n_variables | Number of surface variables |
Definition at line 89 of file m_af_surface.f90.
integer function m_af_surface::get_new_surface_ix | ( | type(surfaces_t), intent(inout) | diel | ) |
Get index for new surface.
Definition at line 175 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_set_values | ( | type(af_t), intent(in) | tree, |
type(surfaces_t), intent(inout) | diel, | ||
integer, intent(in) | iv, | ||
procedure(value_func) | user_func | ||
) |
Set values on a dielectric with a user-defined function.
[in] | iv | Surface variable |
user_func | User supplied function |
Definition at line 205 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_set_weighted_sum | ( | type(surfaces_t), intent(inout) | diel, |
integer, intent(in) | i_out, | ||
integer, dimension(:), intent(in) | i_in, | ||
real(dp), dimension(:), intent(in) | w_in | ||
) |
Set surface variable to a weighted sum of other variables.
[in] | i_out | Output surface density |
[in] | i_in | List of input surface densities |
[in] | w_in | Weights of input densities |
Definition at line 247 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_copy_variable | ( | type(surfaces_t), intent(inout) | diel, |
integer, intent(in) | i_in, | ||
integer, intent(in) | i_out | ||
) |
Copy surface variable to another index.
[in] | i_in | Input surface density |
[in] | i_out | Output surface density |
Definition at line 275 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_get_integral | ( | type(af_t), intent(in) | tree, |
type(surfaces_t), intent(in) | diel, | ||
integer, intent(in) | i_surf, | ||
real(dp), intent(out) | surf_int | ||
) |
Compute integral of surface variable.
[in] | i_surf | Surface variables |
[out] | surf_int | Surface integral |
Definition at line 293 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_update_after_refinement | ( | type(af_t), intent(in) | tree, |
type(surfaces_t), intent(inout) | diel, | ||
type(ref_info_t), intent(in) | ref_info | ||
) |
Update the dielectric surface after the mesh has been refined.
Definition at line 327 of file m_af_surface.f90.
|
private |
Prolong a parent surface to newly created child surfaces.
[in] | p_ix | Index of parent surface |
[in] | p_id | Index of parent box (on outside) |
Definition at line 366 of file m_af_surface.f90.
|
private |
Restrict a child surface to its parent.
Definition at line 432 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_get_refinement_links | ( | type(surfaces_t), intent(in) | diel, |
integer, dimension(:, :), intent(inout), allocatable | refinement_links | ||
) |
Get an array of pairs of boxes (their indices) across a surface. This can be used in af_adjust_refinement to prevent refinement jumps over the surface.
[in,out] | refinement_links | Array of linked boxes, on output of size (2, n_links) |
Definition at line 472 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_surface_charge_to_rhs | ( | type(af_t), intent(inout) | tree, |
type(surfaces_t), intent(in) | diel, | ||
integer, intent(in) | i_sigma, | ||
integer, intent(in) | i_rhs, | ||
real(dp), intent(in) | fac | ||
) |
Map surface charge to a cell-centered right-hand side.
[in] | i_sigma | Surface charage variable |
[in] | i_rhs | Rhs variable (in the tree) |
[in] | fac | Multiplication factor |
Definition at line 494 of file m_af_surface.f90.
|
private |
Routine that implements the mapping of surface charge to a cell-centered right-hand side.
[in] | i_sigma | Surface charage variable |
[in] | i_rhs | Rhs variable (in the tree) |
[in] | fac | Multiplication factor |
Definition at line 514 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_inside_layer_to_surface | ( | type(af_t), intent(inout) | tree, |
type(surfaces_t), intent(inout) | diel, | ||
integer, intent(in) | i_cc, | ||
integer, intent(in) | i_sigma, | ||
real(dp), intent(in) | fac, | ||
logical, intent(in) | clear_cc, | ||
logical, intent(in) | clear_surf | ||
) |
Map first layer inside the dielectric to surface density.
[in] | i_cc | Cell-centered variable (in the tree) |
[in] | i_sigma | Surface charage variable |
[in] | fac | Multiplication factor |
[in] | clear_cc | Set density to zero afterwards |
[in] | clear_surf | Set surface density to zero initially |
Definition at line 569 of file m_af_surface.f90.
|
private |
Map first layer inside the dielectric to surface density.
[in] | i_cc | Cell-centered variable (in the tree) |
[in] | i_sigma | Surface charage variable |
[in] | fac | Multiplication factor |
[in] | clear_cc | Set density to zero afterwards |
[in] | clear_surf | Set surface density to zero initially |
Definition at line 591 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_correct_field_fc | ( | type(af_t), intent(inout) | tree, |
type(surfaces_t), intent(in) | diel, | ||
integer, intent(in) | i_sigma, | ||
integer, intent(in) | i_fld, | ||
integer, intent(in) | i_phi, | ||
real(dp), intent(in) | fac | ||
) |
Compute the electric field at face centers near surfaces.
[in] | i_sigma | Surface charge variable |
[in] | i_fld | Face-centered field variable |
[in] | i_phi | Cell-centered potential variable |
[in] | fac | Elementary charge over eps0 |
Definition at line 629 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_correct_field_cc | ( | type(af_t), intent(inout) | tree, |
type(surfaces_t), intent(in) | diel, | ||
integer, intent(in) | i_sigma, | ||
integer, dimension(ndim), intent(in) | i_fld, | ||
integer, intent(in) | i_phi, | ||
real(dp), intent(in) | fac | ||
) |
Compute the electric field at cell centers near surfaces.
[in] | i_sigma | Surface charge variable |
[in] | i_fld | Cell-centered field variables |
[in] | i_phi | Cell-centered potential variable |
[in] | fac | Elementary charge over eps0 |
Definition at line 731 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_get_surface_cell | ( | type(af_t), intent(in) | tree, |
type(surfaces_t), intent(in) | diel, | ||
real(dp), dimension(ndim), intent(in) | x, | ||
integer, intent(out) | ix_surf, | ||
integer, dimension(ndim-1), intent(out) | ix_cell | ||
) |
[in] | x | Coordinate inside dielectric |
[out] | ix_surf | Index of surface |
[out] | ix_cell | Index of cell on surface |
Definition at line 822 of file m_af_surface.f90.
subroutine, public m_af_surface::surface_write_output | ( | type(af_t), intent(inout) | tree, |
type(surfaces_t), intent(in) | diel, | ||
integer, dimension(:), intent(in) | i_vars, | ||
character(len=*), dimension(:), intent(in) | var_names, | ||
character(len=*), intent(in) | output_name, | ||
integer, intent(in) | output_cnt | ||
) |
Write surface quantities to a separate output file.
[in] | i_vars | Indices of the variables |
[in] | var_names | Names of the variables |
[in] | output_name | Base name for output |
[in] | output_cnt | Index of output |
Definition at line 851 of file m_af_surface.f90.
integer, parameter, public m_af_surface::surface_none = -1 |
Value indicating there is no surface.
Definition at line 27 of file m_af_surface.f90.