dense_lMat_t Derived Type

type, public, extends(lMat_t) :: dense_lMat_t

Implementation for densely stored 6-index objects


Components

Type Visibility Attributes Name Initial
procedure(lMatInd_t), public, nopass, pointer :: indexFunc => lMatIndSym
type(shared_array_real_t), private :: lMat_vals

Type-Bound Procedures

procedure, public :: read

  • private subroutine read(this, filename)

    Read in the 6-index integrals from disk and histogram the integrals. The file itself only has to store the nonzero integrals, either in ASCII or in HDF5 format. For conventions in the HDF5 format, please refer to the developer’s guide.

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(inout) :: this
    character(len=*), intent(in) :: filename

    name of the integrals file

procedure, public :: lMat_size

  • private function lMat_size(this) result(size)

    Return the max. index appearing in this lMat_t (i.e. the number of 6-index integrals)

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(in) :: this

    Return Value integer(kind=int64)

procedure, public :: histogram_lMat

  • private subroutine histogram_lMat(this)

    Generate a histogram of the 6-index integrals and write it to stdout

    Arguments

    Type IntentOptional Attributes Name
    class(lMat_t), intent(in) :: this

procedure, public :: get_elem => get_elem_dense

  • private function get_elem_dense(this, index) result(element)

    Get an element of the 6-index integrals from the densely stored container

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(in) :: this
    integer(kind=int64), intent(in) :: index

    position of the element

    Return Value real(kind=dp)

procedure, private :: set_elem => set_elem_dense

  • private subroutine set_elem_dense(this, index, element)

    Set an element in the dense 6-index integrals to a new value

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: index

    position of the element

    real(kind=dp), intent(in) :: element

    new value of the element

procedure, public :: alloc => alloc_dense

  • private subroutine alloc_dense(this, size)

    Allocate the 6-index integrals for the dense storage

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(inout) :: this
    integer(kind=int64), intent(in) :: size

    size of the integral container to be allocated

procedure, public :: safe_dealloc => dealloc_dense

  • private subroutine dealloc_dense(this)

    Deallocate the 6-index integrals (dense)

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(inout) :: this

procedure, private :: read_kernel => read_dense

  • private subroutine read_dense(this, filename)

    Read the 6-index integrals from a file to dense format

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(inout) :: this
    character(len=*), intent(in) :: filename

    name of the file to read from

procedure, private :: read_hdf5_dense

  • private subroutine read_hdf5_dense(this, filename)

    Read the integrals from an hdf5 file to dense format

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(inout) :: this
    character(len=*), intent(in) :: filename

    name of the file to read from

procedure, private :: read_op_hdf5 => read_op_dense_hdf5

  • private subroutine read_op_dense_hdf5(this, indices, entries)

    This is the operation to be performed on each block of data read from an hdf5 file both arguments may or may not be still allocated upon return

    Arguments

    Type IntentOptional Attributes Name
    class(dense_lMat_t), intent(inout) :: this
    integer(kind=int64), intent(inout), allocatable :: indices(:,:)
    integer(kind=int64), intent(inout), allocatable :: entries(:,:)

Source Code

    type, extends(lMat_t) :: dense_lMat_t
        private
        ! The values of the integrals
#ifdef CMPLX_
        type(shared_array_cmplx_t) :: lMat_vals
#else
        type(shared_array_real_t) :: lMat_vals
#endif
    contains
        ! Element getters/setters
        procedure :: get_elem => get_elem_dense
        procedure, private :: set_elem => set_elem_dense

        ! Allocation routines
        procedure :: alloc => alloc_dense
        procedure :: safe_dealloc => dealloc_dense

        ! I/O routines
        procedure, private :: read_kernel => read_dense
        procedure, private :: read_hdf5_dense
        procedure, private :: read_op_hdf5 => read_op_dense_hdf5
    end type dense_lMat_t