GBTOlib: library for evaluation of molecular integrals in mixed Gaussian / B-spline basis 111
Loading...
Searching...
No Matches
integral_storage_gbl::integral_storage_obj Module Reference

This object provides access to the results of an integral calculation. The object must be associated with the data which can be either in memory or on the disk. The association with the target is performed calling 'init' with the appropriate arguments. If the results are stored in memory then the array pointed to by the variable 'integral' must be associated with a target. If the integrals are stored on the disk then the object integral_file is used to provide access to the data. Note that neither integral_file nor integral are private variables. This is neccessary so that the integral routines can have direct (i.e. fast access) to the data. More...

Collaboration diagram for integral_storage_gbl::integral_storage_obj:

Public Member Functions

procedure init (this, memory, disk)
 This routines initializes the object. Depending on whether the pointer to the output array or a file name are given on input the variable 'integral' or 'integral_file' is set. The routine returns 0 on successful initialization. Non-zero result means an error.
procedure final (this)
 This routine restores the state of the object to the default state, i.e. if the storage is in memory it nullifies the association of the 'integral' pointer. If the storage is on disk then the integral file is closed.
procedure check (this)
 This function checks if the data have meaningful values.
procedure, non_overridable read (this, src, header, tgt_int_opt, tgt_is_local)
 This routine reads into memory the integrals with the given header and the integral options from the integral_storage_obj given. There is a good reason why the integral file is not given directly but via the integral_storage_obj - see the object description. Note that by default the integral arrays are read-in using the shared-memory feature so in the MPI mode there will be only one copy of the integral array PER NODE. If the shared-memory capability is not available then the code will resort to the local mode where each MPI task keeps its own copy of the integral array.
procedure, non_overridable write (this, src, header, src_int_opt)
 This routine writes the integrals and the integral options to the disk. There is a good reason why the path to the integral file is not given directly as an argument but indirectly via the integral_storage_obj - see the object description.
procedure, non_overridable in_memory (this)
 Returns the value of 'memory'.
procedure, non_overridable on_disk (this)
 Returns the value of 'disk'.
procedure, non_overridable contruct_header_string (this, basis_name, integral_name)
 Given the string defining a basis set and a string defining the integral type it returns a single string which merges these two together without additional spaces in between.

Public Attributes

type(data_file_objintegral_file
 Object used to manage access to the data stored on the disk.
class(p2d_array_obj), pointer integral => null()
 Pointer to the array where the integrals are stored. The second dimension is used to distinguish integrals of different type. E.g. we usually calculate the overlap and the kinetic energy integrals at once, so the first column may be used for the overlap integrals, while the second one for the kinetic energy ones.
type(data_header_objdata_header
 Header for the data stored in memory.

Detailed Description

This object provides access to the results of an integral calculation. The object must be associated with the data which can be either in memory or on the disk. The association with the target is performed calling 'init' with the appropriate arguments. If the results are stored in memory then the array pointed to by the variable 'integral' must be associated with a target. If the integrals are stored on the disk then the object integral_file is used to provide access to the data. Note that neither integral_file nor integral are private variables. This is neccessary so that the integral routines can have direct (i.e. fast access) to the data.

Warning
The type-bound methods which require on input/output an integral file (or integrals in memory) should always pass the reference to this file (memory location) via the integral_storage_obj associated with this file (memory). The file name or integral array for input/output should never be passed directly to the methods. The reason is that the input/output may be associated with another integral_storage_obj. Modifying the file (memory) without involving the associated integral_storage_obj in the process can result in the associated integral_storage_obj getting confused at some point or even corrupting the data on the file! In any case it is strongly reccommended that all interaction with the stored data is performed implementing or extending type-bound methods for this object rather than accessing the disk file directly.

Member Function/Subroutine Documentation

◆ check()

procedure integral_storage_gbl::integral_storage_obj::check ( class(integral_storage_obj) this)

This function checks if the data have meaningful values.

◆ contruct_header_string()

procedure, non_overridable integral_storage_gbl::integral_storage_obj::contruct_header_string ( class(integral_storage_obj) this,
character(len=*), intent(in) basis_name,
character(len=*), intent(in) integral_name )
final

Given the string defining a basis set and a string defining the integral type it returns a single string which merges these two together without additional spaces in between.

◆ final()

procedure integral_storage_gbl::integral_storage_obj::final ( class(integral_storage_obj) this)

This routine restores the state of the object to the default state, i.e. if the storage is in memory it nullifies the association of the 'integral' pointer. If the storage is on disk then the integral file is closed.

◆ in_memory()

procedure, non_overridable integral_storage_gbl::integral_storage_obj::in_memory ( class(integral_storage_obj) this)
final

Returns the value of 'memory'.

◆ init()

procedure integral_storage_gbl::integral_storage_obj::init ( class(integral_storage_obj) this,
class(p2d_array_obj), intent(in), optional, target memory,
character(len=*), intent(in), optional disk )

This routines initializes the object. Depending on whether the pointer to the output array or a file name are given on input the variable 'integral' or 'integral_file' is set. The routine returns 0 on successful initialization. Non-zero result means an error.

◆ on_disk()

procedure, non_overridable integral_storage_gbl::integral_storage_obj::on_disk ( class(integral_storage_obj) this)
final

Returns the value of 'disk'.

◆ read()

procedure, non_overridable integral_storage_gbl::integral_storage_obj::read ( class(integral_storage_obj) this,
class(integral_storage_obj), intent(in) src,
character(len=*), intent(in) header,
class(integral_options_obj), intent(out) tgt_int_opt,
logical, intent(in) tgt_is_local )
final

This routine reads into memory the integrals with the given header and the integral options from the integral_storage_obj given. There is a good reason why the integral file is not given directly but via the integral_storage_obj - see the object description. Note that by default the integral arrays are read-in using the shared-memory feature so in the MPI mode there will be only one copy of the integral array PER NODE. If the shared-memory capability is not available then the code will resort to the local mode where each MPI task keeps its own copy of the integral array.

◆ write()

procedure, non_overridable integral_storage_gbl::integral_storage_obj::write ( class(integral_storage_obj) this,
class(integral_storage_obj), intent(in) src,
character(len=*), intent(in) header,
class(integral_options_obj), intent(in) src_int_opt )
final

This routine writes the integrals and the integral options to the disk. There is a good reason why the path to the integral file is not given directly as an argument but indirectly via the integral_storage_obj - see the object description.

Member Data Documentation

◆ data_header

type(data_header_obj) integral_storage_gbl::integral_storage_obj::data_header

Header for the data stored in memory.

◆ integral

class(p2d_array_obj), pointer integral_storage_gbl::integral_storage_obj::integral => null()

Pointer to the array where the integrals are stored. The second dimension is used to distinguish integrals of different type. E.g. we usually calculate the overlap and the kinetic energy integrals at once, so the first column may be used for the overlap integrals, while the second one for the kinetic energy ones.

◆ integral_file

type(data_file_obj) integral_storage_gbl::integral_storage_obj::integral_file

Object used to manage access to the data stored on the disk.


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