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

Description

Solve Maxwell's equations in curvilinear coordinates 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_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 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_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_cells, s_deg_0, boundary, map, mass_tolerance, poisson_tolerance, solver_tolerance)
 Initialization. More...
 
subroutine init_from_file_1d_trafo (self, domain, n_cells, s_deg_0, boundary, map, nml_file)
 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...
 
subroutine compute_field_energy (self, efield_dofs1, efield_dofs2, bfield_dofs, energy)
 Compute field energy. More...
 

Function/Subroutine Documentation

◆ compute_e_from_j_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::compute_e_from_j_1d_trafo ( class(sll_t_maxwell_clamped_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_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 234 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ compute_field_energy()

subroutine sll_m_maxwell_clamped_1d_trafo::compute_field_energy ( class(sll_t_maxwell_clamped_1d_trafo 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 field energy.

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

Definition at line 770 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ compute_phi_from_j_1d_trafo()

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

Definition at line 272 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ compute_phi_from_rho_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::compute_phi_from_rho_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]inrho
[out]efieldE

Definition at line 255 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ compute_rho_from_e_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::compute_rho_from_e_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]field_inE
[out]field_outrho

Definition at line 221 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ free_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::free_1d_trafo ( class(sll_t_maxwell_clamped_1d_trafo self)
private

Finalization.

Parameters
selfMaxwell_Clamped solver class

Definition at line 684 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ init_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::init_1d_trafo ( class(sll_t_maxwell_clamped_1d_trafo), 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,
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 
)
private

Initialization.

Parameters
[out]selfMaxwell_Clamped solver class
[in]domainxmin, xmax
[in]n_cellsnumber of cells
[in]s_deg_0highest spline degree
[in]boundaryfield boundary conditions
[in,out]mapcoordinate transformation
[in]mass_tolerancetolerance for mass solver
[in]poisson_tolerancetolerance for Poisson solver
[in]solver_tolerancetolerance for Schur complement solver

Definition at line 519 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ init_from_file_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::init_from_file_1d_trafo ( class(sll_t_maxwell_clamped_1d_trafo), 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,
type(sll_t_mapping_3d), intent(inout), target  map,
character(len=*), intent(in)  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
[in,out]mapcoordinate transformation
[in]nml_filenml-file

Definition at line 621 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ inner_product_1d_trafo()

real(kind=f64) function sll_m_maxwell_clamped_1d_trafo::inner_product_1d_trafo ( class(sll_t_maxwell_clamped_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_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 472 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ invert_mass_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::invert_mass_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]inCoefficient for each DoF
[out]outCoefficient for each DoF
[in]degreeSpecify the degree of the basis functions

Definition at line 749 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ l2norm_squared_1d_trafo()

real(kind=f64) function sll_m_maxwell_clamped_1d_trafo::l2norm_squared_1d_trafo ( class(sll_t_maxwell_clamped_1d_trafo 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 452 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ l2projection_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::l2projection_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
funcFunction
[in]degreeSpecify the degree of the basis functions
[out]coefs_dofsSpline coefficients of projection

Definition at line 430 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ multiply_g()

subroutine sll_m_maxwell_clamped_1d_trafo::multiply_g ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]infield_in
[out]outG*field_in

Definition at line 706 of file sll_m_maxwell_clamped_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_clamped_1d_trafo::multiply_gt ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]infield_in
[out]outG^T*field_in

Definition at line 717 of file sll_m_maxwell_clamped_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_clamped_1d_trafo::multiply_mass_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]inCoefficient for each DoF
[out]outCoefficient for each DoF
[in]degreeSpecify the degree of the basis functions

Definition at line 728 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ sll_s_compute_b_from_e_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::sll_s_compute_b_from_e_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]delta_tTime step

Definition at line 151 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ sll_s_compute_curl_part_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::sll_s_compute_curl_part_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class

Definition at line 165 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ sll_s_compute_e_from_b_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::sll_s_compute_e_from_b_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]delta_tTime step
[in]field_inBz
[in,out]field_outEy

Definition at line 133 of file sll_m_maxwell_clamped_1d_trafo.F90.

◆ sll_s_compute_e_from_rho_1d_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::sll_s_compute_e_from_rho_1d_trafo ( class(sll_t_maxwell_clamped_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_Clamped solver class
[in]field_inrho
[out]field_outE

Definition at line 208 of file sll_m_maxwell_clamped_1d_trafo.F90.

Here is the call graph for this function:

◆ sll_s_compute_rhs_trafo()

subroutine sll_m_maxwell_clamped_1d_trafo::sll_s_compute_rhs_trafo ( class(sll_t_maxwell_clamped_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 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 294 of file sll_m_maxwell_clamped_1d_trafo.F90.

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