chfl_atom
type¶
- type chfl_atom¶
A
chfl_atom
is a particle in the currentchfl_frame
.All atoms have an atomic name; an atomic type; an atomic mass and an atomic charge.
The atomic name is usually an unique identifier (
H1
,C_a
) while the atomic type will be shared between all particles of the same type:H
,Ow
,CH3
.- Type fields:
% init [subroutine] ::
chfl_atom%init()
% copy [subroutine] ::
chfl_atom%copy()
% mass [function] ::
chfl_atom%mass()
% set_mass [subroutine] ::
chfl_atom%set_mass()
% charge [function] ::
chfl_atom%charge()
% set_charge [subroutine] ::
chfl_atom%set_charge()
% type [function] ::
chfl_atom%type()
% set_type [subroutine] ::
chfl_atom%set_type()
% name [function] ::
chfl_atom%name()
% set_name [subroutine] ::
chfl_atom%set_name()
% full_name [function] ::
chfl_atom%full_name()
% vdw_radius [function] ::
chfl_atom%vdw_radius()
% covalent_radius [function] ::
chfl_atom%covalent_radius()
% atomic_number [function] ::
chfl_atom%atomic_number()
% set [subroutine] ::
chfl_atom%set()
% get [subroutine] ::
chfl_atom%get()
% properties_count [function] ::
chfl_atom%properties_count()
% list_properties [function] ::
chfl_atom%list_properties()
% free [subroutine] ::
chfl_atom%free()
- subroutine chfl_atom%init(name[, status])¶
Initialize this atom with the given
name
, and set the atom type toname
. This subroutine allocate memory which must be released withchfl_atom%free()
.- Parameters:
name [character(len=*)] :: atom name
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%copy(atom[, status])¶
Initialize this atom with a copy of
atom
. This subroutine allocate memory which must be released withchfl_atom%free()
.- Parameters:
atom [type(chfl_atom)] :: atom to copy
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%mass([status])¶
Get the mass of the atom in atomic mass units.
- Return:
real
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%set_mass(mass[, status])¶
Set the mass of the atom to
mass
. The value should be in atomic mass units.- Parameters:
mass [real] :: new atom mass
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%charge([status])¶
Get the charge of the atom in number of the electron charge e.
- Return:
real
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%set_charge(charge[, status])¶
Set the charge of the atom to
charge
. The charge should be in number of the electron charge e.- Parameters:
charge [real] :: new atom charge
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%name([status])¶
Get the name of an atom. If the name is longer than
CHFL_STRING_LENGTH
, it will be truncated.- Return:
character (len=CHFL_STRING_LENGTH)
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%set_name(name[, status])¶
Set the name of an atom to
name
.- Parameters:
name [character(len=*)] :: new atom name
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%full_name([status])¶
Get the full name of an
atom
from its type. If the name is longer thanCHFL_STRING_LENGTH
, it will be truncated.- Return:
character (len=CHFL_STRING_LENGTH)
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%type([status])¶
Get the type of an atom. If the name is longer than
CHFL_STRING_LENGTH
, it will be truncated.- Return:
character (len=CHFL_STRING_LENGTH)
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%set_type(type[, status])¶
Set the type of an atom to
type
.- Parameters:
name [character(len=*)] :: new atom type
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%vdw_radius([status])¶
Get the Van der Waals radius of an atom from the atom type. If the radius in unknown, this function returns 0.
- Return:
real
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%covalent_radius([status])¶
Get the covalent radius of an atom from the atom type. If the radius in unknown, this function set
radius
to 0.- Return:
real
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%atomic_number([status])¶
Get the atomic number of an atom from the atom type. If the atomic number in unknown, this function set
number
to 0.- Parameters:
integer
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%set(name, property[, status])¶
Add a new
property
with the givenname
to this atom.If a property with the same name already exists, this function override the existing property with the new one.
property
can either be achfl_property
, or any value that can be stored in achfl_property
: logical, real, string, or vector3d.- Parameters:
name [character(len=*)] :: property name
property [type(chfl_property)] :: the new property
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%get(name[, status])¶
Get a copy of the property with the given
name
in this atom. If no property exist with this name,status
will be set toCHFL_PROPERTY_ERROR
.The associated memory must be released by calling
chfl_property%free()
.- Return:
type (chfl_property)
- Parameters:
name [character(len=*)] :: property name
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- function chfl_atom%properties_count([status])¶
Get the number of properties in this atom.
- Return:
integer
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%list_properties(names[, status])¶
Fill the pre-allocated array
names
with the names of the properties in this atom. The array must have room forchfl_atom%properties_count()
values of typecharacter(len=CHFL_STRING_LENGTH)
.- Return:
integer
- Parameters:
names (:) [character(len=CHFL_STRING_LENGTH)] :: list of properties names
- Options:
status [integer(chfl_status)] :: status code of the operation. If it is not
CHFL_SUCCESS
, usechfl_last_error()
to learn more about the error.
- subroutine chfl_atom%free()¶
Destroy an atom, and free the associated memory