(git:42db5d2)
Loading...
Searching...
No Matches
libcp2k Module Reference

CP2K C/C++ interface. More...

Functions/Subroutines

subroutine, public cp2k_get_version (version_str, str_length)
 ...
 
subroutine, public cp2k_init ()
 ...
 
subroutine, public cp2k_init_without_mpi ()
 ...
 
subroutine, public cp2k_init_without_mpi_comm (mpi_comm)
 ...
 
subroutine, public cp2k_finalize ()
 ...
 
subroutine, public cp2k_finalize_without_mpi ()
 ...
 
subroutine, public cp2k_create_force_env (new_env_id, input_file_path, output_file_path)
 ...
 
subroutine, public cp2k_create_force_env_comm (new_env_id, input_file_path, output_file_path, mpi_comm)
 ...
 
subroutine, public cp2k_destroy_force_env (env_id)
 ...
 
subroutine, public cp2k_set_positions (env_id, new_pos, n_el)
 ...
 
subroutine, public cp2k_set_velocities (env_id, new_vel, n_el)
 ...
 
subroutine, public cp2k_set_cell (env_id, new_cell)
 ...
 
subroutine, public cp2k_get_result (env_id, description, result, n_el)
 ...
 
subroutine, public cp2k_get_natom (env_id, natom)
 ...
 
subroutine, public cp2k_get_nparticle (env_id, nparticle)
 ...
 
subroutine, public cp2k_get_positions (env_id, pos, n_el)
 ...
 
subroutine, public cp2k_get_forces (env_id, force, n_el)
 ...
 
subroutine, public cp2k_get_potential_energy (env_id, e_pot)
 ...
 
subroutine, public cp2k_get_cell (env_id, cell)
 ...
 
subroutine, public cp2k_get_qmmm_cell (env_id, cell)
 ...
 
subroutine, public cp2k_calc_energy_force (env_id)
 ...
 
subroutine, public cp2k_calc_energy (env_id)
 ...
 
subroutine, public cp2k_run_input (input_file_path, output_file_path)
 ...
 
subroutine, public cp2k_run_input_comm (input_file_path, output_file_path, mpi_comm)
 ...
 
subroutine, public cp2k_transport_set_callback (f_env_id, func_ptr)
 Gets a function pointer pointing to a routine defined in C/C++ and passes it to the transport environment in force environment.
 
integer(c_int) function, public cp2k_active_space_get_mo_count (f_env_id)
 Get the number of molecular orbitals.
 
integer(c_long) function, public cp2k_active_space_get_fock_sub (f_env_id, buf, buf_len)
 Get the active space Fock sub-matrix (as a full matrix)
 
integer(c_long) function, public cp2k_active_space_get_eri_nze_count (f_env_id)
 Get the number of non-zero elements of the ERI.
 
integer(c_long) function, public cp2k_active_space_get_eri (f_env_id, buf_coords, buf_coords_len, buf_values, buf_values_len)
 Get the electron repulsion integrals (as a sparse tensor)
 

Detailed Description

CP2K C/C++ interface.

History
12.2012 created [Hossein Bani-Hashemian] 04.2016 restructured [Hossein Bani-Hashemian, Ole Schuett] 03.2018 added Active Space functions [Tiziano Mueller]
Author
Mohammad Hossein Bani-Hashemian

Function/Subroutine Documentation

◆ cp2k_get_version()

subroutine, public libcp2k::cp2k_get_version ( character(len=1, kind=c_char), dimension(*), intent(out)  version_str,
integer(c_int), value  str_length 
)

...

Parameters
version_str...
str_length...

Definition at line 78 of file libcp2k.F.

◆ cp2k_init()

subroutine, public libcp2k::cp2k_init ( void  )

...

Definition at line 98 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_init_without_mpi()

subroutine, public libcp2k::cp2k_init_without_mpi ( void  )

...

Definition at line 108 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_init_without_mpi_comm()

subroutine, public libcp2k::cp2k_init_without_mpi_comm ( integer(c_int), value  mpi_comm)

...

Parameters
mpi_comm...

