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)
216 if (
parse_block(namespace,
'MaxwellFunctions', blk) /= 0)
then
223 row_loop:
do i = 1, nrows
225 if (trim(row_name) == trim(function_name))
then
234 select case (function_type)
317 type(
mxf_t),
intent(inout) ::
f
332 type(
mxf_t),
intent(in) ::
f
344 type(
mxf_t),
intent(inout) ::
f
345 real(real64),
intent(in) :: a0, k_vector(3), r0(3)
351 f%k_vector = k_vector
361 type(
mxf_t),
intent(inout) ::
f
362 real(real64),
intent(in) :: a0, k_vector(3), r0(3)
368 f%k_vector = k_vector
378 type(
mxf_t),
intent(inout) ::
f
379 real(real64),
intent(in) :: a0, k_vector(3), r0(3), width
385 f%k_vector = k_vector
396 type(
mxf_t),
intent(inout) ::
f
397 real(real64),
intent(in) :: a0, k_vector(3), r0(3), width
403 f%k_vector = k_vector
414 type(
mxf_t),
intent(inout) ::
f
415 real(real64),
intent(in) :: a0, k_vector(3), r0(3), growth, width
421 f%k_vector = k_vector
433 type(
mxf_t),
intent(inout) ::
f
434 real(real64),
intent(in) :: a0, k_vector(3), r0(3), growth, width
440 f%k_vector = k_vector
452 type(
mxf_t),
intent(inout) ::
f
453 real(real64),
intent(in) :: k_vector(3)
454 character(len=*),
intent(in) :: expression
459 f%k_vector = k_vector
460 f%expression = trim(expression)
472 type(
mxf_t),
intent(in) ::
f
473 real(real64),
intent(in) :: x(:)
474 real(real64) :: xx, limit_1, limit_2, limit_3, limit_4, r_re, r_im, rr
487 env =
f%a0 * sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim)))
491 r =
exp(-((sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) &
492 / norm2(
f%k_vector(1:xdim)) )**2 / (
m_two*
f%width**2)))
498 if (abs( sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))/norm2(
f%k_vector(1:xdim)))) <=
f%width)
then
499 r = -
cos((
m_pi/
m_two) * ((sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) &
500 / norm2(
f%k_vector(1:xdim)) -
m_two*
f%width) /
f%width))
507 / norm2(
f%k_vector(1:xdim)) -
f%width/
m_two))) &
508 +
m_one/(
m_one +
exp(-
f%growth*(sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) &
514 xx = sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) / norm2(
f%k_vector(1:xdim))
519 if ((xx > limit_1) .and. (xx <= limit_2))
then
520 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)
521 else if ((xx > limit_2) .and. (xx <= limit_3))
then
523 else if ((xx > limit_3) .and. (xx <= limit_4))
then
524 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)
534 env = cmplx(r_re, r_im, real64)
552 complex(real64) function mxf_eval(f, x, phi)
result(y)
553 type(
mxf_t),
intent(in) ::
f
554 real(real64),
intent(in) :: x(:)
555 real(real64),
optional,
intent(in) :: phi
568 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
static double f(double w, void *p)