54 integer,
public,
parameter :: &
69 integer :: mode = mxf_empty
70 real(real64) :: k_vector(3) =
m_zero
71 real(real64) :: r0(3) =
m_zero
72 real(real64) :: width =
m_zero
73 real(real64) :: a0 =
m_zero
74 real(real64) :: dx =
m_zero
75 real(real64) :: init_x =
m_zero
76 real(real64) :: final_x =
m_zero
77 real(real64) :: growth =
m_zero
81 type(spline_t) :: amplitude
82 character(len=200) :: expression
83 type(fft_t) :: fft_handler
94 subroutine mxf_read(f, namespace, function_name, ierr)
95 type(mxf_t),
intent(inout) :: f
96 type(namespace_t),
intent(in) :: namespace
97 character(len=*),
intent(in) :: function_name
98 integer,
intent(out) :: ierr
101 integer :: nrows, ncols, i, function_type, idim
102 character(len=100) :: row_name, function_expression
103 real(real64) :: a0, r0(3), growth, width, k_vector(3)
214 if (
parse_block(namespace,
'MaxwellFunctions', blk) /= 0)
then
221 row_loop:
do i = 1, nrows
223 if (trim(row_name) == trim(function_name))
then
232 select case (function_type)
314 type(
mxf_t),
intent(inout) ::
f
315 real(real64),
intent(in) :: a0, k_vector(3), r0(3)
321 f%k_vector = k_vector
331 type(
mxf_t),
intent(inout) ::
f
332 real(real64),
intent(in) :: a0, k_vector(3), r0(3)
338 f%k_vector = k_vector
348 type(
mxf_t),
intent(inout) ::
f
349 real(real64),
intent(in) :: a0, k_vector(3), r0(3), width
355 f%k_vector = k_vector
366 type(
mxf_t),
intent(inout) ::
f
367 real(real64),
intent(in) :: a0, k_vector(3), r0(3), width
373 f%k_vector = k_vector
384 type(
mxf_t),
intent(inout) ::
f
385 real(real64),
intent(in) :: a0, k_vector(3), r0(3), growth, width
391 f%k_vector = k_vector
403 type(
mxf_t),
intent(inout) ::
f
404 real(real64),
intent(in) :: a0, k_vector(3), r0(3), growth, width
410 f%k_vector = k_vector
422 type(
mxf_t),
intent(inout) ::
f
423 real(real64),
intent(in) :: k_vector(3)
424 character(len=*),
intent(in) :: expression
429 f%k_vector = k_vector
430 f%expression = trim(expression)
443 real(real64),
intent(in) :: x(:)
444 real(real64) :: xx, limit_1, limit_2, limit_3, limit_4, r_re, r_im, rr
457 env =
f%a0 * sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim)))
461 r =
exp(-((sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) &
462 / norm2(
f%k_vector(1:xdim)) )**2 / (
m_two*
f%width**2)))
468 if (abs( sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))/norm2(
f%k_vector(1:xdim)))) <=
f%width)
then
469 r = -
cos((
m_pi/
m_two) * ((sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) &
470 / norm2(
f%k_vector(1:xdim)) -
m_two*
f%width) /
f%width))
476 r =
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))) &
484 xx = sum(
f%k_vector(1:xdim)*(x(:) -
f%r0(1:xdim))) / norm2(
f%k_vector(1:xdim))
489 if ((xx > limit_1) .and. (xx <= limit_2))
then
490 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)
491 else if ((xx > limit_2) .and. (xx <= limit_3))
then
493 else if ((xx > limit_3) .and. (xx <= limit_4))
then
494 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)
504 env = cmplx(r_re, r_im, real64)
522 complex(real64) function mxf_eval(f, x, phi)
result(y)
523 type(
mxf_t),
intent(in) :: f
524 real(real64),
intent(in) :: x(:)
525 real(real64),
optional,
intent(in) :: phi
538 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)
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)
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)
subroutine, public parse_block_string(blk, l, c, res, convert_to_c)
integer function, public parse_block(namespace, name, blk, check_varinfo_)
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)