42 real(real64),
allocatable :: ep(:)
43 real(real64),
allocatable :: mu(:)
44 real(real64),
allocatable :: c(:)
45 real(real64),
allocatable :: sigma_e(:)
46 real(real64),
allocatable :: sigma_m(:)
47 integer :: points_number
48 integer :: global_points_number
49 integer,
allocatable :: points_map(:)
50 logical :: has_mapping = .
true.
51 integer :: bdry_number
52 integer,
allocatable :: bdry_map(:)
53 real(real64),
allocatable :: aux_ep(:,:)
54 real(real64),
allocatable :: aux_mu(:,:)
56 real(real64) :: center(3)
57 real(real64) :: lsize(3)
58 character(len=256) :: filename
59 logical :: check_medium_points = .false.
67 type(grid_t),
pointer,
public :: system_gr => null()
68 type(single_medium_box_t),
public :: partner_medium_box
69 type(single_medium_box_t),
public :: medium_box
87 class(interaction_partner_t),
target,
intent(inout) :: partner
88 class(linear_medium_to_em_field_t),
pointer :: this
94 this%label =
"linear_medium_to_em_field"
95 this%partner => partner
98 this%intra_interaction = .false.
105 class(linear_medium_to_em_field_t),
intent(inout) :: this
106 type(grid_t),
target,
intent(in) :: gr
113 this%medium_box%has_mapping = .false.
120 type(linear_medium_to_em_field_t),
intent(inout) :: this
131 class(linear_medium_to_em_field_t),
intent(inout) :: this
154 integer,
intent(in) :: n_points
157 push_sub_with_profile(medium_box_allocate)
158 safe_allocate(medium_box%aux_ep(1:n_points,1:3))
159 safe_allocate(medium_box%aux_mu(1:n_points,1:3))
160 safe_allocate(medium_box%c(1:n_points))
161 safe_allocate(medium_box%ep(1:n_points))
162 safe_allocate(medium_box%mu(1:n_points))
163 safe_allocate(medium_box%sigma_e(1:n_points))
164 safe_allocate(medium_box%sigma_m(1:n_points))
165 safe_allocate(medium_box%points_map(1:n_points))
166 medium_box%points_map = 0
172 medium_box%sigma_e(:) =
m_zero
173 medium_box%sigma_m(:) =
m_zero
174 medium_box%points_number = n_points
175 pop_sub_with_profile(medium_box_allocate)
185 push_sub_with_profile(medium_box_end)
187 safe_deallocate_a(medium_box%points_map)
188 safe_deallocate_a(medium_box%bdry_map)
189 safe_deallocate_a(medium_box%aux_ep)
190 safe_deallocate_a(medium_box%aux_mu)
191 safe_deallocate_a(medium_box%c)
192 safe_deallocate_a(medium_box%ep)
193 safe_deallocate_a(medium_box%mu)
194 safe_deallocate_a(medium_box%sigma_e)
195 safe_deallocate_a(medium_box%sigma_m)
197 pop_sub_with_profile(medium_box_end)
205 type(
grid_t),
intent(in) :: grid_out
208 integer :: ip, ip_out
210 push_sub_with_profile(medium_box_to_grid)
212 safe_allocate(medium_box_out)
214 medium_box_out%has_mapping = .false.
216 do ip = 1, medium_box%points_number
217 ip_out = medium_box%points_map(ip)
218 medium_box_out%aux_ep(ip_out,1:3) = medium_box%aux_ep(ip,1:3)
219 medium_box_out%aux_mu(ip_out,1:3) = medium_box%aux_mu(ip,1:3)
220 medium_box_out%ep(ip_out) = medium_box%ep(ip)
221 medium_box_out%mu(ip_out) = medium_box%mu(ip)
222 medium_box_out%c(ip_out) = medium_box%c(ip)
223 medium_box_out%sigma_e(ip_out) = medium_box%sigma_e(ip)
224 medium_box_out%sigma_m(ip_out) = medium_box%sigma_m(ip)
227 pop_sub_with_profile(medium_box_to_grid)
real(real64), parameter, public m_zero
This module implements the underlying real-space grid.
This module defines the abstract interaction_t class, and some auxiliary classes for interactions.
This module defines classes and functions for interaction partners.
subroutine, public single_medium_box_allocate(medium_box, n_points)
Allocation of medium_box components.
subroutine linear_medium_to_em_field_finalize(this)
subroutine linear_medium_to_em_field_init(this, gr)
subroutine, public single_medium_box_end(medium_box)
Deallocation of medium_box components.
subroutine linear_medium_to_em_field_calculate(this)
subroutine linear_medium_to_em_field_calculate_energy(this)
class(linear_medium_to_em_field_t) function, pointer linear_medium_to_em_field_constructor(partner)
class(single_medium_box_t) function, pointer single_medium_box_to_grid(medium_box, grid_out)
This module defines the quantity_t class and the IDs for quantities, which can be exposed by a system...
integer, parameter, public e_conductivity
integer, parameter, public m_conductivity
integer, parameter, public permittivity
integer, parameter, public permeability
Description of the grid, containing information on derivatives, stencil, and symmetries.
abstract interaction class