namespace rgpot_tersoff_capi

Overview

C entry point for the Tersoff potential. More…

namespace rgpot_tersoff_capi {
 
// global functions
 
integer(c_int) function, public rgpot_tersoff_force(integer(c_int), intent(in), value natoms, real(c_double), dimension(3, natoms), intent(in) positions, real(c_double), dimension(3, 3), intent(in) cell, real(c_double), dimension(3, natoms), intent(out) forces, real(c_double), intent(out) energy);
integer(c_int) function, public rgpot_tersoff_force_ws(type(c_ptr), value handle, integer(c_int), intent(in), value natoms, real(c_double), dimension(3, natoms), intent(in) positions, real(c_double), dimension(3, 3), intent(in) cell, real(c_double), dimension(3, natoms), intent(out) forces, real(c_double), intent(out) energy);
 
} // namespace rgpot_tersoff_capi

Detailed Documentation

C entry point for the Tersoff potential.

Only bind(c) names leave this library; the physics module exports no external symbols of its own that C could collide with. The _ws entry point keeps the neighbour table in the caller’s workspace (rgpot_workspace), so each caller’s vesin table follows its own geometry; the entry point without a handle shares one module-level workspace and is process-serial.

Global Functions

integer(c_int) function, public rgpot_tersoff_force(integer(c_int), intent(in), value natoms, real(c_double), dimension(3, natoms), intent(in) positions, real(c_double), dimension(3, 3), intent(in) cell, real(c_double), dimension(3, natoms), intent(out) forces, real(c_double), intent(out) energy)

Evaluate Tersoff forces and energy.

positions and forces are 3 * natoms doubles, x/y/z interleaved; cell is nine doubles, row-major, one cell vector per row. Returns zero on success, non-zero on failure with the message available through rgpot_fortran_last_error.

integer(c_int) function, public rgpot_tersoff_force_ws(type(c_ptr), value handle, integer(c_int), intent(in), value natoms, real(c_double), dimension(3, natoms), intent(in) positions, real(c_double), dimension(3, 3), intent(in) cell, real(c_double), dimension(3, natoms), intent(out) forces, real(c_double), intent(out) energy)

Evaluate Tersoff forces and energy in a per-caller workspace.

positions and forces are 3 * natoms doubles, x/y/z interleaved; cell is nine doubles, row-major, one cell vector per row. Returns zero on success, non-zero on failure with the message available through rgpot_fortran_workspace_error. handle is a workspace from rgpot_fortran_workspace_new; a NULL handle returns -1.