The Open FUSION Toolkit 1.0.0-8905cc5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
oft_mf_matrix Type Referenceabstract

Detailed Description

Wrapper matrix for matrix-free Jacobians.

Computes a Finite Difference approximation to the Jacobian of a function \( F'(v) = [F(u0 + h * v) - F(u0)]/h \)

Inheritance diagram for oft_mf_matrix:
Inheritance graph
[legend]

Public Member Functions

procedure add_values (self, i_inds, j_inds, b, n, m, iblock, jblock, loc_cache)
 Add values to a matrix.
 
procedure(mat_add_values), deferred add_values (self, i_inds, j_inds, b, n, m, iblock, jblock, loc_cache)
 Add values to the matrix.
 
generic apply (self, a, b)
 Compute matrix-vector product.
 
generic apply (self, a, b)
 Compute matrix-vector product.
 
procedure apply_complex (self, a, b)
 Compute matrix vector product (complex)
 
procedure apply_real (self, a, b)
 Apply the matrix to a field.
 
procedure apply_real (self, a, b)
 Compute matrix vector product.
 
procedure(mat_apply_vec), deferred apply_real (self, a, b)
 
generic applyt (self, a, b)
 Compute matrix-vector product for matrix transpose.
 
generic applyt (self, a, b)
 Compute matrix-vector product for matrix transpose.
 
procedure applyt_complex (self, a, b)
 Apply the matrix to a field.
 
procedure applyt_complex (self, a, b)
 Apply matrix vector product for matrix transpose (complex vector)
 
procedure applyt_real (self, a, b)
 Apply the matrix to a field.
 
procedure(mat_apply_vec), deferred applyt_real (self, a, b)
 
procedure assemble (self, diag)
 Finish assembly of matrix and optionally extract diagonals.
 
procedure(mat_assemble), deferred assemble (self, diag)
 Complete matrix assembly.
 
procedure atomic_add_values (self, i_inds, j_inds, b, n, m, iblock, jblock, loc_cache)
 Add values to a matrix.
 
procedure(mat_add_values), deferred atomic_add_values (self, i_inds, j_inds, b, n, m, iblock, jblock, loc_cache)
 Add values atomically to the matrix.
 
procedure delete (self)
 Delete matrix.
 
procedure delete (self)
 Cleanup internal storage.
 
procedure delete (self)
 Delete matrix.
 
procedure set_values (self, i_inds, j_inds, b, n, m, iblock, jblock)
 Set values of a matrix.
 
procedure(mat_set_values), deferred set_values (self, i_inds, j_inds, b, n, m, iblock, jblock)
 Set values of the matrix.
 
procedure setup (self, a, f, utyp)
 Setup MF jacobian operator.
 
procedure update (self, a)
 Update linearization point.
 
procedure zero (self)
 Zero all entries in matrix.
 
procedure(mat_zero), deferred zero (self)
 Zero all elements.
 
procedure zero_rows (self, nrows, irows, iblock, keep_diag)
 Zero all entries in the specified rows.
 
procedure(mat_zero_rows), deferred zero_rows (self, nrows, irows, iblock, keep_diag)
 Zero all elements in a given row.
 

Public Attributes

real(r8b0 = 1.d-6
 Approximate relative error in function eval.
 
class(oft_vector), pointer d => NULL()
 Diagonal entries for scaling.
 
class(oft_matrix), pointer f => NULL()
 Non-linear function.
 
class(oft_vector), pointer f0 => NULL()
 Linearization value "F(u0)".
 
logical force_local = .FALSE.
 Do not stitch resulting vector? (Native ONLY)
 
type(oft_map), dimension(:), pointer i_map => NULL()
 Row block mapping.
 
type(oft_map), dimension(:), pointer j_map => NULL()
 Column block mapping.
 
integer(i4nc
 Local number of columns.
 
integer(i8ncg
 Gobal number of columns.
 
integer(i4ncslice = 0
 Number of owned columns.
 
integer(i4ni = 0
 Number of row blocks.
 
integer(i4nj = 0
 Number of column blocks.
 
integer(i4nr
 Local number of rows.
 
integer(i8nrg
 Gobal number of rows.
 
integer(i4nrslice = 0
 Number of owned rows.
 
class(oft_vector), pointer tmp => NULL()
 Internal work vector.
 
class(oft_vector), pointer u0 => NULL()
 Linearization point.
 
class(oft_vector), pointer utyp => NULL()
 Typical values vector.
 

Member Function/Subroutine Documentation

◆ add_values() [1/2]

procedure add_values ( class(oft_noop_matrix), intent(inout)  self,
integer(i4), dimension(n), intent(in)  i_inds,
integer(i4), dimension(m), intent(in)  j_inds,
real(r8), dimension(n,m), intent(in)  b,
integer(i4), intent(in)  n,
integer(i4), intent(in)  m,
integer(i4), intent(in), optional  iblock,
integer(i4), intent(in), optional  jblock,
integer(i4), dimension(n,m), intent(inout), optional  loc_cache 
)
inherited

Add values to a matrix.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in]i_indsRow indices of entries to add [n]
[in]j_indsColumn indices of entries to add [m]
[in]bValues to set [n,m]
[in]nNumber of rows in local matrix
[in]mNumber of columns in local matrix
[in]iblockRow block (optional)
[in]jblockColumn block (optional)
[in,out]loc_cacheCache of entry locations

◆ add_values() [2/2]

procedure(mat_add_values), deferred add_values ( class(oft_matrix), intent(inout)  self,
integer(i4), dimension(n), intent(in)  i_inds,
integer(i4), dimension(m), intent(in)  j_inds,
real(r8), dimension(n,m), intent(in)  b,
integer(i4), intent(in)  n,
integer(i4), intent(in)  m,
integer(i4), intent(in), optional  iblock,
integer(i4), intent(in), optional  jblock,
integer(i4), dimension(n,m), intent(inout), optional  loc_cache 
)
pure virtualinherited

Add values to the matrix.

Parameters
[in,out]selfMatrix object
[in]i_indsRow indices of entries to add [n]
[in]j_indsColumn indices of entries to add [m]
[in]bValues to set [n,m]
[in]nNumber of rows in local matrix
[in]mNumber of columns in local matrix
[in]iblockRow block (optional)
[in]jblockColumn block (optional)
[in,out]loc_cacheCache of entry locations

◆ apply() [1/2]

generic apply ( class(oft_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)
inherited

Compute matrix-vector product.

Parameters
[in,out]selfMatrix object
[in,out]aSource vector
[in,out]bResult of matrix product

◆ apply() [2/2]

generic apply ( class(oft_matrix), intent(inout)  self,
class(oft_cvector), intent(inout), target  a,
class(oft_cvector), intent(inout)  b 
)
inherited

Compute matrix-vector product.

b = self * a

Parameters
[in,out]selfMatrix object
[in,out]aVector object
[in,out]bResult vector

◆ apply_complex()

procedure apply_complex ( class(oft_matrix), intent(inout)  self,
class(oft_cvector), intent(inout), target  a,
class(oft_cvector), intent(inout)  b 
)
inherited

Compute matrix vector product (complex)

b = self * a

Parameters
[in,out]selfMatrix object
[in,out]aVector object
[in,out]bResult vector

◆ apply_real() [1/3]

procedure apply_real ( class(oft_noop_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)
inherited

Apply the matrix to a field.

b = self * a

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in,out]aSource field
[in,out]bResult of matrix product

◆ apply_real() [2/3]

procedure apply_real ( class(oft_mf_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)

Compute matrix vector product.

b = (selff(a) - selff0)/eps

Parameters
[in,out]selfMatrix object
[in,out]aVector object
[in,out]bResult vector

◆ apply_real() [3/3]

procedure(mat_apply_vec), deferred apply_real ( class(oft_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)
pure virtualinherited
Parameters
[in,out]selfMatrix object
[in,out]aSource vector
[in,out]bResult of matrix product

◆ applyt() [1/2]

generic applyt ( class(oft_matrix), intent(inout)  self,
class(oft_cvector), intent(inout), target  a,
class(oft_cvector), intent(inout)  b 
)
inherited

Compute matrix-vector product for matrix transpose.

b = self^T * a

Parameters
[in,out]selfMatrix object
[in,out]aVector object
[in,out]bResult vector

◆ applyt() [2/2]

generic applyt ( class(oft_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)
inherited

Compute matrix-vector product for matrix transpose.

Parameters
[in,out]selfMatrix object
[in,out]aSource vector
[in,out]bResult of matrix product

◆ applyt_complex() [1/2]

procedure applyt_complex ( class(oft_noop_matrix), intent(inout)  self,
class(oft_cvector), intent(inout), target  a,
class(oft_cvector), intent(inout)  b 
)
inherited

Apply the matrix to a field.

b = self * a

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in,out]aSource field
[in,out]bResult of matrix product

◆ applyt_complex() [2/2]

procedure applyt_complex ( class(oft_matrix), intent(inout)  self,
class(oft_cvector), intent(inout), target  a,
class(oft_cvector), intent(inout)  b 
)
inherited

Apply matrix vector product for matrix transpose (complex vector)

b = self^T * a

Parameters
[in,out]selfMatrix object
[in,out]aVector object
[in,out]bResult vector

◆ applyt_real() [1/2]

procedure applyt_real ( class(oft_noop_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)
inherited

Apply the matrix to a field.

b = self * a

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in,out]aSource field
[in,out]bResult of matrix product

◆ applyt_real() [2/2]

procedure(mat_apply_vec), deferred applyt_real ( class(oft_matrix), intent(inout)  self,
class(oft_vector), intent(inout), target  a,
class(oft_vector), intent(inout)  b 
)
pure virtualinherited
Parameters
[in,out]selfMatrix object
[in,out]aSource vector
[in,out]bResult of matrix product

◆ assemble() [1/2]

procedure assemble ( class(oft_noop_matrix), intent(inout)  self,
class(oft_vector), intent(inout), optional, target  diag 
)
inherited

Finish assembly of matrix and optionally extract diagonals.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in,out]diagDiagonal entries of matrix [nr] (optional)

◆ assemble() [2/2]

procedure(mat_assemble), deferred assemble ( class(oft_matrix), intent(inout)  self,
class(oft_vector), intent(inout), optional, target  diag 
)
pure virtualinherited

Complete matrix assembly.

Parameters
[in,out]selfMatrix object
[in,out]diagDiagonal entries of matrix [nr] (optional)

◆ atomic_add_values() [1/2]

procedure atomic_add_values ( class(oft_noop_matrix), intent(inout)  self,
integer(i4), dimension(n), intent(in)  i_inds,
integer(i4), dimension(m), intent(in)  j_inds,
real(r8), dimension(n,m), intent(in)  b,
integer(i4), intent(in)  n,
integer(i4), intent(in)  m,
integer(i4), intent(in), optional  iblock,
integer(i4), intent(in), optional  jblock,
integer(i4), dimension(n,m), intent(inout), optional  loc_cache 
)
inherited

Add values to a matrix.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in]i_indsRow indices of entries to add [n]
[in]j_indsColumn indices of entries to add [m]
[in]bValues to set [n,m]
[in]nNumber of rows in local matrix
[in]mNumber of columns in local matrix
[in]iblockRow block (optional)
[in]jblockColumn block (optional)
[in,out]loc_cacheCache of entry locations

◆ atomic_add_values() [2/2]

procedure(mat_add_values), deferred atomic_add_values ( class(oft_matrix), intent(inout)  self,
integer(i4), dimension(n), intent(in)  i_inds,
integer(i4), dimension(m), intent(in)  j_inds,
real(r8), dimension(n,m), intent(in)  b,
integer(i4), intent(in)  n,
integer(i4), intent(in)  m,
integer(i4), intent(in), optional  iblock,
integer(i4), intent(in), optional  jblock,
integer(i4), dimension(n,m), intent(inout), optional  loc_cache 
)
pure virtualinherited

Add values atomically to the matrix.

Parameters
[in,out]selfMatrix object
[in]i_indsRow indices of entries to add [n]
[in]j_indsColumn indices of entries to add [m]
[in]bValues to set [n,m]
[in]nNumber of rows in local matrix
[in]mNumber of columns in local matrix
[in]iblockRow block (optional)
[in]jblockColumn block (optional)
[in,out]loc_cacheCache of entry locations

◆ delete() [1/3]

procedure delete ( class(oft_noop_matrix), intent(inout)  self)
inherited

Delete matrix.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices.

◆ delete() [2/3]

procedure delete ( class(oft_mf_matrix), intent(inout)  self)

Cleanup internal storage.

Parameters
[in,out]selfMatrix object

◆ delete() [3/3]

procedure delete ( class(oft_matrix), intent(inout)  self)
inherited

Delete matrix.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices.

◆ set_values() [1/2]

procedure set_values ( class(oft_noop_matrix), intent(inout)  self,
integer(i4), dimension(n), intent(in)  i_inds,
integer(i4), dimension(m), intent(in)  j_inds,
real(r8), dimension(n,m), intent(in)  b,
integer(i4), intent(in)  n,
integer(i4), intent(in)  m,
integer(i4), intent(in), optional  iblock,
integer(i4), intent(in), optional  jblock 
)
inherited

Set values of a matrix.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in]i_indsRow indices of entries to set [n]
[in]j_indsColumn indices of entries to set [m]
[in]bValues to set [n,m]
[in]nNumber of rows in local matrix
[in]mNumber of columns in local matrix
[in]iblockRow block (optional)
[in]jblockColumn block (optional)

◆ set_values() [2/2]

procedure(mat_set_values), deferred set_values ( class(oft_matrix), intent(inout)  self,
integer(i4), dimension(n), intent(in)  i_inds,
integer(i4), dimension(m), intent(in)  j_inds,
real(r8), dimension(n,m), intent(in)  b,
integer(i4), intent(in)  n,
integer(i4), intent(in)  m,
integer(i4), intent(in), optional  iblock,
integer(i4), intent(in), optional  jblock 
)
pure virtualinherited

Set values of the matrix.

Parameters
[in,out]selfMatrix object
[in]i_indsRow indices of entries to set [n]
[in]j_indsColumn indices of entries to set [m]
[in]bValues to set [n,m]
[in]nNumber of rows in local matrix
[in]mNumber of columns in local matrix
[in]iblockRow block (optional)
[in]jblockColumn block (optional)

◆ setup()

procedure setup ( class(oft_mf_matrix), intent(inout)  self,
class(oft_vector), intent(inout)  a,
class(oft_matrix), intent(in), target  f,
class(oft_vector), intent(inout), optional  utyp 
)

Setup MF jacobian operator.

Parameters
[in,out]selfMatrix object
[in,out]aVector defining domain and range spaces
[in]fNon-linear function defining the Jacobian
[in,out]utypVector of "typical sizes" (optional)

◆ update()

procedure update ( class(oft_mf_matrix), intent(inout)  self,
class(oft_vector), intent(inout)  a 
)

Update linearization point.

Parameters
[in,out]selfMatrix object
[in,out]aNew linearization point

◆ zero() [1/2]

procedure zero ( class(oft_noop_matrix), intent(inout)  self)
inherited

Zero all entries in matrix.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices

◆ zero() [2/2]

procedure(mat_zero), deferred zero ( class(oft_matrix), intent(inout)  self)
pure virtualinherited

Zero all elements.

Parameters
[in,out]selfMatrix object

◆ zero_rows() [1/2]

procedure zero_rows ( class(oft_noop_matrix), intent(inout)  self,
integer(i4), intent(in)  nrows,
integer(i4), dimension(nrows), intent(in)  irows,
integer(i4), intent(in), optional  iblock,
logical, intent(in), optional  keep_diag 
)
inherited

Zero all entries in the specified rows.

Note
This subroutine is a dummy routine used to specify the interface of the member function and catch errors in uninitialized matrices
Parameters
[in]nrowsNumber of rows to zero
[in]irowsIndices of rows to zero [nrows]
[in]iblockRow block (optional)
[in]keep_diagKeep diagonal entries

◆ zero_rows() [2/2]

procedure(mat_zero_rows), deferred zero_rows ( class(oft_matrix), intent(inout)  self,
integer(i4), intent(in)  nrows,
integer(i4), dimension(nrows), intent(in)  irows,
integer(i4), intent(in), optional  iblock,
logical, intent(in), optional  keep_diag 
)
pure virtualinherited

Zero all elements in a given row.

Parameters
[in,out]selfMatrix object
[in]nrowsNumber of rows to zero
[in]irowsIndices of rows to zero [nrows]
[in]iblockRow block (optional)
[in]keep_diagKeep diagonal entries

Member Data Documentation

◆ b0

real(r8) b0 = 1.d-6

Approximate relative error in function eval.

◆ d

class(oft_vector), pointer d => NULL()
inherited

Diagonal entries for scaling.

◆ f

class(oft_matrix), pointer f => NULL()

Non-linear function.

◆ f0

class(oft_vector), pointer f0 => NULL()

Linearization value "F(u0)".

◆ force_local

logical force_local = .FALSE.
inherited

Do not stitch resulting vector? (Native ONLY)

◆ i_map

type(oft_map), dimension(:), pointer i_map => NULL()
inherited

Row block mapping.

◆ j_map

type(oft_map), dimension(:), pointer j_map => NULL()
inherited

Column block mapping.

◆ nc

integer(i4) nc
inherited

Local number of columns.

◆ ncg

integer(i8) ncg
inherited

Gobal number of columns.

◆ ncslice

integer(i4) ncslice = 0
inherited

Number of owned columns.

◆ ni

integer(i4) ni = 0
inherited

Number of row blocks.

◆ nj

integer(i4) nj = 0
inherited

Number of column blocks.

◆ nr

integer(i4) nr
inherited

Local number of rows.

◆ nrg

integer(i8) nrg
inherited

Gobal number of rows.

◆ nrslice

integer(i4) nrslice = 0
inherited

Number of owned rows.

◆ tmp

class(oft_vector), pointer tmp => NULL()

Internal work vector.

◆ u0

class(oft_vector), pointer u0 => NULL()

Linearization point.

◆ utyp

class(oft_vector), pointer utyp => NULL()

Typical values vector.


The documentation for this type was generated from the following file: