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_3d_fem Module Reference

Description

Module interface to solve Maxwell's equations in 3D The linear systems are solved using iterative linear solvers.

Author
Katharina Kormann

Derived types and interfaces

type  sll_t_maxwell_3d_fem
 

Functions/Subroutines

subroutine sll_s_compute_e_from_b_3d_fem (self, delta_t, field_in, field_out)
 compute Ey from Bz using weak Ampere formulation More...
 
subroutine sll_s_compute_b_from_e_3d_fem (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_curl_part_3d_fem (self, delta_t, efield, bfield, betar)
 Solve curl part of Maxwell's equations. More...
 
subroutine sll_s_compute_e_from_rho_3d_fem (self, field_in, field_out)
 Compute E_i from rho_i integrated over the time interval using weak Poisson's equation. More...
 
subroutine sll_s_compute_rho_from_e_3d_fem (self, field_in, field_out)
 compute rho from e using weak Gauss law ( rho = G^T M_1 e ) More...
 
subroutine sll_s_compute_e_from_j_3d_fem (self, current, E, component)
 Compute E_i from j_i integrated over the time interval using weak Ampere formulation. More...
 
subroutine sll_s_compute_phi_from_rho_3d_fem (self, field_in, field_out, efield_dofs)
 Compute phi from rho_i integrated over the time interval. More...
 
subroutine sll_s_compute_phi_from_j_3d_fem (self, field_in, field_out, efield_dofs)
 Compute phi from j_i integrated over the time interval, delta_t is already included. More...
 
subroutine sll_s_compute_rhs_fem (self, form, component, coefs_dofs, func1, func2, func3)
 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...
 
subroutine l2projection_3d_fem (self, form, component, coefs_dofs, func1, func2, func3)
 Compute the L2 projection of a given function f on periodic splines of given degree. More...
 
subroutine compute_dofs (self, form, component, coefs_dofs, func1, func2, func3)
 
subroutine sll_compute_edge_integral (self, func1, func2, func3, coefs_dofs)
 
real(kind=f64) function l2norm_squared_3d_fem (self, coefs, form, component)
 Compute square of the L2norm. More...
 
real(kind=f64) function inner_product_3d_fem (self, coefs1, coefs2, form, component)
 Compute inner product. More...
 
subroutine init_3d_fem (self, domain, n_dofs, s_deg_0, mass_tolerance, poisson_tolerance, solver_tolerance, adiabatic_electrons, profile)
 Initialization. More...
 
subroutine init_from_file_3d_fem (self, domain, n_dofs, s_deg_0, nml_file, adiabatic_electrons, profile)
 Initialization from nml file. More...
 
subroutine free_3d_fem (self)
 Finalization. More...
 
subroutine multiply_g (self, field_in, field_out)
 Multiply by dicrete gradient matrix. More...
 
subroutine multiply_gt (self, field_in, field_out)
 Multiply by transpose of dicrete gradient matrix. More...
 
subroutine multiply_c (self, field_in, field_out)
 Multiply by discrete curl matrix. More...
 
subroutine multiply_ct (self, field_in, field_out)
 Multiply by transpose of discrete curl matrix. More...
 
subroutine multiply_mass_3d_fem (self, deg, coefs_in, coefs_out)
 Multiply by the mass matrix. More...
 
subroutine multiply_mass_3dkron (self, deg, coefs_in, coefs_out)
 Multiply by the mass matrix. More...
 
subroutine multiply_mass_inverse_3dkron (self, form, coefs_in, coefs_out)
 Multiply by the inverse mass matrix. More...
 
subroutine compute_field_energy (self, efield_dofs, bfield_dofs, energy)
 Compute field energy. More...
 

Function/Subroutine Documentation

◆ compute_dofs()

subroutine sll_m_maxwell_3d_fem::compute_dofs ( class(sll_t_maxwell_3d_fem self,
integer(kind=i32), intent(in)  form,
integer(kind=i32), intent(in)  component,
real(kind=f64), dimension(:), intent(out)  coefs_dofs,
procedure(sll_i_function_3d_real64 func1,
procedure(sll_i_function_3d_real64), optional  func2,
procedure(sll_i_function_3d_real64), optional  func3 
)
private
Parameters
selfMaxwell solver class
[in]formSpecify if the function is a0,1,2 or 3-form
[in]componentSpecify the component of the function
[out]coefs_dofsFinite Element right-hand-side
func1Function first component
func2Function second component
func3Function third component

Definition at line 449 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ compute_field_energy()

subroutine sll_m_maxwell_3d_fem::compute_field_energy ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  efield_dofs,
real(kind=f64), dimension(:), intent(in)  bfield_dofs,
real(kind=f64), intent(out)  energy 
)
private

Compute field energy.

Parameters
selfMaxwell solver class
[in]efield_dofsE
[in]bfield_dofsB
[out]energyfield energy

Definition at line 1031 of file sll_m_maxwell_3d_fem.F90.

◆ free_3d_fem()

subroutine sll_m_maxwell_3d_fem::free_3d_fem ( class(sll_t_maxwell_3d_fem self)
private

Finalization.

Parameters
selfMaxwell solver class

Definition at line 837 of file sll_m_maxwell_3d_fem.F90.

◆ init_3d_fem()

subroutine sll_m_maxwell_3d_fem::init_3d_fem ( class(sll_t_maxwell_3d_fem), intent(inout)  self,
real(kind=f64), dimension(3,2), intent(in)  domain,
integer(kind=i32), dimension(3), intent(in)  n_dofs,
integer(kind=i32), dimension(3), intent(in)  s_deg_0,
real(kind=f64), intent(in), optional  mass_tolerance,
real(kind=f64), intent(in), optional  poisson_tolerance,
real(kind=f64), intent(in), optional  solver_tolerance,
logical, intent(in), optional  adiabatic_electrons,
type(sll_t_profile_functions), intent(in), optional  profile 
)
private

Initialization.

Parameters
[in,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]mass_tolerancetolerance for mass solver
[in]poisson_tolerancetolerance for Poisson solver
[in]solver_tolerancetolerance for Schur complement solver
[in]adiabatic_electronsflag if adiabatic electrons are used
[in]profiletemperature and density profiles

Definition at line 561 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ init_from_file_3d_fem()

subroutine sll_m_maxwell_3d_fem::init_from_file_3d_fem ( class(sll_t_maxwell_3d_fem), intent(inout)  self,
real(kind=f64), dimension(3,2), intent(in)  domain,
integer(kind=i32), dimension(3), intent(in)  n_dofs,
integer(kind=i32), dimension(3), intent(in)  s_deg_0,
character(len=*), intent(in)  nml_file,
logical, intent(in), optional  adiabatic_electrons,
type(sll_t_profile_functions), intent(in), optional  profile 
)
private

Initialization from nml file.

Parameters
[in,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]nml_filenml-file
[in]adiabatic_electronsflag if adiabatic electrons are used
[in]profiletemperature and density profiles

Definition at line 766 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ inner_product_3d_fem()

real(kind=f64) function sll_m_maxwell_3d_fem::inner_product_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:)  coefs1,
real(kind=f64), dimension(:)  coefs2,
integer(kind=i32)  form,
integer(kind=i32), optional  component 
)
private

Compute inner product.

Parameters
selfMaxwell solver class
coefs1Coefficient for each DoF
coefs2Coefficient for each DoF
formSpecify 0,1,2 or 3-form
componentSpecify the component of the form
Returns
Result: squared L2 norm

Definition at line 526 of file sll_m_maxwell_3d_fem.F90.

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

◆ l2norm_squared_3d_fem()

real(kind=f64) function sll_m_maxwell_3d_fem::l2norm_squared_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:)  coefs,
integer(kind=i32)  form,
integer(kind=i32)  component 
)
private

