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 | Variables
sll_m_vector_space_base Module Reference

Description

Abstract type implementing a generic vector space.

Authors
Yaman Güçlü - yaman.nosp@m..guc.nosp@m.lu@gm.nosp@m.ail..nosp@m.com
Marco Restelli - marco.nosp@m..res.nosp@m.telli.nosp@m.@gma.nosp@m.il.co.nosp@m.m
Edoardo Zoni - edoar.nosp@m.do.z.nosp@m.oni@i.nosp@m.pp.m.nosp@m.pg.de

Derived types and interfaces

type  sll_c_vector_space
 Abstract base class for all vector spaces. More...
 
interface  i_copy
 z = x More...
 
interface  i_incr
 z += x More...
 
interface  i_scal
 z *= a More...
 

Functions/Subroutines

subroutine s_vector_space__add (self, x, y)
 z = x + y More...
 
subroutine s_vector_space__mult (self, a, x)
 z = a * x More...
 
subroutine s_vector_space__mult_add (self, a, x, y)
 z = a * x + y More...
 
subroutine s_vector_space__incr_mult (self, a, x)
 z += a * x More...
 
subroutine s_vector_space__lcmb (self, a, x)
 z = \( \sum_i ( a_i x_i ) \) More...
 
subroutine s_vector_space__incr_lcmb (self, a, x)
 z += \( \sum_i ( a_i x_i ) \) More...
 
real(wp) function f_vector_space__norm (self)
 Norm of vector: ||z||. More...
 
real(wp) function f_vector_space__inner (self, x)
 Inner product: <z,x> More...
 
subroutine s_vector_space__show (self)
 Show something, for debug. More...
 
subroutine s_vector_space__source_scalar (self, x)
 Copy constructor: create one copy of vector z More...
 
subroutine s_vector_space__source_array (self, x, n)
 Copy constructor: create n copies of vector z More...
 

Variables

integer, parameter wp = f64
 Working precision. More...
 

Function/Subroutine Documentation

◆ f_vector_space__inner()

real(wp) function sll_m_vector_space_base::f_vector_space__inner ( class(sll_c_vector_space), intent(in)  self,
class(sll_c_vector_space), intent(in)  x 
)
private

Inner product: <z,x>

Compute the inner product between the vector z ('self') and another vector x of the same type. Usage:

r = z%inner(x)
Parameters
[in]selfVector z, caller
[in]xVector
Returns
Scalar value, of type real(wp)

Definition at line 306 of file sll_m_vector_space_base.F90.

◆ f_vector_space__norm()

real(wp) function sll_m_vector_space_base::f_vector_space__norm ( class(sll_c_vector_space), intent(in)  self)
private

Norm of vector: ||z||.

Compute the norm of the vector z ('self') that is invoking the function. By default, norm(z)=sqrt(inner(z,z)). Usage:

r = z%norm()
Parameters
[in]selfVector z, caller
Returns
Scalar value, of type real(wp)

Definition at line 288 of file sll_m_vector_space_base.F90.

◆ s_vector_space__add()

subroutine sll_m_vector_space_base::s_vector_space__add ( class(sll_c_vector_space), intent(inout)  self,
class(sll_c_vector_space), intent(in)  x,
class(sll_c_vector_space), intent(in)  y 
)
private

z = x + y

Add two vectors x and y, and write the result to the vector z ('self') that invoked this subroutine. Usage:

call z%add(x,y)
Parameters
[in,out]selfResult vector z, caller
[in]xInput vector #1
[in]yInput vector #2

Definition at line 135 of file sll_m_vector_space_base.F90.

◆ s_vector_space__incr_lcmb()

subroutine sll_m_vector_space_base::s_vector_space__incr_lcmb ( class(sll_c_vector_space), intent(inout)  self,
real(wp), dimension(:), intent(in)  a,
class(sll_c_vector_space), dimension(:), intent(in)  x 
)
private

z += \( \sum_i ( a_i x_i ) \)

Compute a linear combination of N vectors \( x_i \), according to N coefficients \( a_i \), and use the result to increment the vector z that invoked this subroutine. Usage:

call z%incr_lcmb(a,x)
Parameters
[in,out]selfResult vector z, caller
[in]aArray of N scalars
[in]xArray of N vectors

Definition at line 256 of file sll_m_vector_space_base.F90.

