The Open FUSION Toolkit 1.0.0-beta5
Modeling tools for plasma and fusion research and engineering
Loading...
Searching...
No Matches
Data Types | Functions/Subroutines
oft_native_solvers Module Reference

Detailed Description

Abstract solver interfaces and select native implementations.

Abstract interface definitions

Native solver implementations

Preconditioner implementations

See also
oft_cg, oft_gmres, oft_petsc_solvers
Authors
Chris Hansen
Date
August 2011

Data Types

type  oft_bc_ptr
 Boundary condition container. More...
 
type  oft_bjprecond
 Block-Jacobi preconditioner. More...
 
type  oft_diag_cscale
 Diagonal preconditioner. More...
 
type  oft_diag_scale
 Diagonal preconditioner. More...
 
interface  oft_getop_proto
 Abstract operator retrieval prototype. More...
 
type  oft_identity_inv
 Identity matrix inversion. More...
 
interface  oft_interp_proto
 Abstract interpolation prototype. More...
 
type  oft_jblock_precond
 Symmetric Jacobi smoother. More...
 
type  oft_ml_precond
 Multi-level preconditioner level. More...
 
type  oft_ml_trans
 Multi-level transfer level. More...
 
type  oft_native_cg_eigsolver
 CG eigensolver class. More...
 
type  oft_native_cg_solver
 CG solver class. More...
 
type  oft_native_gmres_csolver
 GMRES solver class. More...
 
type  oft_native_gmres_solver
 GMRES solver class. More...
 
type  oft_nksolver
 Native Newton solver. More...
 
interface  oft_update_jacobian
 Abstract operator retrieval prototype. More...
 
interface  oft_veccreate_proto
 Abstract field creation prototype. More...
 

Functions/Subroutines

recursive subroutine bjprecond_apply (self, u, g)
 Precondition a linear system using a Block-Jacobi method.
 
subroutine bjprecond_delete (self)
 Destroy Block-Jacobi preconditioner and deallocate all internal storage.
 
subroutine bjprecond_setup_xml (self, solver_node, level)
 Setup solver from XML definition.
 
recursive subroutine bjprecond_update (self, new_pattern)
 Update solver after changing settings/operators.
 
subroutine cdiag_scale_apply (self, u, g)
 Apply diagonal scaling.
 
subroutine cdiag_scale_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine cg_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine cg_eig_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine cg_eigsolver_apply (self, u, alam)
 Solve a general eigenvalue system using the Conjugate-Gradient method.
 
subroutine cg_setup_xml (self, solver_node, level)
 Setup solver from XML definition.
 
recursive subroutine cg_solver_apply (self, u, g)
 Solve a linear system using the Conjugate-Gradient method.
 
subroutine cgmres_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine cgmres_setup_xml (self, solver_node, level)
 Setup solver from XML definition.
 
recursive subroutine cgmres_solver_apply (self, u, g)
 Temp doc.
 
subroutine diag_scale_apply (self, u, g)
 Apply diagonal scaling.
 
integer(i4) function, public diag_scale_cast (self, source)
 Cast oft_solver to oft_diag_scale.
 
subroutine diag_scale_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine gmres_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine gmres_setup_xml (self, solver_node, level)
 Setup solver from XML definition.
 
recursive subroutine gmres_solver_apply (self, u, g)
 Temp doc.
 
subroutine identity_inv_apply (self, u, g)
 Solver container for trivial inverse of the identity matrix.
 
subroutine identity_inv_delete (self)
 Destroy diagonal preconditioner and deallocate all internal storage.
 
subroutine jblock_precond_apply (self, u, g)
 Apply 1-step of a symmetric Jacobi smoother with native CRS matrices.
 
integer(i4) function, public jblock_precond_cast (self, source)
 Cast oft_solver to oft_jblock_precond.
 
subroutine jblock_precond_delete (self)
 Destroy symmetric Jacobi preconditioner and deallocate all internal storage.
 