Compute square of the L2norm.

Parameters
selfMaxwell solver class
coefsCoefficient for each DoF
formSpecify 0,1,2 or 3 form
componentSpecify the component
Returns
Result: squared L2 norm

Definition at line 511 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ l2projection_3d_fem()

subroutine sll_m_maxwell_3d_fem::l2projection_3d_fem ( class(sll_t_maxwell_3d_fem self,
integer(kind=i32), intent(in)  form,
integer(kind=i32), intent(in)  component,
real(kind=f64), dimension(:), intent(out)  coefs_dofs,
procedure(sll_i_function_3d_real64 func1,
procedure(sll_i_function_3d_real64), optional  func2,
procedure(sll_i_function_3d_real64), optional  func3 
)
private

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

Parameters
selfMaxwell solver class
[in]formSpecify if the function is a0,1,2 or 3-form
[in]componentSpecify the component of the function
[out]coefs_dofsFinite Element right-hand-side
func1Function first component
func2Function second component
func3Function third component

Definition at line 424 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ multiply_c()

subroutine sll_m_maxwell_3d_fem::multiply_c ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

Multiply by discrete curl matrix.

Parameters
selfMaxwell solver class
[out]field_outC*field_in

Definition at line 902 of file sll_m_maxwell_3d_fem.F90.

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

◆ multiply_ct()

subroutine sll_m_maxwell_3d_fem::multiply_ct ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

Multiply by transpose of discrete curl matrix.

Parameters
selfMaxwell solver class
[out]field_outC^T*field_in

Definition at line 913 of file sll_m_maxwell_3d_fem.F90.

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

◆ multiply_g()

subroutine sll_m_maxwell_3d_fem::multiply_g ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

Multiply by dicrete gradient matrix.

Parameters
selfMaxwell solver class

Definition at line 880 of file sll_m_maxwell_3d_fem.F90.

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

◆ multiply_gt()

subroutine sll_m_maxwell_3d_fem::multiply_gt ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

Multiply by transpose of dicrete gradient matrix.

Parameters
selfMaxwell solver class
[out]field_outG^T*field_in

Definition at line 891 of file sll_m_maxwell_3d_fem.F90.

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

◆ multiply_mass_3d_fem()

subroutine sll_m_maxwell_3d_fem::multiply_mass_3d_fem ( class(sll_t_maxwell_3d_fem self,
integer(kind=i32), dimension(:), intent(in)  deg,
real(kind=f64), dimension(:), intent(in)  coefs_in,
real(kind=f64), dimension(:), intent(out)  coefs_out 
)
private

Multiply by the mass matrix.

Parameters
selfMaxwell solver class
[in]degdeg/form specifies if we multiply the mass to a 1- or 2-form or a mix of both
[in]coefs_inCoefficient for each DoF
[out]coefs_outCoefficient for each DoF

Definition at line 924 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ multiply_mass_3dkron()

subroutine sll_m_maxwell_3d_fem::multiply_mass_3dkron ( class(sll_t_maxwell_3d_fem self,
integer(kind=i32), dimension(:), intent(in)  deg,
real(kind=f64), dimension(:), intent(in)  coefs_in,
real(kind=f64), dimension(:), intent(out)  coefs_out 
)
private

Multiply by the mass matrix.

Parameters
selfMaxwell solver class
[in]degdeg(i) specifies the degree of the 1d mass matrix in dimension i (Note: 1 for 0-form, 2 for 1-form, 3 for 0-1-form mix)

Definition at line 951 of file sll_m_maxwell_3d_fem.F90.

Here is the caller graph for this function:

◆ multiply_mass_inverse_3dkron()

subroutine sll_m_maxwell_3d_fem::multiply_mass_inverse_3dkron ( class(sll_t_maxwell_3d_fem self,
integer(kind=i32), intent(in)  form,
real(kind=f64), dimension(:), intent(in)  coefs_in,
real(kind=f64), dimension(:), intent(out)  coefs_out 
)
private

Multiply by the inverse mass matrix.

Parameters
selfMaxwell solver class
[in]formform specifies the form (Note: 0 for 0-form, 1 for 1-form, 2 for 2-form, 3 for 0-1-form mix)
[in]coefs_inCoefficient for each DoF
[out]coefs_outCoefficient for each DoF

Definition at line 1000 of file sll_m_maxwell_3d_fem.F90.

◆ sll_compute_edge_integral()

subroutine sll_m_maxwell_3d_fem::sll_compute_edge_integral ( class(sll_t_maxwell_3d_fem self,
procedure(sll_i_function_3d_real64 func1,
procedure(sll_i_function_3d_real64 func2,
procedure(sll_i_function_3d_real64 func3,
real(kind=f64), dimension(:), intent(out)  coefs_dofs 
)
private
Parameters
selfMaxwell solver class
func1Function first component
func2Function second component
func3Function third component
[out]coefs_dofsFinite Element right-hand-side

Definition at line 471 of file sll_m_maxwell_3d_fem.F90.

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

◆ sll_s_compute_b_from_e_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_b_from_e_3d_fem ( class(sll_t_maxwell_3d_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

Definition at line 188 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_curl_part_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_curl_part_3d_fem ( class(sll_t_maxwell_3d_fem self,
intent(in)  delta_t,
dimension(:), intent(inout)  efield,
dimension(:), intent(inout)  bfield,
optional  betar 
)
private

Solve curl part of Maxwell's equations.

Parameters
selfMaxwell solver class

Definition at line 202 of file sll_m_maxwell_3d_fem.F90.

◆ sll_s_compute_e_from_b_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_e_from_b_3d_fem ( class(sll_t_maxwell_3d_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_inB
[in,out]field_outE

Definition at line 170 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_e_from_j_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_e_from_j_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  current,
real(kind=f64), dimension(:), intent(inout)  E,
integer(kind=i32), intent(in), optional  component 
)
private

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

Parameters
selfMaxwell solver class
[in]currentCurrent integrated over time interval
[in,out]eUpdated electric field
[in]componentcomponent of the Efield to be computed

Definition at line 269 of file sll_m_maxwell_3d_fem.F90.

◆ sll_s_compute_e_from_rho_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_e_from_rho_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

Compute E_i from rho_i integrated over the time interval using weak Poisson's equation.

Parameters
selfMaxwell solver class
[in]field_inrho
[out]field_outE

Definition at line 241 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_phi_from_j_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_phi_from_j_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(inout)  field_out,
real(kind=f64), dimension(:), intent(out)  efield_dofs 
)
private

Compute phi from j_i integrated over the time interval, delta_t is already included.

Parameters
selfMaxwell solver class
[in]field_inCurrent integrated over time interval
[in,out]field_outphi
[out]efield_dofsE

Definition at line 301 of file sll_m_maxwell_3d_fem.F90.

◆ sll_s_compute_phi_from_rho_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_phi_from_rho_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(inout)  field_out,
real(kind=f64), dimension(:), intent(out)  efield_dofs 
)
private

Compute phi from rho_i integrated over the time interval.

Parameters
selfMaxwell solver class
[in]field_inrho
[in,out]field_outphi
[out]efield_dofsE

Definition at line 287 of file sll_m_maxwell_3d_fem.F90.

◆ sll_s_compute_rho_from_e_3d_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_rho_from_e_3d_fem ( class(sll_t_maxwell_3d_fem self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

compute rho from e using weak Gauss law ( rho = G^T M_1 e )

Parameters
selfMaxwell solver class
[in]field_inE
[out]field_outrho

Definition at line 255 of file sll_m_maxwell_3d_fem.F90.

Here is the call graph for this function:

◆ sll_s_compute_rhs_fem()

subroutine sll_m_maxwell_3d_fem::sll_s_compute_rhs_fem ( class(sll_t_maxwell_3d_fem self,
integer(kind=i32), intent(in)  form,
integer(kind=i32), intent(in)  component,
real(kind=f64), dimension(:), intent(out)  coefs_dofs,
procedure(sll_i_function_3d_real64 func1,
procedure(sll_i_function_3d_real64), optional  func2,
procedure(sll_i_function_3d_real64), optional  func3 
)
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
[in]formSpecify if the function is a0,1,2 or 3-form
[in]componentSpecify the component of the function
[out]coefs_dofsFinite Element right-hand-side
func1Function first component
func2Function second component
func3Function third component

Definition at line 321 of file sll_m_maxwell_3d_fem.F90.

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