Definition at line 119 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_finalize()

subroutine, public libcp2k::cp2k_finalize ( void  )

...

Definition at line 133 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_finalize_without_mpi()

subroutine, public libcp2k::cp2k_finalize_without_mpi ( void  )

...

Definition at line 143 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_create_force_env()

subroutine, public libcp2k::cp2k_create_force_env ( integer(c_int), intent(out)  new_env_id,
character(len=1, kind=c_char), dimension(*), intent(in)  input_file_path,
character(len=1, kind=c_char), dimension(*), intent(in)  output_file_path 
)

...

Parameters
new_env_id...
input_file_path...
output_file_path...

Definition at line 156 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_create_force_env_comm()

subroutine, public libcp2k::cp2k_create_force_env_comm ( integer(c_int), intent(out)  new_env_id,
character(len=1, kind=c_char), dimension(*), intent(in)  input_file_path,
character(len=1, kind=c_char), dimension(*), intent(in)  output_file_path,
integer(c_int), value  mpi_comm 
)

...

Parameters
new_env_id...
input_file_path...
output_file_path...
mpi_comm...

Definition at line 182 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_destroy_force_env()

subroutine, public libcp2k::cp2k_destroy_force_env ( integer(c_int), value  env_id)

...

Parameters
env_id...

Definition at line 208 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_set_positions()

subroutine, public libcp2k::cp2k_set_positions ( integer(c_int), value  env_id,
real(c_double), dimension(1:n_el), intent(in)  new_pos,
integer(c_int), value  n_el 
)

...

Parameters
env_id...
new_pos...
n_el...

Definition at line 223 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_set_velocities()

subroutine, public libcp2k::cp2k_set_velocities ( integer(c_int), value  env_id,
real(c_double), dimension(1:n_el), intent(in)  new_vel,
integer(c_int), value  n_el 
)

...

Parameters
env_id...
new_vel...
n_el...

Definition at line 239 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_set_cell()

subroutine, public libcp2k::cp2k_set_cell ( integer(c_int), value  env_id,
real(c_double), dimension(3, 3), intent(in)  new_cell 
)

...

Parameters
env_id...
new_cell...

Definition at line 254 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_result()

subroutine, public libcp2k::cp2k_get_result ( integer(c_int), value  env_id,
character(len=1, kind=c_char), dimension(*), intent(in)  description,
real(c_double), dimension(1:n_el), intent(out)  result,
integer(c_int), value  n_el 
)

...

Parameters
env_id...
description...
RESULT...
n_el...

Definition at line 271 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_natom()

subroutine, public libcp2k::cp2k_get_natom ( integer(c_int), value  env_id,
integer(c_int), intent(out)  natom 
)

...

Parameters
env_id...
natom...

Definition at line 292 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_nparticle()

subroutine, public libcp2k::cp2k_get_nparticle ( integer(c_int), value  env_id,
integer(c_int), intent(out)  nparticle 
)

...

Parameters
env_id...
nparticle...

Definition at line 307 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_positions()

subroutine, public libcp2k::cp2k_get_positions ( integer(c_int), value  env_id,
real(c_double), dimension(1:n_el), intent(out)  pos,
integer(c_int), value  n_el 
)

...

Parameters
env_id...
pos...
n_el...

Definition at line 323 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_forces()

subroutine, public libcp2k::cp2k_get_forces ( integer(c_int), value  env_id,
real(c_double), dimension(1:n_el), intent(out)  force,
integer(c_int), value  n_el 
)

...

Parameters
env_id...
force...
n_el...

Definition at line 339 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_potential_energy()

subroutine, public libcp2k::cp2k_get_potential_energy ( integer(c_int), value  env_id,
real(c_double), intent(out)  e_pot 
)

...

Parameters
env_id...
e_pot...

Definition at line 354 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_cell()

subroutine, public libcp2k::cp2k_get_cell ( integer(c_int), value  env_id,
real(c_double), dimension(3, 3), intent(out)  cell 
)

...

Parameters
env_id...
cell...

Definition at line 369 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_get_qmmm_cell()

