Octopus
lapl_operator_oct_m Module Reference

Computes \(y = -\Delta(x) \) and \(y = -\Delta(x) + shift x \) , suitable as an operator callback for iterative solvers (CG, QMR, etc.). More...

Detailed Description

Computes \(y = -\Delta(x) \) and \(y = -\Delta(x) + shift x \) , suitable as an operator callback for iterative solvers (CG, QMR, etc.).

Functions/Subroutines

subroutine, public zlaplacian_op (x, hx, userdata)
 Computes the negative Laplacian operator action: \( hx = -\nabla^2 x \). More...
 
subroutine, public zshifted_laplacian_op (x, lx, userdata)
 Computes the shifted Laplacian operator: \( lx = -\nabla^2 x + \sigma x \). More...
 
subroutine, public dlaplacian_op (x, hx, userdata)
 Computes the negative Laplacian operator action: \( hx = -\nabla^2 x \). More...
 
subroutine, public dshifted_laplacian_op (x, lx, userdata)
 Computes the shifted Laplacian operator: \( lx = -\nabla^2 x + \sigma x \). More...
 

Function/Subroutine Documentation

◆ zlaplacian_op()

subroutine, public lapl_operator_oct_m::zlaplacian_op ( complex(real64), dimension(:), intent(in), contiguous  x,
complex(real64), dimension(:), intent(out), contiguous  hx,
type(c_ptr), dimension(:), intent(in)  userdata 
)

Computes the negative Laplacian operator action: \( hx = -\nabla^2 x \).

This subroutine is designed as an operator callback for iterative solvers (conjugate gradients, QMR, etc.) and conforms to the zoperator_i interface defined in solvers_oct_m.

Parameters
[in]xInput vector (size: dermeshnp)
[out]hxOutput vector: \( hx = -\nabla^2 x \) (size: dermeshnp)
[in]userdataArray of C pointers with FIXED indices for passing data:
  • userdata(1): c_ptr to derivatives_t derivative with mesh information
Note
The userdata must be passed as a TARGET variable (not an expression) since c_loc requires an addressable memory location.

Definition at line 225 of file lapl_operator.F90.

◆ zshifted_laplacian_op()

subroutine, public lapl_operator_oct_m::zshifted_laplacian_op ( complex(real64), dimension(:), intent(in), contiguous  x,
complex(real64), dimension(:), intent(out), contiguous  lx,
type(c_ptr), dimension(:), intent(in)  userdata 
)

Computes the shifted Laplacian operator: \( lx = -\nabla^2 x + \sigma x \).

This subroutine implements the operator \((-\Delta + \sigma)\) where \(\sigma\) is a scalar shift parameter. It is designed as an operator callback for iterative solvers and conforms to the zoperator_i interface defined in solvers_oct_m.

Parameters
[in]xInput vector (size: dermeshnp)
[out]lxOutput vector: \( lx = -\nabla^2 x + \sigma \cdot x \) (size: dermeshnp)
[in]userdataArray of C pointers with FIXED indices for passing data:
  • userdata(1): c_ptr to derivatives_t derivative with mesh information
  • userdata(2): c_ptr to real(real64) shift parameter \(\sigma\)
  • userdata(3): c_ptr to integer prefactor which scales the entire operator
Note
The userdata must be passed as a TARGET variable (not an expression) since c_loc requires an addressable memory location.
Parameters
[in]xCurrent guess for preconditioned residual
[out]lxThe LHS product (in CG: Ax, or (\Delta - q_0^2) f_out)

Definition at line 266 of file lapl_operator.F90.

◆ dlaplacian_op()

subroutine, public lapl_operator_oct_m::dlaplacian_op ( real(real64), dimension(:), intent(in), contiguous  x,
real(real64), dimension(:), intent(out), contiguous  hx,
type(c_ptr), dimension(:), intent(in)  userdata 
)

Computes the negative Laplacian operator action: \( hx = -\nabla^2 x \).

This subroutine is designed as an operator callback for iterative solvers (conjugate gradients, QMR, etc.) and conforms to the doperator_i interface defined in solvers_oct_m.

Parameters
[in]xInput vector (size: dermeshnp)
[out]hxOutput vector: \( hx = -\nabla^2 x \) (size: dermeshnp)
[in]userdataArray of C pointers with FIXED indices for passing data:
  • userdata(1): c_ptr to derivatives_t derivative with mesh information
Note
The userdata must be passed as a TARGET variable (not an expression) since c_loc requires an addressable memory location.

Definition at line 385 of file lapl_operator.F90.

◆ dshifted_laplacian_op()

subroutine, public lapl_operator_oct_m::dshifted_laplacian_op ( real(real64), dimension(:), intent(in), contiguous  x,
real(real64), dimension(:), intent(out), contiguous  lx,
type(c_ptr), dimension(:), intent(in)  userdata 
)

Computes the shifted Laplacian operator: \( lx = -\nabla^2 x + \sigma x \).

This subroutine implements the operator \((-\Delta + \sigma)\) where \(\sigma\) is a scalar shift parameter. It is designed as an operator callback for iterative solvers and conforms to the doperator_i interface defined in solvers_oct_m.

Parameters
[in]xInput vector (size: dermeshnp)
[out]lxOutput vector: \( lx = -\nabla^2 x + \sigma \cdot x \) (size: dermeshnp)
[in]userdataArray of C pointers with FIXED indices for passing data:
  • userdata(1): c_ptr to derivatives_t derivative with mesh information
  • userdata(2): c_ptr to real(real64) shift parameter \(\sigma\)
  • userdata(3): c_ptr to integer prefactor which scales the entire operator
Note
The userdata must be passed as a TARGET variable (not an expression) since c_loc requires an addressable memory location.
Parameters
[in]xCurrent guess for preconditioned residual
[out]lxThe LHS product (in CG: Ax, or (\Delta - q_0^2) f_out)

Definition at line 426 of file lapl_operator.F90.