◆ s_vector_space__incr_mult()

subroutine sll_m_vector_space_base::s_vector_space__incr_mult ( class(sll_c_vector_space), intent(inout)  self,
real(wp), intent(in)  a,
class(sll_c_vector_space), intent(in)  x 
)
private

z += a * x

Increment the vector z ('self') by the result of the multiplication between the vector x and the scalar a. Usage:

call z%incr_mult(a,x)
Parameters
[in,out]selfResult vector z, caller
[in]aInput scalar
[in]xInput vector

Definition at line 199 of file sll_m_vector_space_base.F90.

◆ s_vector_space__lcmb()

subroutine sll_m_vector_space_base::s_vector_space__lcmb ( class(sll_c_vector_space), intent(inout)  self,
real(wp), dimension(:), intent(in)  a,
class(sll_c_vector_space), dimension(:), intent(in)  x 
)
private

z = \( \sum_i ( a_i x_i ) \)

Compute a linear combination of N vectors \( x_i \), according to N coefficients \( a_i \), and assign the result to the vector z that invoked this subroutine. Usage:

call z%lcmb(a,x)
Parameters
[in,out]selfResult vector z, caller
[in]aArray of N scalars
[in]xArray of N vectors

Definition at line 225 of file sll_m_vector_space_base.F90.

◆ s_vector_space__mult()

subroutine sll_m_vector_space_base::s_vector_space__mult ( class(sll_c_vector_space), intent(inout)  self,
real(wp), intent(in)  a,
class(sll_c_vector_space), intent(in)  x 
)
private

z = a * x

Multiply the vector x by the scalar a, and assign the result to the vector z ('self') that invoked this subroutine. Usage:

call z%mult(a,x)
Parameters
[in,out]selfResult vector z, caller
[in]aInput scalar
[in]xInput vector

Definition at line 156 of file sll_m_vector_space_base.F90.

◆ s_vector_space__mult_add()

subroutine sll_m_vector_space_base::s_vector_space__mult_add ( class(sll_c_vector_space), intent(inout)  self,
real(wp), intent(in)  a,
class(sll_c_vector_space), intent(in)  x,
class(sll_c_vector_space), intent(in)  y 
)
private

z = a * x + y

Multiply the vector x by the scalar a, sum with the vector y, and assign the result to the vector z ('self') that invoked this subroutine. Usage:

call z%mult_add(a,x,y)
Parameters
[in,out]selfResult vector z, caller
[in]aInput scalar
[in]xInput vector #1
[in]yInput vector #2

Definition at line 178 of file sll_m_vector_space_base.F90.

◆ s_vector_space__show()

subroutine sll_m_vector_space_base::s_vector_space__show ( class(sll_c_vector_space), intent(in)  self)
private

Show something, for debug.

Parameters
[in]selfVector z, caller

Definition at line 325 of file sll_m_vector_space_base.F90.

◆ s_vector_space__source_array()

subroutine sll_m_vector_space_base::s_vector_space__source_array ( class(sll_c_vector_space), intent(in)  self,
class(sll_c_vector_space), dimension(:), intent(out), allocatable  x,
integer, intent(in)  n 
)
private

Copy constructor: create n copies of vector z

Allocate array x of n vectors, and copy contents of z into each element x(i). Usage:

class( sll_c_vector_space ), allocatable :: x(:)
call z%source(x,n)
Parameters
[in]selfVector z, caller
[out]xOutput array of copies (allocatable, n vectors on exit)
[in]nNumber of identical copies required

Definition at line 364 of file sll_m_vector_space_base.F90.

◆ s_vector_space__source_scalar()

subroutine sll_m_vector_space_base::s_vector_space__source_scalar ( class(sll_c_vector_space), intent(in)  self,
class(sll_c_vector_space), intent(out), allocatable  x 
)
private

Copy constructor: create one copy of vector z

Allocate vector x and copy contents of z into it. Usage:

class( sll_c_vector_space ), allocatable :: x
call z%source(x)
Parameters
[in]selfVector z, caller
[out]xOutput copy (allocatable)

Definition at line 344 of file sll_m_vector_space_base.F90.

Variable Documentation

◆ wp

integer, parameter wp = f64
private

Working precision.

Definition at line 21 of file sll_m_vector_space_base.F90.

    Report Typos and Errors