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

Description

Solve Maxwell's equations with boundary conditions in 1D based on spline FEM, version based on sparse matrices.

Author
Benedikt Perse

Derived types and interfaces

type  sll_t_maxwell_clamped_1d_fem_sm
 

Functions/Subroutines

subroutine sll_s_compute_e_from_b_1d_fem_sm (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_sm (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_fem_sm (self, delta_t, efield, bfield, betar)
 Solve curl part of Maxwell's equations. More...
 
subroutine sll_s_compute_e_from_rho_1d_fem_sm (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_fem_sm (self, field_in, field_out)
 Compute rho from Gauss law for given efield. More...
 
subroutine compute_e_from_j_1d_fem_sm (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_fem_sm (self, in, phi, efield)
 For model with adiabatic electrons. More...
 
subroutine compute_phi_from_j_1d_fem_sm (self, in, phi, efield)
 For model with adiabatic electrons. More...
 
subroutine sll_s_compute_rhs_fem_sm (self, func, degree, coefs_dofs)
 Compute the FEM right-hand-side for a given function f and clamped 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_fem_sm (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_fem_sm (self, coefs_dofs, degree)
 Compute square of the L2norm. More...
 
real(kind=f64) function inner_product_1d_fem_sm (self, coefs1_dofs, coefs2_dofs, degree, degree2)
 Compute inner product. More...
 
subroutine init_1d_fem_sm (self, domain, n_cells, s_deg_0, boundary, mass_tolerance, poisson_tolerance, solver_tolerance)
 Initialization. More...
 
subroutine init_from_file_1d_fem_sm (self, domain, n_cells, s_deg_0, boundary, nml_file)
 Initialization from nml file. More...
 
subroutine free_1d_fem_sm (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_fem_sm (self, in, out, degree)
 Multiply by the mass matrix. More...
 
subroutine invert_mass_1d_fem_sm (self, in, out, degree)
 Multiply by the inverse mass matrix. More...
 
subroutine compute_field_energy (self, efield_dofs1, efield_dofs2, bfield_dofs, energy)
 Compute the field energy. More...
 

Function/Subroutine Documentation

◆ compute_e_from_j_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::compute_e_from_j_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped 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 238 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ compute_field_energy()

subroutine sll_m_maxwell_clamped_1d_fem_sm::compute_field_energy ( class(sll_t_maxwell_clamped_1d_fem_sm self,
real(kind=f64), dimension(:), intent(in)  efield_dofs1,
real(kind=f64), dimension(:), intent(in)  efield_dofs2,
real(kind=f64), dimension(:), intent(in)  bfield_dofs,
real(kind=f64), intent(out)  energy 
)
private

Compute the field energy.

Parameters
selfMaxwell_Clamped solver class
[in]efield_dofs1Ex
[in]efield_dofs2Ey
[in]bfield_dofsBz
[out]energyfield energy

Definition at line 766 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ compute_phi_from_j_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::compute_phi_from_j_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class
[in]inCurrent integrated over time interval
[out]efieldE

Definition at line 277 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ compute_phi_from_rho_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::compute_phi_from_rho_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class
[in]inrho
[out]efieldE

Definition at line 260 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ compute_rho_from_e_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::compute_rho_from_e_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class

Definition at line 225 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ free_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::free_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm self)
private

Finalization.

Parameters
selfMaxwell_Clamped solver class

Definition at line 679 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ init_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::init_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm), intent(out)  self,
real(kind=f64), dimension(2), intent(in)  domain,
integer(kind=i32), intent(in)  n_cells,
integer(kind=i32), intent(in)  s_deg_0,
integer(kind=i32), intent(in)  boundary,
real(kind=f64), intent(in), optional  mass_tolerance,
real(kind=f64), intent(in), optional  poisson_tolerance,
real(kind=f64), intent(in), optional  solver_tolerance 
)
private

Initialization.

Parameters
[out]selfMaxwell_Clamped solver class
[in]domainxmin, xmax
[in]n_cellsnumber of degrees of freedom (here number of cells and grid points)
[in]s_deg_0highest spline degree
[in]boundaryfield boundary conditions
[in]mass_tolerancetolerance for mass solver
[in]poisson_tolerancetolerance for Poisson solver
[in]solver_tolerancetolerance for Schur complement solver

Definition at line 515 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ init_from_file_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::init_from_file_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm), intent(out)  self,
real(kind=f64), dimension(2), intent(in)  domain,
integer(kind=i32), intent(in)  n_cells,
integer(kind=i32), intent(in)  s_deg_0,
integer(kind=i32), intent(in)  boundary,
character(len=*)  nml_file 
)
private

Initialization from nml file.

Parameters
[out]selfMaxwell_Clamped solver class
[in]domainxmin, xmax
[in]n_cellsnumber of degrees of freedom (here number of cells and grid points)
[in]s_deg_0highest spline degree
[in]boundaryfield boundary conditions
nml_filenml-file

Definition at line 617 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ inner_product_1d_fem_sm()

real(kind=f64) function sll_m_maxwell_clamped_1d_fem_sm::inner_product_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped 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 468 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ invert_mass_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::invert_mass_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm), 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_Clamped solver class
[in]inCoefficient for each DoF
[out]outCoefficient for each DoF
[in]degreeSpecify the degree of the basis functions

Definition at line 743 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ l2norm_squared_1d_fem_sm()

real(kind=f64) function sll_m_maxwell_clamped_1d_fem_sm::l2norm_squared_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm self,
real(kind=f64), dimension(:)  coefs_dofs,
integer(kind=i32)  degree 
)
private

Compute square of the L2norm.

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

Definition at line 447 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ l2projection_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::l2projection_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class
funcFunction
[in]degreeSpecify the degree of the basis functions

Definition at line 423 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ multiply_g()

subroutine sll_m_maxwell_clamped_1d_fem_sm::multiply_g ( class(sll_t_maxwell_clamped_1d_fem_sm), 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_Clamped solver class
[in]infield_in
[out]outG*field_in

Definition at line 699 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

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

◆ multiply_gt()

subroutine sll_m_maxwell_clamped_1d_fem_sm::multiply_gt ( class(sll_t_maxwell_clamped_1d_fem_sm), 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_Clamped solver class
[in]infield_in
[out]outG^T*field_in

Definition at line 710 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

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

◆ multiply_mass_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::multiply_mass_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm), 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_Clamped solver class
[in]inCoefficient for each DoF
[out]outCoefficient for each DoF
[in]degreeSpecify the degree of the basis functions

Definition at line 721 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ sll_s_compute_b_from_e_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::sll_s_compute_b_from_e_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class
[in]delta_tTime step

Definition at line 155 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ sll_s_compute_curl_part_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::sll_s_compute_curl_part_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class

Definition at line 169 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ sll_s_compute_e_from_b_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::sll_s_compute_e_from_b_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class
[in]delta_tTime step
[in]field_inBz
[in,out]field_outEy

Definition at line 136 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

◆ sll_s_compute_e_from_rho_1d_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::sll_s_compute_e_from_rho_1d_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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_Clamped solver class
[in]field_inrho
[out]field_outE

Definition at line 212 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

Here is the call graph for this function:

◆ sll_s_compute_rhs_fem_sm()

subroutine sll_m_maxwell_clamped_1d_fem_sm::sll_s_compute_rhs_fem_sm ( class(sll_t_maxwell_clamped_1d_fem_sm 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 clamped 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_Clamped solver class
funcFunction
[in]degreeSpecify the degree of the basis functions
[out]coefs_dofsFinite Element right-hand-side

Definition at line 300 of file sll_m_maxwell_clamped_1d_fem_sm.F90.

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