50 type(output_t),
intent(out) :: outp
51 type(namespace_t),
intent(in) :: namespace
52 class(space_t),
intent(in) :: space
84 'LinearMediumOutput',
'OutputFormat',
'OutputInterval')
95 call parse_variable(namespace,
'LinearMediumOutputDir',
"static", outp%iter_dir)
96 if (any(outp%what) .and. maxval(outp%output_interval) > 0)
then
97 call io_mkdir(outp%iter_dir, namespace)
107 type(output_t),
intent(in) :: outp
108 type(namespace_t),
intent(in) :: namespace
109 class(space_t),
intent(in) :: space
110 class(mesh_t),
intent(in) :: mesh
111 character(len=*),
intent(in) :: dir
112 real(real64),
intent(in) :: ep(:)
113 real(real64),
intent(in) :: mu(:)
114 real(real64),
intent(in) :: cc(:)
115 integer,
intent(in) :: points_map(:)
118 real(real64),
allocatable :: dtmp(:), dtmp2(:)
119 character(len=MAX_PATH_LEN) :: fname
123 if (any(outp%what))
then
124 message(1) =
"Info: Writing output to " // trim(dir)
130 if (outp%what(option__linearmediumoutput__permittivity))
then
131 write(fname,
'(1a)')
'medium-permittivity'
132 safe_allocate(dtmp(1:mesh%np))
135 dtmp(:) = dtmp /
p_ep
136 call dio_function_output(outp%how(option__linearmediumoutput__permittivity), dir, fname, namespace, space, &
138 safe_deallocate_a(dtmp)
142 if (outp%what(option__linearmediumoutput__permeability))
then
143 write(fname,
'(1a)')
'medium-permeability'
144 safe_allocate(dtmp(1:mesh%np))
147 dtmp(:) = dtmp /
p_mu
148 call dio_function_output(outp%how(option__linearmediumoutput__permeability), dir, fname, namespace, space, &
150 safe_deallocate_a(dtmp)
154 if (outp%what(option__linearmediumoutput__speed_of_light))
then
155 write(fname,
'(1a)')
'medium-speed-of-light'
156 safe_allocate(dtmp(1:mesh%np))
159 call dio_function_output(outp%how(option__linearmediumoutput__speed_of_light), dir, fname, namespace, space, &
161 safe_deallocate_a(dtmp)
165 if (outp%what(option__linearmediumoutput__points))
then
166 write(fname,
'(1a)')
'medium-points'
167 safe_allocate(dtmp(1:mesh%np))
168 safe_allocate(dtmp2(1:mesh%np))
172 call dio_function_output(outp%how(option__linearmediumoutput__points), dir, fname, namespace, space, &
174 safe_deallocate_a(dtmp)
175 safe_deallocate_a(dtmp2)
184 real(real64),
intent(in) :: medium_func(:)
185 integer,
intent(in) :: points_map(:)
186 real(real64),
intent(out) :: io_func(:)
190 do ip_in = 1,
size(points_map)
191 ip = points_map(ip_in)
192 io_func(ip) = medium_func(ip_in)
real(real64), parameter, public m_zero
real(real64), parameter, public p_mu
real(real64), parameter, public p_ep
real(real64), parameter, public p_c
Electron gyromagnetic ratio, see Phys. Rev. Lett. 130, 071801 (2023)
real(real64), parameter, public m_one
This module implements the underlying real-space grid.
subroutine, public io_function_read_what_how_when(namespace, space, what, how, output_interval, what_tag_in, how_tag_in, output_interval_tag_in, ignore_error)
subroutine, public dio_function_output(how, dir, fname, namespace, space, mesh, ff, unit, ierr, pos, atoms, grp, root)
Top-level IO routine for functions defined on the mesh.
subroutine, public io_mkdir(fname, namespace, parents)
This module defines the meshes, which are used in Octopus.
subroutine, public messages_info(no_lines, iunit, verbose_limit, stress, all_nodes, namespace)
character(len=256), dimension(max_lines), public message
to be output by fatal, warning
subroutine, public output_linear_medium(outp, namespace, space, mesh, dir, points_map, ep, mu, cc)
subroutine, public output_linear_medium_init(outp, namespace, space)
this module contains the output system
subroutine, public add_last_slash(str)
Adds a '/' in the end of the string, only if it missing. Useful for directories.
brief This module defines the class unit_t which is used by the unit_systems_oct_m module.
This module defines the unit system, used for input and output.
type(unit_t), public unit_one
some special units required for particular quantities
subroutine get_medium_property(medium_func, points_map, io_func)