Physical molecular fragment representation and geometry handling
Provides data structures and utilities for managing molecular fragments with atomic coordinates, electronic properties, and geometric operations. Bond connectivity type Single molecular fragment type Complete system geometry type System geometry initialization Extract fragment from system Build fragment from explicit atom indices (for intersections) Validate fragment has no overlapping atoms
Redistribute hydrogen cap gradients to original atoms Redistribute hydrogen cap Hessian to original atoms Redistribute hydrogen cap dipole derivatives to original atoms Unit conversion utilities Calculate minimal distance between monomers in a fragment
Bond definition with atom indices, order, and broken status
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | atom_i | = | 0 |
First atom index (0-indexed) |
|
| integer, | public | :: | atom_j | = | 0 |
Second atom index (0-indexed) |
|
| logical, | public | :: | is_broken | = | .false. |
Whether this bond crosses fragment boundaries |
|
| integer, | public | :: | order | = | 1 |
Bond order (1=single, 2=double, 3=triple) |
Physical molecular fragment with atomic coordinates and properties
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(molecular_basis_type), | public, | allocatable | :: | basis |
Gaussian basis functions |
||
| integer, | public, | allocatable | :: | cap_replaces_atom(:) |
Original atom index that each cap replaces (size: n_caps) |
||
| integer, | public | :: | charge | = | 0 |
Net molecular charge (electrons) |
|
| real(kind=dp), | public, | allocatable | :: | coordinates(:,:) |
Cartesian coordinates (3, n_atoms) in Bohr |
||
| real(kind=dp), | public | :: | distance | = | 0.0_dp |
Minimal atomic distance between monomers in fragment (Angstrom, 0 for monomers) |
|
| integer, | public, | allocatable | :: | element_numbers(:) |
Atomic numbers (Z values) |
||
| integer, | public, | allocatable | :: | local_to_global(:) |
Map fragment atom index to system atom index (size: n_atoms - n_caps) |
||
| integer, | public | :: | multiplicity | = | 1 |
Spin multiplicity (2S+1) |
|
| integer, | public | :: | n_atoms |
Number of atoms in this fragment |
|||
| integer, | public | :: | n_caps | = | 0 |
Number of hydrogen caps added (always at end of atom list) |
|
| integer, | public | :: | nelec | = | 0 |
Total number of electrons |
| procedure, public :: compute_nelec => fragment_compute_nelec | Calculate electron count |
| procedure, public :: destroy => fragment_destroy | Memory cleanup |
| procedure, public :: set_basis => fragment_set_basis | Assign basis set |
Complete molecular system geometry for fragment-based calculations
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | atoms_per_monomer |
Atoms in each monomer (0 if variable-sized) |
|||
| type(bond_t), | public, | allocatable | :: | bonds(:) |
Bond connectivity (for H-capping broken bonds) |
||
| integer, | public | :: | charge |
Net molecular charge (electrons) |
|||
| real(kind=dp), | public, | allocatable | :: | coordinates(:,:) |
All coordinates (3, total_atoms) in Bohr |
||
| integer, | public, | allocatable | :: | element_numbers(:) |
Atomic numbers for all atoms |
||
| integer, | public, | allocatable | :: | fragment_atoms(:,:) |
Atom indices for each fragment (max_frag_size, n_monomers), 0-indexed |
||
| integer, | public, | allocatable | :: | fragment_charges(:) |
Charge for each fragment (n_monomers) |
||
| integer, | public, | allocatable | :: | fragment_multiplicities(:) |
Multiplicity for each fragment (n_monomers) |
||
| integer, | public, | allocatable | :: | fragment_sizes(:) |
Number of atoms in each fragment (n_monomers) |
||
| integer, | public | :: | multiplicity |
Spin multiplicity (2S+1) |
|||
| integer, | public | :: | n_monomers |
Number of monomer units in system |
|||
| integer, | public | :: | total_atoms |
Total number of atoms |
| procedure, public :: destroy => system_destroy | Memory cleanup |
Calculate minimal atomic distance between monomers in a fragment For single monomer (size 1), returns 0.0 For multi-monomer fragments, returns minimal distance between atoms in different monomers Result is in Angstrom
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(system_geometry_t), | intent(in) | :: | sys_geom | |||
| integer, | intent(in) | :: | monomer_indices(:) |
Convert coordinate from Bohr to Angstrom
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | bohr_value |
Convert coordinate from Angstrom to Bohr
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=dp), | intent(in) | :: | angstrom_value |
Build a fragment from explicit atom list (for GMBE intersection fragments)
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(system_geometry_t), | intent(in) | :: | sys_geom | |||
| integer, | intent(in) | :: | atom_indices(:) |
0-indexed atom indices |
||
| integer, | intent(in) | :: | n_atoms |
Number of atoms in list |
||
| type(physical_fragment_t), | intent(out) | :: | fragment | |||
| type(error_t), | intent(out) | :: | error | |||
| type(bond_t), | intent(in), | optional | :: | bonds(:) |
Connectivity for capping |
Build a fragment on-the-fly from monomer indices with hydrogen capping for broken bonds
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(system_geometry_t), | intent(in) | :: | sys_geom | |||
| integer, | intent(in) | :: | monomer_indices(:) | |||
| type(physical_fragment_t), | intent(out) | :: | fragment | |||
| type(error_t), | intent(out) | :: | error | |||
| type(bond_t), | intent(in), | optional | :: | bonds(:) |
Connectivity information for capping |
Validate that fragment has no spatially overlapping atoms Checks if any two atoms are too close together (< 0.01 Bohr) This catches bugs in geometry construction or fragment building
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(physical_fragment_t), | intent(in) | :: | fragment | |||
| type(error_t), | intent(out) | :: | error |
Read full geometry and monomer template, initialize system_geometry_t
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | full_geom_file | |||
| character(len=*), | intent(in) | :: | monomer_file | |||
| type(system_geometry_t), | intent(out) | :: | sys_geom | |||
| type(error_t), | intent(out) | :: | error |
Redistribute hydrogen cap dipole derivatives to original atoms
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(physical_fragment_t), | intent(in) | :: | fragment | |||
| real(kind=dp), | intent(in) | :: | fragment_dipole_derivs(:,:) |
(3, 3*n_atoms_fragment) |
||
| real(kind=dp), | intent(inout) | :: | system_dipole_derivs(:,:) |
(3, 3*n_atoms_system) |
Redistribute hydrogen cap gradients to original atoms
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(physical_fragment_t), | intent(in) | :: | fragment | |||
| real(kind=dp), | intent(in) | :: | fragment_gradient(:,:) |
(3, n_atoms_fragment) |
||
| real(kind=dp), | intent(inout) | :: | system_gradient(:,:) |
(3, n_atoms_system) |
Redistribute hydrogen cap Hessian to original atoms
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(physical_fragment_t), | intent(in) | :: | fragment | |||
| real(kind=dp), | intent(in) | :: | fragment_hessian(:,:) |
(3n_atoms_fragment, 3n_atoms_fragment) |
||
| real(kind=dp), | intent(inout) | :: | system_hessian(:,:) |
(3n_atoms_system, 3n_atoms_system) |
Add hydrogen caps to fragment for broken bonds Caps are placed at the position of the atom outside the fragment
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | atoms_in_fragment(:) |
0-indexed atom indices in fragment |
||
| type(bond_t), | intent(in) | :: | bonds(:) | |||
| type(system_geometry_t), | intent(in) | :: | sys_geom | |||
| type(physical_fragment_t), | intent(inout) | :: | fragment | |||
| integer, | intent(in) | :: | base_atom_count |
Number of non-cap atoms |
Count how many hydrogen caps are needed for a fragment A cap is needed when exactly one atom of a broken bond is in the fragment
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | atoms_in_fragment(:) |
0-indexed atom indices in fragment |
||
| type(bond_t), | intent(in), | optional | :: | bonds(:) | ||
| integer, | intent(out) | :: | n_caps |
Compute number of electrons from atomic numbers and charge
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(physical_fragment_t), | intent(inout) | :: | this |
Clean up allocated memory in physical_fragment_t
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(physical_fragment_t), | intent(inout) | :: | this |
Set the basis set for this fragment
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(physical_fragment_t), | intent(inout) | :: | this | |||
| type(molecular_basis_type), | intent(in) | :: | basis |
Clean up allocated memory in system_geometry_t
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(system_geometry_t), | intent(inout) | :: | this |