subroutine jblock_setup_xml (self, solver_node, level)
 Setup solver from XML definition.
 
recursive subroutine ml_precond_apply (self, u, g)
 Apply 1-step of a Multi-Level preconditioner.
 
integer(i4) function, public ml_precond_cast (self, source)
 Cast oft_solver to oft_ml_precond.
 
recursive subroutine ml_precond_delete (self)
 Destroy Multi-Level preconditioner and deallocate all internal storage.
 
recursive subroutine ml_precond_update (self, new_pattern)
 Update solver after changing settings/operators.
 
recursive subroutine ml_precond_view (self)
 Print solver configuration.
 
recursive subroutine ml_trans_apply (self, u, g)
 Transfer solution between distributed and shared levels as part of a ML preconditioner.
 
integer(i4) function, public ml_trans_cast (self, source)
 Cast oft_solver to oft_ml_trans.
 
subroutine ml_trans_delete (self)
 Destroy Multi-Level preconditioner and deallocate all internal storage.
 
integer(i4) function native_cg_eigsolver_cast (self, source)
 Cast oft_solver to oft_native_cg_solver.
 
integer(i4) function, public native_cg_solver_cast (self, source)
 Cast oft_solver to oft_native_cg_solver.
 
integer(i4) function, public native_gmres_solver_cast (self, source)
 Cast oft_solver to oft_native_gmres_solver.
 
subroutine nksolver_apply (self, u, g)
 Apply Newton's method to compute \( F(u) = g\).
 
subroutine nksolver_delete (self)
 Destroy Newton solver and deallocate all internal storage.
 

Function/Subroutine Documentation

◆ bjprecond_apply()

