Report Typos and Errors    
Semi-Lagrangian Library
Modular library for kinetic and gyrokinetic simulations of plasmas in fusion energy devices.
Derived types and interfaces | Functions/Subroutines
sll_m_maxwell_1d_fem Module Reference

Description

Solve Maxwell's equations in 1D.

This version corresponds to conforming spline finite elements

Authors
Katharina Kormann Eric Sonnendrücker

Derived types and interfaces

type  sll_t_maxwell_1d_fem
 Maxwell solver class. More...
 

Functions/Subroutines

subroutine sll_s_compute_e_from_b_1d_fem (self, delta_t, field_in, field_out)
 compute Ey from Bz using weak Ampere formulation More...
 
subroutine sll_s_compute_b_from_e_1d_fem (self, delta_t, field_in, field_out)
 
subroutine sll_s_compute_curl_part_1d_fem (self, delta_t, efield, bfield, betar)
 
subroutine weak_curl (self, delta_t, field_in, field_out)
 compute Ey from Bz using weak Ampere formulation More...
 
subroutine strong_curl (self, delta_t, field_in, field_out)
 Compute Bz from Ey using strong 1D Faraday equation for spline coefficients $B_z^{new}(x_j) = B_z^{old}(x_j) - \frac{\Delta t}{\Delta x} (E_y(x_j) - E_y(x_{j-1}) $. More...
 
subroutine sll_s_compute_e_from_rho_1d_fem (self, field_in, field_out)
 
subroutine compute_rho_from_e_1d_fem (self, field_in, field_out)
 Compute rho from Gauss law for given efield. More...
 
subroutine choose_interpolation (self, current, component, E)
 Choose between compute_E_from_j_1d_fem and compute_E_from_j_1d_fem_shape. More...
 
subroutine compute_e_from_j_1d_fem (self, current, component, E)
 Compute E_i from j_i integrated over the time interval using weak Ampere formulation
More...
 
subroutine compute_e_from_j_1d_fem_shape (self, current, component, E)
 
subroutine multiply_interpolation_inverse_transpose (self, in, out)
 
subroutine solve_e_b_1d_fem (self, delta_t, bfield, efield)
 Solves for the efield part in a implicit curl part solve. More...
 
subroutine solve_circulant (self, eigvals, rhs, res)
 
subroutine compute_phi_from_rho_1d_fem (self, in, phi, efield)
 For model with adiabatic electrons. More...
 
subroutine compute_phi_from_j_1d_fem (self, in, phi, efield)
 For model with adiabatic electrons. More...
 
subroutine sll_s_compute_fem_rhs (self, func, degree, coefs_dofs)
 Compute the FEM right-hand-side for a given function f and periodic splines of given degree Its components are $\int f N_i dx$ where $N_i$ is the B-spline starting at $x_i$. More...
 
real(kind=f64) function l2norm_squared_1d_fem (self, coefs_dofs, degree)
 Compute square of the L2norm. More...
 
real(kind=f64) function inner_product_1d_fem (self, coefs1_dofs, coefs2_dofs, degree, degree2)
 
subroutine l2projection_1d_fem (self, func, degree, coefs_dofs)
 Compute the L2 projection of a given function f on periodic splines of given degree. More...
 
subroutine init_1d_fem (self, domain, n_dofs, s_deg_0, delta_t, strong_ampere, solver_tolerance, force_sign, adiabatic_electrons)
 
subroutine free_1d_fem (self)
 
subroutine multiply_g (self, in, out)
 
subroutine multiply_gt (self, in, out)
 
subroutine multiply_mass_1d_fem (self, in, out, degree)
 
subroutine invert_mass_1d_fem (self, in, out, degree)
 Invert the mass matrix. More...
 
subroutine transform_dofs_1d_fem (self, in, out, degree)
 Invert the mass matrix. More...
 

Function/Subroutine Documentation

◆ choose_interpolation()

subroutine sll_m_maxwell_1d_fem::choose_interpolation ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  current,
integer(kind=i32), intent(in)  component,
real(kind=f64), dimension(:), intent(inout)  E 
)
private

Choose between compute_E_from_j_1d_fem and compute_E_from_j_1d_fem_shape.

Parameters
selfMaxwell solver class
[in]currentComponent component of the current integrated over time interval
[in]componentComponent of the Efield to be computed
[in,out]eUpdated electric field

Definition at line 326 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ compute_e_from_j_1d_fem()

subroutine sll_m_maxwell_1d_fem::compute_e_from_j_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  current,
integer(kind=i32), intent(in)  component,
real(kind=f64), dimension(:), intent(inout)  E 
)
private

Compute E_i from j_i integrated over the time interval using weak Ampere formulation

Parameters
selfMaxwell solver class
[in]currentComponent component of the current integrated over time interval
[in]componentComponent of the Efield to be computed
[in,out]eUpdated electric field

Definition at line 342 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_e_from_j_1d_fem_shape()

subroutine sll_m_maxwell_1d_fem::compute_e_from_j_1d_fem_shape ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  current,
integer(kind=i32), intent(in)  component,
real(kind=f64), dimension(:), intent(inout)  E 
)
private
Parameters
selfMaxwell solver class
[in]currentComponent component of the current integrated over time interval
[in]componentComponent of the Efield to be computed
[in,out]eUpdated electric field

Definition at line 363 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_phi_from_j_1d_fem()

subroutine sll_m_maxwell_1d_fem::compute_phi_from_j_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  phi,
real(kind=f64), dimension(:), intent(out)  efield 
)
private

For model with adiabatic electrons.

Parameters
selfMaxwell solver class
[in]inCurrent integrated over time interval
[out]efieldE

Definition at line 455 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ compute_phi_from_rho_1d_fem()

subroutine sll_m_maxwell_1d_fem::compute_phi_from_rho_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  phi,
real(kind=f64), dimension(:), intent(out)  efield 
)
private

For model with adiabatic electrons.

Parameters
selfMaxwell solver class
[in]inrho
[out]efieldE

Definition at line 438 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ compute_rho_from_e_1d_fem()

subroutine sll_m_maxwell_1d_fem::compute_rho_from_e_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

Compute rho from Gauss law for given efield.

Parameters
selfMaxwell solver class
[out]field_outrho

Definition at line 294 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ free_1d_fem()

subroutine sll_m_maxwell_1d_fem::free_1d_fem ( class(sll_t_maxwell_1d_fem self)
private
Parameters
selfMaxwell solver class

Definition at line 863 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ init_1d_fem()

subroutine sll_m_maxwell_1d_fem::init_1d_fem ( class(sll_t_maxwell_1d_fem), intent(out)  self,
real(kind=f64), dimension(2), intent(in)  domain,
integer(kind=i32), intent(in)  n_dofs,
integer(kind=i32), intent(in)  s_deg_0,
real(kind=f64), intent(in)  delta_t,
logical, intent(in), optional  strong_ampere,
real(kind=f64), intent(in), optional  solver_tolerance,
real(kind=f64), intent(in), optional  force_sign,
logical, intent(in), optional  adiabatic_electrons 
)
private
Parameters
[out]selfMaxwell solver class
[in]domainxmin, xmax
[in]n_dofsnumber of degrees of freedom (here number of cells and grid points)
[in]s_deg_0highest spline degree
[in]delta_tTime step
[in]strong_ampereflag to switch between strong and weak Ampere formulation
[in]solver_tolerancetolerance for Schur complement solver
[in]force_signsign of particle force
[in]adiabatic_electronsflag if adiabatic electrons are used

Definition at line 615 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ inner_product_1d_fem()

real(kind=f64) function sll_m_maxwell_1d_fem::inner_product_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:)  coefs1_dofs,
real(kind=f64), dimension(:)  coefs2_dofs,
integer(kind=i32)  degree,
integer(kind=i32), optional  degree2 
)
private
Parameters
selfMaxwell solver class
coefs1_dofsCoefficient for each DoF
coefs2_dofsCoefficient for each DoF
degreeSpecify the degree of the basis functions
degree2Specify the degree of the basis functions
Returns
Result: squared L2 norm

Definition at line 541 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ invert_mass_1d_fem()

subroutine sll_m_maxwell_1d_fem::invert_mass_1d_fem ( class(sll_t_maxwell_1d_fem), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out,
integer(kind=i32), intent(in)  degree 
)
private

Invert the mass matrix.

Parameters
[in,out]selfMaxwell solver class
[in]degreeSpecify the degree of the basis functions
[in]inspline coefficients of projection
[out]outspline coefficients of projection

Definition at line 928 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ l2norm_squared_1d_fem()

real(kind=f64) function sll_m_maxwell_1d_fem::l2norm_squared_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:)  coefs_dofs,
integer(kind=i32)  degree 
)
private

Compute square of the L2norm.

Parameters
selfMaxwell solver class
coefs_dofsCoefficient for each DoF
degreeSpecify the degree of the basis functions
Returns
Result: squared L2 norm

Definition at line 516 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ l2projection_1d_fem()

subroutine sll_m_maxwell_1d_fem::l2projection_1d_fem ( class(sll_t_maxwell_1d_fem self,
procedure(sll_i_function_1d_real64 func,
integer(kind=i32), intent(in)  degree,
real(kind=f64), dimension(:), intent(out)  coefs_dofs 
)
private

Compute the L2 projection of a given function f on periodic splines of given degree.

Parameters
selfMaxwell solver class
funcfunction
[in]degreeSpecify the degree of the basis functions

Definition at line 590 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ multiply_g()

subroutine sll_m_maxwell_1d_fem::multiply_g ( class(sll_t_maxwell_1d_fem), intent(in)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out 
)
private
Parameters
[in]selfMaxwell_Clamped solver class
[in]infield_in
[out]outG*field_in

Definition at line 881 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiply_gt()

subroutine sll_m_maxwell_1d_fem::multiply_gt ( class(sll_t_maxwell_1d_fem), intent(in)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out 
)
private
Parameters
[in]selfMaxwell_Clamped solver class
[in]infield_in
[out]outG^T*field_in

Definition at line 891 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ multiply_interpolation_inverse_transpose()

subroutine sll_m_maxwell_1d_fem::multiply_interpolation_inverse_transpose ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(inout)  out 
)
private
Parameters
selfMaxwell solver class
[in]ininput
[in,out]outoutput

Definition at line 378 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ multiply_mass_1d_fem()

subroutine sll_m_maxwell_1d_fem::multiply_mass_1d_fem ( class(sll_t_maxwell_1d_fem), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out,
integer(kind=i32), intent(in)  degree 
)
private
Parameters
[in,out]selfMaxwell solver class
[in]inCoefficient for each DoF
[out]outCoefficient for each DoF
[in]degreeSpecify the degree of the basis functions

Definition at line 901 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_b_from_e_1d_fem()

subroutine sll_m_maxwell_1d_fem::sll_s_compute_b_from_e_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), intent(in)  delta_t,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(inout)  field_out 
)
private
Parameters
selfMaxwell solver class
[in]delta_tTime step
[in]field_inEy
[in,out]field_outBz

Definition at line 169 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_curl_part_1d_fem()

subroutine sll_m_maxwell_1d_fem::sll_s_compute_curl_part_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), intent(in)  delta_t,
real(kind=f64), dimension(:), intent(inout)  efield,
real(kind=f64), dimension(:), intent(inout)  bfield,
real(kind=f64), optional  betar 
)
private
Parameters
selfMaxwell solver class
[in]delta_tTime step
[in,out]efieldEy
[in,out]bfieldBz
betar1/beta

Definition at line 184 of file sll_m_maxwell_1d_fem.F90.

◆ sll_s_compute_e_from_b_1d_fem()

subroutine sll_m_maxwell_1d_fem::sll_s_compute_e_from_b_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), intent(in)  delta_t,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(inout)  field_out 
)
private

compute Ey from Bz using weak Ampere formulation

Parameters
selfMaxwell solver class
[in]delta_tTime step
[in]field_inBz
[in,out]field_outEy

Definition at line 153 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_e_from_rho_1d_fem()

subroutine sll_m_maxwell_1d_fem::sll_s_compute_e_from_rho_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private
Parameters
selfMaxwell solver class
[in]field_inrho
[out]field_outE

Definition at line 265 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_fem_rhs()

subroutine sll_m_maxwell_1d_fem::sll_s_compute_fem_rhs ( class(sll_t_maxwell_1d_fem self,
procedure(sll_i_function_1d_real64 func,
integer(kind=i32), intent(in)  degree,
real(kind=f64), dimension(:), intent(out)  coefs_dofs 
)
private

Compute the FEM right-hand-side for a given function f and periodic splines of given degree Its components are $\int f N_i dx$ where $N_i$ is the B-spline starting at $x_i$.

Parameters
selfMaxwell solver class
funcfunction
[in]degreeSpecify the degree of the basis functions

Definition at line 477 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve_circulant()

subroutine sll_m_maxwell_1d_fem::solve_circulant ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), dimension(:), intent(in)  eigvals,
real(kind=f64), dimension(:), intent(in)  rhs,
real(kind=f64), dimension(:), intent(out)  res 
)
private
Parameters
selfMaxwell solver class
[in]eigvalseigenvalues of circulant matrix
[out]resresult

Definition at line 405 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ solve_e_b_1d_fem()

subroutine sll_m_maxwell_1d_fem::solve_e_b_1d_fem ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), intent(in)  delta_t,
real(kind=f64), dimension(:), intent(in)  bfield,
real(kind=f64), dimension(:), intent(inout)  efield 
)
private

Solves for the efield part in a implicit curl part solve.

Parameters
selfMaxwell solver class
[in]delta_tTime step
[in]bfieldComponent component of the current integrated over time interval
[in,out]efieldUpdated electric field

Definition at line 390 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ strong_curl()

subroutine sll_m_maxwell_1d_fem::strong_curl ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), intent(in)  delta_t,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(inout)  field_out 
)
private

Compute Bz from Ey using strong 1D Faraday equation for spline coefficients $B_z^{new}(x_j) = B_z^{old}(x_j) - \frac{\Delta t}{\Delta x} (E_y(x_j) - E_y(x_{j-1}) $.

Parameters
selfMaxwell solver class
[in]delta_tTime step
[in]field_inEy
[in,out]field_outBz

Definition at line 246 of file sll_m_maxwell_1d_fem.F90.

Here is the caller graph for this function:

◆ transform_dofs_1d_fem()

subroutine sll_m_maxwell_1d_fem::transform_dofs_1d_fem ( class(sll_t_maxwell_1d_fem), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out,
integer(kind=i32), intent(in)  degree 
)
private

Invert the mass matrix.

Parameters
[in,out]selfMaxwell solver class
[in]degreeSpecify the degree of the basis functions ! this is 0 for 0 form and 1 for 1 form
[in]inspline coefficients of projection
[out]outspline coefficients of projection

Definition at line 950 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:

◆ weak_curl()

subroutine sll_m_maxwell_1d_fem::weak_curl ( class(sll_t_maxwell_1d_fem self,
real(kind=f64), intent(in)  delta_t,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(inout)  field_out 
)
private

compute Ey from Bz using weak Ampere formulation

Parameters
selfMaxwell solver class
[in]delta_tTime step
[in]field_ininput field
[in,out]field_outoutput_field

Definition at line 226 of file sll_m_maxwell_1d_fem.F90.

Here is the call graph for this function:
Here is the caller graph for this function:
    Report Typos and Errors