56 integer,
public,
parameter :: &
71 integer :: mode = mxf_empty
72 real(real64) :: k_vector(3) =
m_zero
73 real(real64) :: r0(3) =
m_zero
74 real(real64) :: width =
m_zero
75 real(real64) :: a0 =
m_zero
76 real(real64) :: dx =
m_zero
77 real(real64) :: init_x =
m_zero
78 real(real64) :: final_x =
m_zero
79 real(real64) :: growth =
m_zero
83 type(spline_t) :: amplitude
84 character(len=200) :: expression
85 type(fft_t) :: fft_handler
96 subroutine mxf_read(f, namespace, function_name, ierr)
97 type(mxf_t),
intent(inout) :: f
98 type(namespace_t),
intent(in) :: namespace
99 character(len=*),
intent(in) :: function_name
100 integer,
intent(out) :: ierr
103 integer :: nrows, ncols, i, function_type, idim
104 character(len=100) :: row_name, function_expression
105 real(real64) :: a0, r0(3), growth, width, k_vector(3)
184 if (
parse_block(namespace,
'MaxwellFunctions', blk) /= 0)
then
191 row_loop:
do i = 1, nrows
193 if (trim(row_name) == trim(function_name))
then
202 select case (function_type)
285 type(
mxf_t),
intent(inout) :: f
300 type(
mxf_t),
intent(in) :: f
312 type(
mxf_t),
intent(inout) :: f
313 real(real64),
intent(in) :: a0, k_vector(3), r0(3)
319 f%k_vector = k_vector
329 type(
mxf_t),
intent(inout) :: f
330 real(real64),
intent(in) :: a0, k_vector(3), r0(3)
336 f%k_vector = k_vector
346 type(
mxf_t),
intent(inout) :: f
347 real(real64),
intent(in) :: a0, k_vector(3), r0(3), width
353 f%k_vector = k_vector
364 type(
mxf_t),
intent(inout) :: f
365 real(real64),
intent(in) :: a0, k_vector(3), r0(3), width
371 f%k_vector = k_vector
382 type(
mxf_t),
intent(inout) :: f
383 real(real64),
intent(in) :: a0, k_vector(3), r0(3), growth, width
389 f%k_vector = k_vector
401 type(
mxf_t),
intent(inout) :: f
402 real(real64),
intent(in) :: a0, k_vector(3), r0(3), growth, width
408 f%k_vector = k_vector
420 type(
mxf_t),
intent(inout) :: f
421 real(real64),
intent(in) :: k_vector(3)
422 character(len=*),
intent(in) :: expression
427 f%k_vector = k_vector
428 f%expression = trim(expression)
440 type(
mxf_t),
intent(in) :: f
441 real(real64),
intent(in) :: x(:)
442 real(real64) :: xx, limit_1, limit_2, limit_3, limit_4, r_re, r_im, rr
455 env = f%a0 * sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim)))
459 r =
exp(-((sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))) &
460 / norm2(f%k_vector(1:xdim)) )**2 / (
m_two*f%width**2)))
466 if (abs( sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))/norm2(f%k_vector(1:xdim)))) <= f%width)
then
467 r = -
cos((
m_pi/
m_two) * ((sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))) &
468 / norm2(f%k_vector(1:xdim)) -
m_two*f%width) / f%width))
474 r =
m_one/(
m_one +
exp(f%growth*(sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))) &
475 / norm2(f%k_vector(1:xdim)) - f%width/
m_two))) &
476 +
m_one/(
m_one +
exp(-f%growth*(sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))) &
477 / norm2(f%k_vector(1:xdim)) + f%width/
m_two))) -
m_one
482 xx = sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))) / norm2(f%k_vector(1:xdim))
484 limit_2 = - f%width/
m_two
485 limit_3 = f%width/
m_two
487 if ((xx > limit_1) .and. (xx <= limit_2))
then
488 r =
m_one + f%growth * (sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim)))/norm2(f%k_vector(1:xdim)) + f%width/
m_two)
489 else if ((xx > limit_2) .and. (xx <= limit_3))
then
491 else if ((xx > limit_3) .and. (xx <= limit_4))
then
492 r =
m_one - f%growth * (sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim)))/norm2(f%k_vector(1:xdim)) - f%width/
m_two)
502 env = r_re +
m_zi*r_im
520 complex(real64) function mxf_eval(f, x, phi)
result(y)
521 type(
mxf_t),
intent(in) :: f
522 real(real64),
intent(in) :: x(:)
523 real(real64),
optional,
intent(in) :: phi
536 y = y *
exp(
m_zi * (sum(f%k_vector(1:xdim)*(x(:) - f%r0(1:xdim))) + phi_))
double exp(double __x) __attribute__((__nothrow__
double cos(double __x) __attribute__((__nothrow__
Fast Fourier Transform module. This module provides a single interface that works with different FFT ...
real(real64), parameter, public m_two
real(real64), parameter, public m_zero
real(real64), parameter, public m_pi
some mathematical constants
complex(real64), parameter, public m_zi
real(real64), parameter, public m_one
This module is intended to contain "only mathematical" functions and procedures.
integer, parameter, public mxf_fourier_series
integer, parameter, public mxf_logistic_wave
complex(real64) function mxf_envelope_eval(f, x)
Evaluation of envelope itself.
complex(real64) function mxf_eval(f, x, phi)
Evaluation of spatial envelope Functions.
integer, parameter, public mxf_trapezoidal_wave
subroutine, public mxf_read(f, namespace, function_name, ierr)
This function initializes "f" from the MXFunctions block.
integer, parameter, public mxf_from_file
integer, parameter, public mxf_cosinoidal_wave
integer, parameter, public mxf_zero_fourier
subroutine, public mxf_init_const_wave(f, a0, k_vector, r0)
subroutine, public mxf_init(f)
integer, parameter, public mxf_numerical
subroutine mxf_init_trapezoidal_wave(f, a0, k_vector, r0, growth, width)
subroutine, public mxf_init_const_phase(f, a0, k_vector, r0)
integer, parameter, public mxf_gaussian_wave
integer, parameter, public mxf_const_wave
subroutine, public mxf_init_gaussian_wave(f, a0, k_vector, r0, width)
logical function, public mxf_is_empty(f)
subroutine, public mxf_init_fromexpr(f, k_vector, expression)
integer, parameter, public mxf_const_phase
subroutine, public mxf_init_cosinoidal_wave(f, a0, k_vector, r0, width)
integer, parameter, public mxf_from_expr
subroutine mxf_init_logistic_wave(f, a0, k_vector, r0, growth, width)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
subroutine, public conv_to_c_string(str)
converts to c string
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_system_t), public units_inp
the units systems for reading and writing
type(unit_t), public unit_one
some special units required for particular quantities