Loading...
Searching...
No Matches
gpridge::atomsconfig Interface Reference

Atomic configuration for GP kernel (wraps opaque C handle). More...

Public Member Functions

procedure n_moving (self)
procedure n_pairtypes (self)
procedure is_valid (self)
procedure get_handle (self)
procedure release (self)
generic, public assignment assign
final atoms_finalize (self)
type(atomsconfig) function atoms_constructor (n_atoms, is_frozen, atom_types, atomic_nrs, positions, actdist_fro, stat, errmsg)
 Atoms configuration of n_atoms atoms. Without the optional arrays the atoms are identical and all move. is_frozen marks fixed atoms, atom_types gives dense type indices (0, 1, ...) for the kernel's pair types, atomic_nrs the atomic numbers, positions (3*n_atoms) the reference positions, and actdist_fro the radius within which frozen atoms enter the GP kernel of the GP NEB searches (0: 30.3 Angstrom). A failure returns an invalid handle, with stat and errmsg as in the intrinsic statements.

Public Attributes

integer, pointer references => null()

Detailed Description

Atomic configuration for GP kernel (wraps opaque C handle).

Definition at line 2363 of file gpridge.f90.

Constructor & Destructor Documentation

◆ atoms_finalize()

final gpridge::atomsconfig::atoms_finalize ( type(atomsconfig), intent(inout) self)
final

Definition at line 2375 of file gpridge.f90.

Member Function/Subroutine Documentation

◆ assignment()

generic, public gpridge::atomsconfig::assignment

Definition at line 2374 of file gpridge.f90.

◆ atoms_constructor()

type(atomsconfig) function gpridge::atomsconfig::atoms_constructor ( integer, intent(in) n_atoms,
logical, dimension(:), intent(in), optional is_frozen,
integer, dimension(:), intent(in), optional atom_types,
integer, dimension(:), intent(in), optional atomic_nrs,
real(c_double), dimension(:), intent(in), optional positions,
real(c_double), intent(in), optional actdist_fro,
integer, intent(out), optional stat,
character(len=*), intent(inout), optional errmsg )

Atoms configuration of n_atoms atoms. Without the optional arrays the atoms are identical and all move. is_frozen marks fixed atoms, atom_types gives dense type indices (0, 1, ...) for the kernel's pair types, atomic_nrs the atomic numbers, positions (3*n_atoms) the reference positions, and actdist_fro the radius within which frozen atoms enter the GP kernel of the GP NEB searches (0: 30.3 Angstrom). A failure returns an invalid handle, with stat and errmsg as in the intrinsic statements.

Definition at line 2930 of file gpridge.f90.

2932 integer, intent(in) :: n_atoms
2933 logical, intent(in), optional :: is_frozen(:)
2934 integer, intent(in), optional :: atom_types(:), atomic_nrs(:)
2935 real(c_double), intent(in), optional :: positions(:)
2936 real(c_double), intent(in), optional :: actdist_fro
2937 integer, intent(out), optional :: stat
2938 character(len=*), intent(inout), optional :: errmsg
2939 type(AtomsConfig) :: self
2940 type(AtomsDescriptor) :: descriptor
2941 integer(c_int), allocatable, target :: frozen_c(:), types_c(:), z_c(:)
2942 real(c_double), allocatable, target :: positions_c(:)
2943 integer(c_int) :: rc
2944
2945 if (.not. (present(is_frozen) .or. present(atom_types) .or. &
2946 present(atomic_nrs) .or. present(positions) .or. &
2947 present(actdist_fro))) then
2948 self%handle = c_gpr_atoms_create_simple(int(n_atoms, c_int))
2949 else
2950 descriptor%n_atoms_total = int(n_atoms, c_int)
2951 if (present(is_frozen)) then
2952 if (size(is_frozen) /= n_atoms) then
2953 call report_status(gpr_err_invalid_arg, stat, errmsg, &
2954 'AtomsConfig: is_frozen needs n_atoms entries')
2955 return
2956 end if
2957 allocate(frozen_c(n_atoms))
2958 frozen_c = merge(1_c_int, 0_c_int, is_frozen)
2959 descriptor%is_frozen = c_loc(frozen_c)
2960 end if
2961 if (present(atom_types)) then
2962 if (size(atom_types) /= n_atoms) then
2963 call report_status(gpr_err_invalid_arg, stat, errmsg, &
2964 'AtomsConfig: atom_types needs n_atoms entries')
2965 return
2966 end if
2967 types_c = int(atom_types, c_int)
2968 descriptor%atom_types = c_loc(types_c)
2969 end if
2970 if (present(atomic_nrs)) then
2971 if (size(atomic_nrs) /= n_atoms) then
2972 call report_status(gpr_err_invalid_arg, stat, errmsg, &
2973 'AtomsConfig: atomic_nrs needs n_atoms entries')
2974 return
2975 end if
2976 z_c = int(atomic_nrs, c_int)
2977 descriptor%atomic_nrs = c_loc(z_c)
2978 end if
2979 if (present(positions)) then
2980 if (size(positions) /= 3 * n_atoms) then
2981 call report_status(gpr_err_invalid_arg, stat, errmsg, &
2982 'AtomsConfig: positions needs 3*n_atoms entries')
2983 return
2984 end if
2985 positions_c = positions
2986 descriptor%positions = c_loc(positions_c)
2987 end if
2988 if (present(actdist_fro)) descriptor%actdist_fro = actdist_fro
2989 self%handle = c_gpr_atoms_create(descriptor)
2990 end if
2991 if (c_associated(self%handle)) then
2992 allocate(self%references, source=1)
2993 rc = gpr_success
2994 else
2995 rc = failed_status()
2996 end if
2997 call report_status(rc, stat, errmsg)

◆ get_handle()

procedure gpridge::atomsconfig::get_handle ( class(atomsconfig), intent(in) self)

Definition at line 2371 of file gpridge.f90.

◆ is_valid()

procedure gpridge::atomsconfig::is_valid ( class(atomsconfig), intent(in) self)

Definition at line 2370 of file gpridge.f90.

◆ n_moving()

procedure gpridge::atomsconfig::n_moving ( class(atomsconfig), intent(in) self)

Definition at line 2368 of file gpridge.f90.

◆ n_pairtypes()

procedure gpridge::atomsconfig::n_pairtypes ( class(atomsconfig), intent(in) self)

Definition at line 2369 of file gpridge.f90.

◆ release()

procedure gpridge::atomsconfig::release ( class(atomsconfig), intent(inout) self)

Definition at line 2372 of file gpridge.f90.

Member Data Documentation

◆ references

integer, pointer gpridge::atomsconfig::references => null()

Definition at line 2366 of file gpridge.f90.

2366 integer, pointer :: references => null()

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