21 USE dbcsr_api,
ONLY: dbcsr_p_type
22 #include "./base/base_uses.f90"
30 TYPE kpoint_transitional_type
32 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: ptr_1d => null()
33 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: ptr_2d => null()
34 LOGICAL :: set_as_1d = .false.
35 END TYPE kpoint_transitional_type
46 TYPE(kpoint_transitional_type) :: this
47 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: res
49 IF (
ASSOCIATED(this%ptr_1d))
THEN
50 IF (
SIZE(this%ptr_2d, 2) /= 1) &
51 cpabort(
"Method not implemented for k-points")
64 TYPE(kpoint_transitional_type) :: this
65 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: res
77 TYPE(kpoint_transitional_type) :: this
78 TYPE(dbcsr_p_type),
DIMENSION(:),
POINTER :: ptr_1d
82 IF (
ASSOCIATED(ptr_1d))
THEN
85 this%ptr_2d(1:n, 1:1) => ptr_1d
86 this%set_as_1d = .true.
100 TYPE(kpoint_transitional_type) :: this
101 TYPE(dbcsr_p_type),
DIMENSION(:, :),
POINTER :: ptr_2d
103 IF (
ASSOCIATED(ptr_2d))
THEN
104 this%ptr_1d => ptr_2d(:, 1)
105 this%ptr_2d => ptr_2d
106 this%set_as_1d = .false.
108 this%ptr_1d => null()
109 this%ptr_2d => null()
119 TYPE(kpoint_transitional_type) :: this
121 IF (
ASSOCIATED(this%ptr_1d))
THEN
122 IF (this%set_as_1d)
THEN
128 NULLIFY (this%ptr_1d, this%ptr_2d)
DBCSR operations in CP2K.
Datatype to translate between k-points (2d) and gamma-point (1d) code.
type(dbcsr_p_type) function, dimension(:), pointer, public get_1d_pointer(this)
Smart getter, raises an error when called during a k-point calculation.
type(dbcsr_p_type) function, dimension(:, :), pointer, public get_2d_pointer(this)
Simple getter, needed because of PRIVATE.
subroutine, public kpoint_transitional_release(this)
Release the matrix set, using the right pointer.
subroutine, public set_1d_pointer(this, ptr_1d)
Assigns a 1D pointer.
subroutine, public set_2d_pointer(this, ptr_2d)
Assigns a 2D pointer.