subroutine, public libcp2k::cp2k_get_qmmm_cell ( integer(c_int), value  env_id,
real(c_double), dimension(3, 3), intent(out)  cell 
)

...

Parameters
env_id...
cell...

Definition at line 384 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_calc_energy_force()

subroutine, public libcp2k::cp2k_calc_energy_force ( integer(c_int), value  env_id)

...

Parameters
env_id...

Definition at line 398 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_calc_energy()

subroutine, public libcp2k::cp2k_calc_energy ( integer(c_int), value  env_id)

...

Parameters
env_id...

Definition at line 411 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_run_input()

subroutine, public libcp2k::cp2k_run_input ( character(len=1, kind=c_char), dimension(*), intent(in)  input_file_path,
character(len=1, kind=c_char), dimension(*), intent(in)  output_file_path 
)

...

Parameters
input_file_path...
output_file_path...

Definition at line 425 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_run_input_comm()

subroutine, public libcp2k::cp2k_run_input_comm ( character(len=1, kind=c_char), dimension(*), intent(in)  input_file_path,
character(len=1, kind=c_char), dimension(*), intent(in)  output_file_path,
integer(c_int), value  mpi_comm 
)

...

Parameters
input_file_path...
output_file_path...
mpi_comm...

Definition at line 448 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_transport_set_callback()

subroutine, public libcp2k::cp2k_transport_set_callback ( integer(c_int), value  f_env_id,
type(c_funptr), value  func_ptr 
)

Gets a function pointer pointing to a routine defined in C/C++ and passes it to the transport environment in force environment.

Parameters
f_env_idthe force env id
func_ptrthe function pointer
History
12.2012 created [Hossein Bani-Hashemian]
Author
Mohammad Hossein Bani-Hashemian

Definition at line 477 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_active_space_get_mo_count()

integer(c_int) function, public libcp2k::cp2k_active_space_get_mo_count ( integer(c_int), value  f_env_id)

Get the number of molecular orbitals.

Parameters
f_env_idthe force env id
Returns
The number of elements or -1 if unavailable
Author
Tiziano Mueller

Definition at line 500 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_active_space_get_fock_sub()

integer(c_long) function, public libcp2k::cp2k_active_space_get_fock_sub ( integer(c_int), value  f_env_id,
real(c_double), dimension(0:buf_len-1), intent(out)  buf,
integer(c_long), value  buf_len 
)

Get the active space Fock sub-matrix (as a full matrix)

Parameters
f_env_idthe force env id
bufC array to write the data to
buf_lenThe length of the C array to write the data to (must be at least mo_count^2)
Returns
The number of elements written or -1 if unavailable or buffer too small
Author
Tiziano Mueller

Definition at line 537 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_active_space_get_eri_nze_count()

integer(c_long) function, public libcp2k::cp2k_active_space_get_eri_nze_count ( integer(c_int), value  f_env_id)

Get the number of non-zero elements of the ERI.

Parameters
f_env_idthe force env id
Returns
The number of elements or -1 if unavailable
Author
Tiziano Mueller

Definition at line 591 of file libcp2k.F.

Here is the call graph for this function:

◆ cp2k_active_space_get_eri()

integer(c_long) function, public libcp2k::cp2k_active_space_get_eri ( integer(c_int), intent(in), value  f_env_id,
integer(c_int), dimension(1:buf_coords_len), intent(out), target  buf_coords,
integer(c_long), intent(in), value  buf_coords_len,
real(c_double), dimension(1:buf_values_len), intent(out), target  buf_values,
integer(c_long), intent(in), value  buf_values_len 
)

Get the electron repulsion integrals (as a sparse tensor)

Parameters
f_env_idthe force env id
buf_coordsC array to write the indizes (i,j,k,l) to
buf_coords_lensize of the buffer, must be at least 4*nze_count
buf_valuesC array to write the values to
buf_values_lensize of the buffer, must be at least nze_count
Returns
The number of elements written or -1 if unavailable or buffer too small
Author
Tiziano Mueller

Definition at line 629 of file libcp2k.F.

Here is the call graph for this function: