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

Description

Solve Maxwell's equations in curvilinear coordinates in 1D based on spline FEM, version based on sparse matrices.

Author
Benedikt Perse

Derived types and interfaces

type  sll_t_maxwell_1d_trafo
 

Functions/Subroutines

subroutine sll_s_compute_e_from_b_1d_trafo (self, delta_t, field_in, field_out)
 compute Ey from Bz using weak Ampere formulation More...
 
subroutine sll_s_compute_b_from_e_1d_trafo (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_1d_trafo (self, delta_t, efield, bfield, betar)
 Solve curl part of Maxwell's equations. More...
 
subroutine sll_s_compute_e_from_rho_1d_trafo (self, field_in, field_out)
 compute e from rho using weak Poisson's equation ( rho = G^T M_1 G \phi, e = -G \phi ) More...
 
subroutine compute_rho_from_e_1d_trafo (self, field_in, field_out)
 Compute rho from Gauss law for given efield. More...
 
subroutine compute_e_from_j_1d_trafo (self, current, component, E)
 Compute E_i from j_i integrated over the time interval using weak Ampere formulation. More...
 
subroutine compute_phi_from_rho_1d_trafo (self, in, phi, efield)
 For model with adiabatic electrons. More...
 
subroutine compute_phi_from_j_1d_trafo (self, in, phi, efield)
 For model with adiabatic electrons. More...
 
subroutine sll_s_compute_rhs_trafo (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...
 
subroutine l2projection_1d_trafo (self, func, degree, coefs_dofs)
 Compute the L2 projection of a given function f on periodic splines of given degree. More...
 
real(kind=f64) function l2norm_squared_1d_trafo (self, coefs_dofs, degree)
 Compute square of the L2norm. More...
 
real(kind=f64) function inner_product_1d_trafo (self, coefs1_dofs, coefs2_dofs, degree, degree2)
 Compute inner product. More...
 
subroutine init_1d_trafo (self, domain, n_dofs, s_deg_0, map, mass_tolerance, poisson_tolerance, solver_tolerance, force_sign)
 Initialization. More...
 
subroutine init_from_file_1d_trafo (self, domain, n_dofs, s_deg_0, map, nml_file, force_sign)
 Initialization from nml file. More...
 
subroutine free_1d_trafo (self)
 Finalization. More...
 
subroutine multiply_g (self, in, out)
 Multiply by dicrete gradient matrix. More...
 
subroutine multiply_gt (self, in, out)
 Multiply by transpose of dicrete gradient matrix. More...
 
subroutine multiply_mass_1d_trafo (self, in, out, degree)
 Multiply by the mass matrix. More...
 
subroutine invert_mass_1d_trafo (self, in, out, degree)
 Multiply by the inverse mass matrix. More...
 

Function/Subroutine Documentation

◆ compute_e_from_j_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::compute_e_from_j_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 229 of file sll_m_maxwell_1d_trafo.F90.

◆ compute_phi_from_j_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::compute_phi_from_j_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 269 of file sll_m_maxwell_1d_trafo.F90.

Here is the call graph for this function:

◆ compute_phi_from_rho_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::compute_phi_from_rho_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 252 of file sll_m_maxwell_1d_trafo.F90.

Here is the call graph for this function:

◆ compute_rho_from_e_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::compute_rho_from_e_1d_trafo ( class(sll_t_maxwell_1d_trafo 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
[in]field_inE
[out]field_outrho

Definition at line 216 of file sll_m_maxwell_1d_trafo.F90.

Here is the call graph for this function:

◆ free_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::free_1d_trafo ( class(sll_t_maxwell_1d_trafo self)
private

Finalization.

Parameters
selfMaxwell solver class

Definition at line 628 of file sll_m_maxwell_1d_trafo.F90.

◆ init_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::init_1d_trafo ( class(sll_t_maxwell_1d_trafo), 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,
type(sll_t_mapping_3d), intent(inout), target  map,
real(kind=f64), intent(in), optional  mass_tolerance,
real(kind=f64), intent(in), optional  poisson_tolerance,
real(kind=f64), intent(in), optional  solver_tolerance,
real(kind=f64), intent(in), optional  force_sign 
)
private

Initialization.

Parameters
[out]selfsolver 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,out]mapcoordinate transformation
[in]mass_tolerancetolerance for mass solver
[in]poisson_tolerancetolerance for Poisson solver
[in]solver_tolerancetolerance for Schur complement solver
[in]force_signsign of particle force

Definition at line 443 of file sll_m_maxwell_1d_trafo.F90.

Here is the call graph for this function:

◆ init_from_file_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::init_from_file_1d_trafo ( class(sll_t_maxwell_1d_trafo), 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,
type(sll_t_mapping_3d), intent(inout), target  map,
character(len=*), intent(in)  nml_file,
real(kind=f64), intent(in), optional  force_sign 
)
private

Initialization from nml file.

Parameters
[out]selfsolver 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,out]mapcoordinate transformation
[in]nml_filenml-file
[in]force_signsign of particle force

Definition at line 551 of file sll_m_maxwell_1d_trafo.F90.

Here is the call graph for this function:

◆ inner_product_1d_trafo()

real(kind=f64) function sll_m_maxwell_1d_trafo::inner_product_1d_trafo ( class(sll_t_maxwell_1d_trafo self,
real(kind=f64), dimension(:)  coefs1_dofs,
real(kind=f64), dimension(:)  coefs2_dofs,
integer(kind=i32)  degree,
integer(kind=i32), optional  degree2 
)
private

Compute inner product.

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 393 of file sll_m_maxwell_1d_trafo.F90.

◆ invert_mass_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::invert_mass_1d_trafo ( class(sll_t_maxwell_1d_trafo), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out,
integer(kind=i32), intent(in)  degree 
)
private

Multiply by the inverse mass matrix.

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 689 of file sll_m_maxwell_1d_trafo.F90.

◆ l2norm_squared_1d_trafo()

real(kind=f64) function sll_m_maxwell_1d_trafo::l2norm_squared_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 370 of file sll_m_maxwell_1d_trafo.F90.

◆ l2projection_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::l2projection_1d_trafo ( class(sll_t_maxwell_1d_trafo 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
[out]coefs_dofsspline coefficients of projection

Definition at line 348 of file sll_m_maxwell_1d_trafo.F90.

◆ multiply_g()

subroutine sll_m_maxwell_1d_trafo::multiply_g ( class(sll_t_maxwell_1d_trafo), intent(in)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out 
)
private

Multiply by dicrete gradient matrix.

Parameters
[in]selfMaxwell solver class
[in]infield_in
[out]outG*field_in

Definition at line 646 of file sll_m_maxwell_1d_trafo.F90.

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

◆ multiply_gt()

subroutine sll_m_maxwell_1d_trafo::multiply_gt ( class(sll_t_maxwell_1d_trafo), intent(in)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out 
)
private

Multiply by transpose of dicrete gradient matrix.

Parameters
[in]selfMaxwell solver class
[in]infield_in
[out]outG^T*field_in

Definition at line 657 of file sll_m_maxwell_1d_trafo.F90.

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

◆ multiply_mass_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::multiply_mass_1d_trafo ( class(sll_t_maxwell_1d_trafo), intent(inout)  self,
real(kind=f64), dimension(:), intent(in)  in,
real(kind=f64), dimension(:), intent(out)  out,
integer(kind=i32), intent(in)  degree 
)
private

Multiply by the mass matrix.

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 668 of file sll_m_maxwell_1d_trafo.F90.

◆ sll_s_compute_b_from_e_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::sll_s_compute_b_from_e_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 147 of file sll_m_maxwell_1d_trafo.F90.

◆ sll_s_compute_curl_part_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::sll_s_compute_curl_part_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 161 of file sll_m_maxwell_1d_trafo.F90.

◆ sll_s_compute_e_from_b_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::sll_s_compute_e_from_b_1d_trafo ( class(sll_t_maxwell_1d_trafo 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 129 of file sll_m_maxwell_1d_trafo.F90.

◆ sll_s_compute_e_from_rho_1d_trafo()

subroutine sll_m_maxwell_1d_trafo::sll_s_compute_e_from_rho_1d_trafo ( class(sll_t_maxwell_1d_trafo self,
real(kind=f64), dimension(:), intent(in)  field_in,
real(kind=f64), dimension(:), intent(out)  field_out 
)
private

compute e from rho using weak Poisson's equation ( rho = G^T M_1 G \phi, e = -G \phi )

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

Definition at line 203 of file sll_m_maxwell_1d_trafo.F90.

Here is the call graph for this function:

◆ sll_s_compute_rhs_trafo()

subroutine sll_m_maxwell_1d_trafo::sll_s_compute_rhs_trafo ( class(sll_t_maxwell_1d_trafo 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
[out]coefs_dofsFinite Element right-hand-side

Definition at line 291 of file sll_m_maxwell_1d_trafo.F90.

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