recursive subroutine bjprecond_apply ( class(oft_bjprecond), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Precondition a linear system using a Block-Jacobi method.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ bjprecond_delete()

subroutine bjprecond_delete ( class(oft_bjprecond), intent(inout)  self)
private

Destroy Block-Jacobi preconditioner and deallocate all internal storage.

◆ bjprecond_setup_xml()

subroutine bjprecond_setup_xml ( class(oft_bjprecond), intent(inout)  self,
type(fox_node), intent(in), pointer  solver_node,
integer(i4), intent(in), optional  level 
)
private

Setup solver from XML definition.

Parameters
[in]solver_nodeXML node containing solver definition
[in]levelLevel in MG hierarchy (optional)

◆ bjprecond_update()

recursive subroutine bjprecond_update ( class(oft_bjprecond), intent(inout)  self,
logical, intent(in), optional  new_pattern 
)
private

Update solver after changing settings/operators.

Parameters
[in]new_patternUpdate matrix pattern (optional)

◆ cdiag_scale_apply()

subroutine cdiag_scale_apply ( class(oft_diag_cscale), intent(inout)  self,
class(oft_cvector), intent(inout)  u,
class(oft_cvector), intent(inout)  g 
)
private

Apply diagonal scaling.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ cdiag_scale_delete()

subroutine cdiag_scale_delete ( class(oft_diag_cscale), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ cg_delete()

subroutine cg_delete ( class(oft_native_cg_solver), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ cg_eig_delete()

subroutine cg_eig_delete ( class(oft_native_cg_eigsolver), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ cg_eigsolver_apply()

subroutine cg_eigsolver_apply ( class(oft_native_cg_eigsolver), intent(inout)  self,
class(oft_vector), intent(inout)  u,
real(r8), intent(inout)  alam 
)
private

Solve a general eigenvalue system using the Conjugate-Gradient method.

This solver uses a Non-Linear Conjugate-Gradient method to minimize the Rayleigh Quotient ( \( R = \frac{x*A*x}{x*M*x} \)).

Parameters
[in,out]uGuess/Solution field
[in,out]alamEigenvalue

◆ cg_setup_xml()

subroutine cg_setup_xml ( class(oft_native_cg_solver), intent(inout)  self,
type(fox_node), intent(in), pointer  solver_node,
integer(i4), intent(in), optional  level 
)
private

Setup solver from XML definition.

Parameters
[in]solver_nodeXML node containing solver definition
[in]levelLevel in MG hierarchy (optional)

◆ cg_solver_apply()

recursive subroutine cg_solver_apply ( class(oft_native_cg_solver), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Solve a linear system using the Conjugate-Gradient method.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ cgmres_delete()

subroutine cgmres_delete ( class(oft_native_gmres_csolver), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ cgmres_setup_xml()

subroutine cgmres_setup_xml ( class(oft_native_gmres_csolver), intent(inout)  self,
type(fox_node), intent(in), pointer  solver_node,
integer(i4), intent(in), optional  level 
)
private

Setup solver from XML definition.

Parameters
[in]solver_nodeXML node containing solver definition
[in]levelLevel in MG hierarchy (optional)

◆ cgmres_solver_apply()

recursive subroutine cgmres_solver_apply ( class(oft_native_gmres_csolver), intent(inout)  self,
class(oft_cvector), intent(inout)  u,
class(oft_cvector), intent(inout)  g 
)
private

Temp doc.

Parameters
[in,out]selfTemp doc
[in,out]uTemp doc
[in,out]gTemp doc

◆ diag_scale_apply()

subroutine diag_scale_apply ( class(oft_diag_scale), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Apply diagonal scaling.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ diag_scale_cast()

integer(i4) function, public diag_scale_cast ( type(oft_diag_scale), intent(out), pointer  self,
class(oft_solver), intent(in), target  source 
)

Cast oft_solver to oft_diag_scale.

Parameters
[out]selfObject of desired type, unassociated if cast fails
[in]sourceSource object to cast
Returns
Error flag

◆ diag_scale_delete()

subroutine diag_scale_delete ( class(oft_diag_scale), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ gmres_delete()

subroutine gmres_delete ( class(oft_native_gmres_solver), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ gmres_setup_xml()

subroutine gmres_setup_xml ( class(oft_native_gmres_solver), intent(inout)  self,
type(fox_node), intent(in), pointer  solver_node,
integer(i4), intent(in), optional  level 
)
private

Setup solver from XML definition.

Parameters
[in]solver_nodeXML node containing solver definition
[in]levelLevel in MG hierarchy (optional)

◆ gmres_solver_apply()

recursive subroutine gmres_solver_apply ( class(oft_native_gmres_solver), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Temp doc.

Parameters
[in,out]selfTemp doc
[in,out]uTemp doc
[in,out]gTemp doc

◆ identity_inv_apply()

subroutine identity_inv_apply ( class(oft_identity_inv), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Solver container for trivial inverse of the identity matrix.

Note
Used for simple cases when a solver wrapper is required but the trivial case of \( u = g \) is the desired result
Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ identity_inv_delete()

subroutine identity_inv_delete ( class(oft_identity_inv), intent(inout)  self)
private

Destroy diagonal preconditioner and deallocate all internal storage.

◆ jblock_precond_apply()

subroutine jblock_precond_apply ( class(oft_jblock_precond), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Apply 1-step of a symmetric Jacobi smoother with native CRS matrices.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ jblock_precond_cast()

integer(i4) function, public jblock_precond_cast ( type(oft_jblock_precond), intent(out), pointer  self,
class(oft_solver), intent(in), target  source 
)

Cast oft_solver to oft_jblock_precond.

Parameters
[out]selfObject of desired type, unassociated if cast fails
[in]sourceSource object to cast
Returns
Error flag

◆ jblock_precond_delete()

subroutine jblock_precond_delete ( class(oft_jblock_precond), intent(inout)  self)
private

Destroy symmetric Jacobi preconditioner and deallocate all internal storage.

◆ jblock_setup_xml()

subroutine jblock_setup_xml ( class(oft_jblock_precond), intent(inout)  self,
type(fox_node), intent(in), pointer  solver_node,
integer(i4), intent(in), optional  level 
)
private

Setup solver from XML definition.

Parameters
[in]solver_nodeXML node containing solver definition
[in]levelLevel in MG hierarchy (optional)

◆ ml_precond_apply()

recursive subroutine ml_precond_apply ( class(oft_ml_precond), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Apply 1-step of a Multi-Level preconditioner.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ ml_precond_cast()

integer(i4) function, public ml_precond_cast ( class(oft_ml_precond), intent(out), pointer  self,
class(oft_solver), intent(in), target  source 
)

Cast oft_solver to oft_ml_precond.

Parameters
[out]selfObject of desired type, unassociated if cast fails
[in]sourceSource object to cast
Returns
Error flag

◆ ml_precond_delete()

recursive subroutine ml_precond_delete ( class(oft_ml_precond), intent(inout)  self)
private

Destroy Multi-Level preconditioner and deallocate all internal storage.

◆ ml_precond_update()

recursive subroutine ml_precond_update ( class(oft_ml_precond), intent(inout)  self,
logical, intent(in), optional  new_pattern 
)
private

Update solver after changing settings/operators.

◆ ml_precond_view()

recursive subroutine ml_precond_view ( class(oft_ml_precond), intent(inout)  self)
private

Print solver configuration.

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

◆ ml_trans_apply()

recursive subroutine ml_trans_apply ( class(oft_ml_trans), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Transfer solution between distributed and shared levels as part of a ML preconditioner.

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ ml_trans_cast()

integer(i4) function, public ml_trans_cast ( class(oft_ml_trans), intent(out), pointer  self,
class(oft_solver), intent(in), target  source 
)

Cast oft_solver to oft_ml_trans.

Parameters
[out]selfObject of desired type, unassociated if cast fails
[in]sourceSource object to cast
Returns
Error flag

◆ ml_trans_delete()

subroutine ml_trans_delete ( class(oft_ml_trans), intent(inout)  self)
private

Destroy Multi-Level preconditioner and deallocate all internal storage.

◆ native_cg_eigsolver_cast()

integer(i4) function native_cg_eigsolver_cast ( type(oft_native_cg_eigsolver), intent(out), pointer  self,
class(oft_eigsolver), intent(in), target  source 
)
private

Cast oft_solver to oft_native_cg_solver.

The source eigsolver must be cg_eigsolver or a child class, otherwise an error will be thrown.

Parameters
[out]selfPointer to cast cg_eigsolver
[in]sourceSource eigsolver to cast

◆ native_cg_solver_cast()

integer(i4) function, public native_cg_solver_cast ( type(oft_native_cg_solver), intent(out), pointer  self,
class(oft_solver), intent(in), target  source 
)

Cast oft_solver to oft_native_cg_solver.

The source solver must be cg_solver or a child class, otherwise an error will be thrown.

Parameters
[out]selfPointer to cast cg_solver
[in]sourceSource solver to cast

◆ native_gmres_solver_cast()

integer(i4) function, public native_gmres_solver_cast ( type(oft_native_gmres_solver), intent(out), pointer  self,
class(oft_solver), intent(in), target  source 
)

Cast oft_solver to oft_native_gmres_solver.

The source solver must be gmres_solver or a child class, otherwise an error will be thrown.

Parameters
[out]selfPointer to cast gmres_solver
[in]sourceSource solver to cast

◆ nksolver_apply()

subroutine nksolver_apply ( class(oft_nksolver), intent(inout)  self,
class(oft_vector), intent(inout)  u,
class(oft_vector), intent(inout)  g 
)
private

Apply Newton's method to compute \( F(u) = g\).

Parameters
[in,out]uGuess/Solution field
[in,out]gRHS/Residual field

◆ nksolver_delete()

subroutine nksolver_delete ( class(oft_nksolver), intent(inout)  self)
private

Destroy Newton solver and deallocate all internal storage.