C-callable Interface to the Fragment object

Function definitions


int FRAG_get_number_of_atoms
int FRAG_get_number_of_bqs
int FRAG_get_number_of_exts
int FRAG_get_number_of_shells
int FRAG_get_coordinate_matrix
int FRAG_get_partial_coordinate_matrix
int FRAG_store_coordinate_matrix
int FRAG_store_partial_coordinate_matrix
int FRAG_allocate_atoms
int FRAG_allocate_bqs
int FRAG_allocate_shells
int FRAG_get_x_coordinate_vector
int FRAG_get_y_coordinate_vector
int FRAG_get_z_coordinate_vector
int FRAG_put_x_coordinate_vector
int FRAG_put_y_coordinate_vector
int FRAG_put_z_coordinate_vector
int FRAG_set_title
int FRAG_extend
char *FRAG_get_title
FRAG_list
int FRAG_copy
int FRAG_connect
int FRAG_connect_default
int FRAG_get_connections
int FRAG_add_conn
int FRAG_del_conn
int FRAG_reset_conn
float FRAG_rsq
struct vector_struct FRAG_position_vector
struct vector_struct FRAG_centroid
int FRAG_group_centroid
float FRAG_angle
float FRAG_dihedral
int FRAG_write
int FRAG_bonded
int FRAG_get_atom
int FRAG_get_bq
int FRAG_get_shell
int FRAG_set_atom
int FRAG_set_bq
int FRAG_set_shell
int FRAG_delete_atom
int FRAG_insert_atom
int FRAG_insert_shell
int FRAG_compare
FRAG_shuffle
FRAG_merge
FRAG_reorder
int FRAG_get_z
int FRAG_write_xyz
int FRAG_read_xyz
FRAG_images
int FRAG_construct_group

int FRAG_get_number_of_atoms

Arguments:

 Frag f                         Fragment of interest                              
Returns the number of atoms in a fragment

int FRAG_get_number_of_bqs

Arguments:

 Frag f                         Fragment of interest                              
Returns the number of bqs (point charges) stored as part of the fragment structure.

int FRAG_get_number_of_exts

Arguments:

 Frag f                         Fragment of interest                              
Returns the number of external sites (distributed polarizabilities for the DRF scheme) stored as part of the fragment structure.

int FRAG_get_number_of_shells

Arguments:

 Frag f                         Fragment of interest                              
Returns the number of shells stored as part of the fragment structure.

int FRAG_get_coordinate_matrix

Arguments:

 Frag f                         Fragment of interest                              
 float *c                       array to receive the coordinates                  
Recover the coordinates of all atoms of a fragment, The x,y and z coordinates of each atom are stored consecutively. The bq's (if present) follow the real atoms.

int FRAG_get_partial_coordinate_matrix

Arguments:

 Frag f                         Fragment of interest                              
 float *c                       array to receive the coordinates                  
 int *sel                       Selection                                         
Recover the coordinates for a subset of all atoms of a fragment, The x,y and z coordinates of each atom are stored consecutively. The bq's (if present) follow the real atoms.

int FRAG_store_coordinate_matrix

Arguments:

 Frag f                         Fragment of interest                              
 float *c                       array to receive the coordinates                  
Replace the coordinates of all atoms of a fragment, The x,y and z coordinates of each atom are stored consecutively in the array c. The bq's (if present) follow the real atoms.

int FRAG_store_partial_coordinate_matrix

Arguments:

 Frag f                         Fragment of interest                              
 float *c                       Array to receive the coordinates                  
 int *sel                       Atom selection                                    
Replace a subset of the coordinates of all atoms of a fragment, The x,y and z coordinates of each atom are stored consecutively in the array c. The bq's (if present) follow the real atoms.

int FRAG_allocate_atoms

Arguments:

 Frag f                         Fragment of interest                              
 int n                          number of atoms to allocate                       
Allocate memory for atom storage. All atoms are added with an atomic number of zero, and NULL atom names.

int FRAG_allocate_bqs

Arguments:

 Frag f                         Fragment of interest                              
 int n                          number of bqs to allocate                         
Allocate memory for bq (point charge) storage.

int FRAG_allocate_shells

Arguments:

 Frag f                         Fragment of interest                              
 int n                          number of shells to allocate                      
Allocate memory for shell storage.

int FRAG_get_x_coordinate_vector

Arguments:

 Frag f                         Fragment on interest                              
 float *c                       Array to hold x coordinate                        
Recover a vector containing the x coordinates of all the atoms.

int FRAG_get_y_coordinate_vector

Arguments:

 Frag f                         Fragment of interest                              
 float *c                       Array to hold Y coordinates                       
Recover a vector containing the Y coordinates of all the atoms.

int FRAG_get_z_coordinate_vector

Arguments:

 Frag f                                                                           
 float *c                                                                         
Recover a vector containing the Z coordinates of all the atoms.

int FRAG_put_x_coordinate_vector

Arguments:

 Frag f                         Fragment on interest                              
 float *c                       Array containing x coordinate                     
Output a vector containing the x coordinates of all the atoms.

int FRAG_put_y_coordinate_vector

Arguments:

 Frag f                         Fragment on interest                              
 float *c                       Array containing y coordinate                     
Output a vector containing the x coordinates of all the atoms.

int FRAG_put_z_coordinate_vector

Arguments:

 Frag f                         Fragment on interest                              
 float *c                       Array containing z coordinate                     
Output a vector containing the z coordinates of all the atoms.

int FRAG_set_title

Arguments:

 Frag f                         Fragment of interest                              
 char *s                        pointer to a string containing the title          
Define the title of a fragment object. The title is copied into memory allocated within the fragment object

int FRAG_extend

Arguments:

 Frag f                         Fragment of interest                              
 Frag res                       Result fragment                                   
 int as                         start cell index for first cell vector            
 int ae                         end cell index for first cell vector              
 int bs                         start cell index for second cell vector           
 int be                         end cell index for second cell vector             
 int cs                         start cell index for third cell vector            
 int ce                         end cell index for third cell vector              
Extend a periodic structure to contain multiple unit cells. Note that the pointer f->natom is not changes, f->tatom contains the total number of atoms stored.

char *FRAG_get_title

Arguments:

 Frag f                         Fragment of Interest                              
Return a pointer to the title string of a fragment.

FRAG_list

Arguments:

 Frag f                         Fragment of interest                              
 char *unit                     pointer to length unit                            
Provide a listing of the coordinates of the fragment to stdout Unit will typically be one of au, angstrom or nm

int FRAG_copy

Arguments:

 Frag to                        Destination fragment                              
 Frag from                      Source fragment                                   
Copy the entire contents of a fragment to another. This involves allocation of memory for the atoms, title etc.

int FRAG_connect

Arguments:

 Frag f                         Fragment of interest                              
 float scale                    scale parameter for bond test                     
 float toler                    tolerance parameter for bond test                 
Compute fragment connectivity using the link-cells algorithm.

Atoms are considered connected

  R_ij < scale*(vdw_i + vdw_j) + toler
  
where R_ij is the internuclear distance, vdw_i is the van der Waals radius of i, and scale and toler are input parameters.

int FRAG_connect_default

Arguments:

 Frag f                         Fragment of interest                              
Compute fragment connectivity using the link-cells algorithm and the default connectivity parameters

Atoms are considered connected

R_ij < scale*(vdw_i + vdw_j) + toler
where R_ij is the internuclear distance, vdw_i is the van der Waals radius of i, and scale and toler take values from the global variables chemsh_default_connectivity_scale and chemsh__default_connectivity_toler

int FRAG_get_connections

Arguments:

 Frag f                         Fragment of interest                              
 int atom                       Atom of interest                                  
 int connections[]              array to hold results                             
Find the number of connections to an atom. The number of connections is returned. A return code of -1 denotes and invalid atom number.

int FRAG_add_conn

Arguments:

 Frag f                         Fragment of interest                              
 int i                          index of first atom                               
 int j                          index of connected atom                           
Add a connectivity table entry.

int FRAG_del_conn

Arguments:

 Frag f                         Fragment of interest                              
 int i                          index of first atom                               
 int j                          index of connected atom                           
Delete a connectivity table entry.

int FRAG_reset_conn

Arguments:

 Frag f                         Fragment of interest                              
Reset the connectivity table, deleting all entries.

float FRAG_rsq

Arguments:

 Frag f                         Fragment of interest                              
 int i                          First atom index                                  
 int j                          Second atom index                                 
Return the square of the interatomic distance. A negative value is returned if either of the atom indices are invalid.

struct vector_struct FRAG_position_vector

Arguments:

 Frag f                         Fragment of interest                              
 int i                          Index of atom                                     
Return the position of a vector (a.u.).

struct vector_struct FRAG_centroid

Arguments:

 Frag f                         Fragment of interest                              
Return the centroid of the atom coordinates (in a.u.)

int FRAG_group_centroid

Arguments:

 Frag f                         Fragment of interest                              
 int *grp                                                                         
 int grpsiz                                                                       
 float *cent                                                                      
Return the centroid of a subset of the atom coordinates (in a.u.)

float FRAG_angle

Arguments:

 Frag f                         Fragment of interest                              
 int i                          Terminal atom                                     
 int j                          Central atom                                      
 int k                          Terminal atom                                     
Return the angle defined by three atoms

float FRAG_dihedral

Arguments:

 Frag f                         Fragment of interest                              
 int i                          First atom in sequence                            
 int j                          Second atom in sequence                           
 int k                          Third atom in sequence                            
 int l                          Fourth atom in sequence                           
Return the dihedral defined by the atom sequence (i-j-k-l)

int FRAG_write

Arguments:

 Frag f                         Fragment of interest                              
 FILE *fp                       file pointer                                      
Output the structure (ChemShell format) to a file. Generally used to create a sequence of structures.

int FRAG_bonded

Arguments:

 Frag f                         Fragment of interest                              
 int i                          First atom                                        
 int j                          Second atom                                       
Returns 1 if two atoms are connected, 0 otherwise.

int FRAG_get_atom

Arguments:

 Frag f                                                                           
 int atom                       sequence number of atom required                  
 char *symbol                   pointer to memory location to hold symbol         
 float *x                                                                         
 float *y                                                                         
 float *z                                                                         
 int *znum                      atomic number                                     
Obtain information about an atomic centre.

int FRAG_get_bq

Arguments:

 Frag f                                                                           
 int atom                       sequence number of bq required                    
 float *x                                                                         
 float *y                                                                         
 float *z                                                                         
 float *charge                                                                    
Obtain information about a point charge.

int FRAG_get_shell

Arguments:

 Frag f                                                                           
 int atom                       sequence number of bq required                    
 char *symbol                                                                     
 float *x                                                                         
 float *y                                                                         
 float *z                                                                         
 float *charge                                                                    
Obtain information about a shell.

int FRAG_set_atom

Arguments:

 Frag f                                                                           
 int atom                                                                         
 char *symbol                                                                     
 float x                                                                          
 float y                                                                          
 float z                                                                          
Set the atom type and coordinates of an atom, which must already be allocated.

int FRAG_set_bq

Arguments:

 Frag f                                                                           
 int atom                                                                         
 float x                                                                          
 float y                                                                          
 float z                                                                          
 float charge                                                                     
Set the coordinates and charge of a bq centre. The centre must have already been allocated.

int FRAG_set_shell

Arguments:

 Frag f                                                                           
 int atom                                                                         
 char *symbol                                                                     
 float x                                                                          
 float y                                                                          
 float z                                                                          
 float charge                                                                     
Set the coordinates and charge of a bq centre. The centre must have already been allocated.

int FRAG_delete_atom

Arguments:

 Frag f                                                                           
 int atom                                                                         
Delete an atom from the fragment structure.

int FRAG_insert_atom

Arguments:

 Frag f                                                                           
 int atom                       Atom number of the atom after insertion           
 char *symbol                                                                     
 float x                                                                          
 float y                                                                          
 float z                                                                          
Adds an atom to a molecule, and recomputes connectivity. Note this function reallocates and copies the atom list so should be used sparingly.

int FRAG_insert_shell

Arguments:

 Frag f                                                                           
 int atom                       Atom number of the atom after insertion           
 char *symbol                                                                     
 float x                                                                          
 float y                                                                          
 float z                                                                          
 float chg                                                                        
Adds an shell to a molecule, and recomputes connectivity. Note this function reallocates and copies the atom list so should be used sparingly.

int FRAG_compare

Arguments:

 Frag f1                        First fragment                                    
 Frag f2                        Second fragment                                   
 float toler                    tolerance for checking coordinates                
Compare two fragments, returning
1 if the coordinates don't match
2 if the number of atoms differ
3 if the symbols don't match

FRAG_shuffle

Arguments:

 Frag f2                                                                          
 Frag f1                                                                          
 int nchange                                                                      
 int *iflag                                                                       
Fragment reordering by input list

FRAG_merge

Arguments:

 Frag f1                                                                          
 Frag f2                                                                          
 Frag f3                                                                          
 double toler                                                                     
Merge fragments f1 and f2, result is f3, deleting overlapping atoms The atoms of f1 come first, then the non-redundant atoms of f2

FRAG_reorder

Arguments:

 Frag f2                                                                          
 Frag f1                                                                          
 int iseed                                                                        
 int istart                                                                       
 int iend                                                                         
Reordering fragment using distance to a specified atom

int FRAG_get_z

Arguments:

 Frag frag                                                                        
 int atom                                                                         
Return the atomic number of an atom

int FRAG_write_xyz

Arguments:

 Frag frag                                                                        
 FILE *fp                                                                         
Write the fragment in XYZ format

int FRAG_read_xyz

Arguments:

 Frag frag                                                                        
 FILE *fp                                                                         
Read an fragment from a file (XYZ format). The fragment object must have been allocated but the space for the atoms is allocated by the function.

FRAG_images

Arguments:

 Frag f                                                                           
 float x[3]                                                                       
Apply unit cell translations to bring all atoms as close as possible to the reference point x if iat == -1 all atoms are shifted

int FRAG_construct_group

Arguments:

 Frag f                         Fragment to be manipulated                        
 int *grplist                   list of members of group                          
 int grpsiz                     number of members of group                        
 int iref                       Reference atom                                    
Apply unit cell translations to bring all atoms in a given group as close as possible to the reference atom