fragment_type Derived Type

type, public :: fragment_type

generic fragment


Contents

Source Code


Components

TypeVisibilityAttributesNameInitial
integer, public :: id

fragment id

integer, public :: num_atoms

number of atoms

real(kind=dp), public :: charge

total charge

type(atom_type), public, dimension(:), pointer:: atoms

array of atoms


Type-Bound Procedures

procedure, public :: init => init_fragment

  • private subroutine init_fragment(this, id, atoms)

    intialize fragment

    Arguments

    TypeIntentOptionalAttributesName
    class(fragment_type), intent(inout) :: this
    integer, intent(in) :: id
    type(atom_type), intent(in), dimension(:), target:: atoms

procedure, public :: centroid => fragment_centroid

  • private pure function fragment_centroid(this) result(centroid)

    compute the fragment centroid

    Arguments

    TypeIntentOptionalAttributesName
    class(fragment_type), intent(in) :: this

    Return Value real(kind=dp),dimension(3)

procedure, public :: center_of_mass => fragment_center_of_mass

  • private pure function fragment_center_of_mass(this) result(center_of_mass)

    compute the fragment center-of-mass

    Arguments

    TypeIntentOptionalAttributesName
    class(fragment_type), intent(in) :: this

    Return Value real(kind=dp),dimension(3)

procedure, public :: center_of_charge => fragment_center_of_charge

  • private pure function fragment_center_of_charge(this) result(center_of_charge)

    compute the fragment center-of-charge

    Arguments

    TypeIntentOptionalAttributesName
    class(fragment_type), intent(in) :: this

    Return Value real(kind=dp),dimension(3)

Source Code

    type :: fragment_type
        private
        !> fragment id
        integer, public :: id
        !> number of atoms
        integer, public :: num_atoms
        !> total charge
        real(dp), public :: charge
        !> array of atoms
        type(atom_type), dimension(:), pointer, public :: atoms
    contains
        private
        procedure, public :: init => init_fragment
        procedure, public :: centroid => fragment_centroid
        procedure, public :: center_of_mass => fragment_center_of_mass
        procedure, public :: center_of_charge => fragment_center_of_charge
    end type fragment_type