atomes 1.1.16
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
dlp_init.c File Reference

Functions to initialize the creation of a classical force field. More...

#include "dlp_field.h"
#include "interface.h"
+ Include dependency graph for dlp_init.c:

Go to the source code of this file.

Functions

void print_all_field_struct (field_molecule *mol, int str)
 print all field structural element(s)
 
int * duplicate_int (int num, int *old_val)
 copy a list of int
 
float * duplicate_float (int num, float *old_val)
 copy a list of float
 
int get_position_in_field_atom_from_model_id (int fat, int at)
 retrieve atom position id in field atom id using atom id in model
 
int get_field_atom_id_from_model_id (field_molecule *fmol, int at)
 retrieve field atom id using atom id in model
 
int get_fragment_atom_id_from_model_id (field_molecule *fmol, int at)
 retrieve fragment atom id using atom id in model
 
int get_atom_id_in_fragment_from_model_id (int frag, int at)
 retrieve field atom id in fragment from model id
 
int set_atom_id (field_atom *at, int c, int p, int id)
 set new fragment/molecule atom parameters
 
gchar * set_field_atom_name (field_atom *ato, field_molecule *mol)
 get name string for field atom
 
field_atominit_field_atom (int id, int type, int at, int nat, int coo, int *list)
 intialize a new type of field atom
 
field_shellinit_field_shell (int id, int ia, int ib)
 initialize field core shell interaction
 
field_constraintinit_field_constraint (int id, int ia, int ib)
 initialize field bond constraint
 
field_pmfinit_field_pmf (int id, int num[2], int *list[2], float *w[2])
 initialize new field mean force potential
 
field_rigidinit_field_rigid (int id, int num, int *list)
 initialize new field rigid constraint
 
field_tetheredinit_field_tethered (int id, int num)
 intialize new field tethered potential
 
field_propinit_field_prop (int ti, int key, gboolean show, gboolean use)
 initialize new field molecule structural property
 
int get_struct_id_from_atom_id (int ids, int *aid)
 retrieve field structural element id from a list of atom id
 
gboolean was_not_created_struct (int ids, int num, int *aid)
 was this structural element already created ?
 
field_structinit_field_struct (int st, int ai, int an, int *aid)
 initialize field molecule new structural element
 
field_nth_bodyinit_field_nth_body (int bi, int bd, int *na, int **ma, int **ba)
 intialize new field non bonded interaction
 
field_externalinit_field_external (int bi)
 intialize new field external potential
 
int prepare_field_atom (int i, int j, int k, int l, int m)
 initialiaze new type of field atom
 
void init_all_atoms (int i)
 initialize all field atom(s)
 
gboolean in_bond (int at, int bd[2])
 is atom at in bond bd
 
gboolean are_neighbors (field_neighbor *ngb, int at)
 test if 2 atoms are neighbors
 
gboolean are_in_bond (atom ato, int at)
 is at in ato neighbors ?
 
int test_for_bonds (field_atom *at, field_atom *bt)
 search for bond(s) between 2 field atoms
 
int prepare_field_struct (int ids, int sid, int yes_no_num, int *aid)
 prepare the creation of a field structural element
 
int bonds_between_atoms (int n, field_atom *at, field_atom *bt, int a, int b)
 search for bond(s) between two field atoms
 
void init_all_bonds ()
 find, and initialize all bond(s)
 
int test_for_angles (field_atom *at, field_atom *bt, field_atom *ct)
 search for angle(s) between these field atoms
 
int angles_from_bonds (int n, field_atom *at, field_atom *bt, field_atom *ct)
 find, and initialize, angles using bonds
 
void init_all_angles ()
 find, and intialiaze, all angle(s) using bonds
 
int test_for_dihedrals (field_atom *at, field_atom *bt, field_atom *ct, field_atom *dt)
 search for dihedral(s) between these field atoms
 
int dihedrals_from_angles (int n, field_atom *at, field_atom *bt, field_atom *ct, field_atom *dt)
 find, and initialize, dihedrals using angles
 
void init_all_dihedrals ()
 find, and intialiaze, all dihedral(s) using bonds
 
int impropers_inversion (int n, int stru, int at, int bt, int ct, int dt, int a, int b, int c, int d)
 prepare new improper / inversion
 
void init_all_impropers_inversions (int stru)
 initialize all impropers and inversions
 
int coord_sphere_multiplicity (atom *at, int id, gboolean set_atom_id)
 get coord sphere multiplicity in the model
 
field_neighborget_init_neighbor (int a)
 retrieve neighbor data structure for atom a
 
gboolean is_numbering_possible (int frag)
 compare if the atom numbering of two fragment(s) are identical, and it should
 
gboolean is_this_numbering_possible_for_this_atom (int frag, field_neighbor *ngma, int atom)
 check if the id in fragment for this atom is possible or not
 
int find_neighbor_loop (int frag, int aid, int fai, field_atom *fat, field_neighbor *ngmb, int sid, gboolean save_it)
 find / set up field atom data for a fragment
 
gboolean id_n_fold_atoms_in_fragment (int frag, int limit, int num_ngb, int search_type, int init, field_neighbor *ngma_init)
 find atom id in fragment using the neighbor list
 
gboolean id_atoms_in_fragment (int frag, int seed)
 find the atom field id in the fragment
 
void get_weight (int seq)
 compute field weigth for the atom(s) in the model
 
int setup_atomic_weight (int seq)
 setup atom(s) field weight
 
void find_atom_id_in_field_molecule ()
 find field atom id in field molecule (fragment multiplicity > 1)
 
void clean_field_struct_list (field_struct *stru)
 clean force field structural property(ies)
 
void init_all_field_struct (gboolean init)
 initialize the force field structural properties for a field molecule
 
void init_field_molecule (int i)
 initialiaze of field molecule data structurre
 
int init_vdw (gboolean init)
 initialize the VdW section of a classical force field
 
void init_dlpoly_field (classical_field *new_field)
 initialize DL-POLY classical force field
 
void init_lammps_field (classical_field *new_field)
 initialize a LAMMPS classical force field
 
classical_fieldcreate_force_field_data_structure (int ai)
 initialize classical force field
 

Variables

int * astr
 
float val
 
int id_atom
 
int multi
 
int a_multi
 
int assigned
 
int * i_weight
 
int * n_weight
 
field_neighborinit_ngb = NULL
 

Detailed Description

Functions to initialize the creation of a classical force field.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file dlp_init.c.

Function Documentation

◆ angles_from_bonds()

int angles_from_bonds ( int n,
field_atom * at,
field_atom * bt,
field_atom * ct )

find, and initialize, angles using bonds

Parameters
nthe number of different angle types already found
at1st field atom
bt2nd field atom
ct3rd field atom

Definition at line 1129 of file dlp_init.c.

◆ are_in_bond()

gboolean are_in_bond ( atom ato,
int at )

is at in ato neighbors ?

Parameters
atothe target atom
atthe target atom id

Definition at line 930 of file dlp_init.c.

◆ are_neighbors()

gboolean are_neighbors ( field_neighbor * ngb,
int at )

test if 2 atoms are neighbors

Parameters
ngbthe neighbor data structure to test
atthe target atom id in the model

Definition at line 912 of file dlp_init.c.

◆ bonds_between_atoms()

int bonds_between_atoms ( int n,
field_atom * at,
field_atom * bt,
int a,
int b )

search for bond(s) between two field atoms

Parameters
nthe number of different bond types already found
at1st field atom
bt2nd field atom
a1st atom chemical species
b2nd atom chemical species

Definition at line 1015 of file dlp_init.c.

◆ clean_field_struct_list()

void clean_field_struct_list ( field_struct * stru)

clean force field structural property(ies)

Parameters
stru

Definition at line 2146 of file dlp_init.c.

◆ coord_sphere_multiplicity()

int coord_sphere_multiplicity ( atom * at,
int id,
gboolean set_atom_id )

get coord sphere multiplicity in the model

Parameters
atthe target atom in the model
idthe atom id in the fragment
set_atom_idadjust field atom parameters (yes / no)

Definition at line 1420 of file dlp_init.c.

◆ create_force_field_data_structure()

classical_field * create_force_field_data_structure ( int ai)

initialize classical force field

Parameters
aihow to initialize the force field (0 = atomic species, 1 = total coordination, 2 = partial coordination)

Definition at line 2986 of file dlp_init.c.

◆ dihedrals_from_angles()

int dihedrals_from_angles ( int n,
field_atom * at,
field_atom * bt,
field_atom * ct,
field_atom * dt )

find, and initialize, dihedrals using angles

Parameters
nthe number of different dihedral types already found
at1st field atom
bt2nd field atom
ct3rd field atom
dt4th field atom

Definition at line 1240 of file dlp_init.c.

◆ duplicate_float()

float * duplicate_float ( int num,
float * old_val )
extern

copy a list of float

Parameters
numnumber of elements in the list
old_valthe list to copy

Definition at line 592 of file global.c.

◆ duplicate_int()

int * duplicate_int ( int num,
int * old_val )
extern

copy a list of int

Parameters
numnumber of elements in the list
old_valthe list to copy

Definition at line 560 of file global.c.

◆ find_atom_id_in_field_molecule()

void find_atom_id_in_field_molecule ( )

find field atom id in field molecule (fragment multiplicity > 1)

Definition at line 1972 of file dlp_init.c.

◆ find_neighbor_loop()

int find_neighbor_loop ( int frag,
int aid,
int fai,
field_atom * fat,
field_neighbor * ngmb,
int sid,
gboolean save_it )

find / set up field atom data for a fragment

Parameters
fragthe fragment id
aidthe atom id in the model
faithe atom id in the fragment
fatthe field atom
ngmbthe neighbor(s) list for the fragment
siditer to save
save_itsave field atom data (yes / no)

Definition at line 1591 of file dlp_init.c.

◆ get_atom_id_in_fragment_from_model_id()

int get_atom_id_in_fragment_from_model_id ( int frag,
int at )

retrieve field atom id in fragment from model id

Parameters
fragthe fragment id
atthe atom id in the model

Definition at line 197 of file dlp_init.c.

◆ get_field_atom_id_from_model_id()

int get_field_atom_id_from_model_id ( field_molecule * fmol,
int at )

retrieve field atom id using atom id in model

Parameters
fmolthe target field molecule
atthe target model atom id

Definition at line 151 of file dlp_init.c.

◆ get_fragment_atom_id_from_model_id()

int get_fragment_atom_id_from_model_id ( field_molecule * fmol,
int at )

retrieve fragment atom id using atom id in model

Parameters
fmolthe target field molecule
atthe target model atom id

Definition at line 174 of file dlp_init.c.

◆ get_init_neighbor()

field_neighbor * get_init_neighbor ( int a)

retrieve neighbor data structure for atom a

Parameters
athe atom id in the fragment

Definition at line 1483 of file dlp_init.c.

◆ get_position_in_field_atom_from_model_id()

int get_position_in_field_atom_from_model_id ( int fat,
int at )

retrieve atom position id in field atom id using atom id in model

Parameters
fatthe target field atom
atthe target model atom id

Definition at line 132 of file dlp_init.c.

◆ get_struct_id_from_atom_id()

int get_struct_id_from_atom_id ( int ids,
int * aid )

retrieve field structural element id from a list of atom id

Parameters
idsthe type of structural element
aidthe list of atom id

Definition at line 559 of file dlp_init.c.

◆ get_weight()

void get_weight ( int seq)

compute field weigth for the atom(s) in the model

Parameters
seqweighting sequence

Definition at line 1832 of file dlp_init.c.

◆ id_atoms_in_fragment()

gboolean id_atoms_in_fragment ( int frag,
int seed )

find the atom field id in the fragment

Parameters
fragthe fragment id
seedseed

Definition at line 1789 of file dlp_init.c.

◆ id_n_fold_atoms_in_fragment()

gboolean id_n_fold_atoms_in_fragment ( int frag,
int limit,
int num_ngb,
int search_type,
int init,
field_neighbor * ngma_init )

find atom id in fragment using the neighbor list

Parameters
fragthe fragment id
limitthe total number of atom(s) in the fragment
num_ngbthe neighbor(s) list for the fragment
search_typesearch type (0 = browse field molecule atom list, 1 = browse field atom list)
initthe atom id in the model
ngma_initthe target

Definition at line 1638 of file dlp_init.c.

◆ impropers_inversion()

int impropers_inversion ( int n,
int stru,
int at,
int bt,
int ct,
int dt,
int a,
int b,
int c,
int d )

prepare new improper / inversion

Parameters
nthe actual number of structural element
struthe type of structural element, 6 = impropers, 7 = inversions
at1st field atom id
bt2nd field atom id
ct3rd field atom id
dt4th field atom id
a1st atom id in molecule/fragment
b2nd atom id in molecule/fragment
c3rd atom id in molecule/fragment
d4th atom id in molecule/fragment

Definition at line 1301 of file dlp_init.c.

◆ in_bond()

gboolean in_bond ( int at,
int bd[2] )

is atom at in bond bd

Parameters
atthe target atom id
bdthe bond atoms id

Definition at line 892 of file dlp_init.c.

◆ init_all_angles()

void init_all_angles ( )

find, and intialiaze, all angle(s) using bonds

Definition at line 1145 of file dlp_init.c.

◆ init_all_atoms()

void init_all_atoms ( int i)

initialize all field atom(s)

Parameters
ithe molecule id in the model, if any

Definition at line 838 of file dlp_init.c.

◆ init_all_bonds()

void init_all_bonds ( )

find, and initialize all bond(s)

Definition at line 1031 of file dlp_init.c.

◆ init_all_dihedrals()

void init_all_dihedrals ( )

find, and intialiaze, all dihedral(s) using bonds

Definition at line 1259 of file dlp_init.c.

◆ init_all_field_struct()

void init_all_field_struct ( gboolean init)

initialize the force field structural properties for a field molecule

Parameters
initsearch for the atom(s) force field id number(s)

Definition at line 2170 of file dlp_init.c.

◆ init_all_impropers_inversions()

void init_all_impropers_inversions ( int stru)

initialize all impropers and inversions

Parameters
stru6 = improper(s), 7 = inversion(s)

Definition at line 1343 of file dlp_init.c.

◆ init_dlpoly_field()

void init_dlpoly_field ( classical_field * new_field)

initialize DL-POLY classical force field

Parameters
new_fieldthe force field to initialize

Definition at line 2407 of file dlp_init.c.

◆ init_field_atom()

field_atom * init_field_atom ( int id,
int type,
int at,
int nat,
int coo,
int * list )

intialize a new type of field atom

Parameters
idthe new field atom id
typethe new field atom coordination type
atthe new field atom species
natthe number of atom(s) of for this field atom type
coothe coordination id in coordination type, if any
listthe list of atoms that match this type of field atom

Definition at line 304 of file dlp_init.c.

◆ init_field_constraint()

field_constraint * init_field_constraint ( int id,
int ia,
int ib )

initialize field bond constraint

Parameters
idthe new field constraint id
ia1st atom id in field molecule
ib2nd atom id in field molecule

Definition at line 419 of file dlp_init.c.

◆ init_field_external()

field_external * init_field_external ( int bi)

intialize new field external potential

Parameters
bithe id of the new field external potential

Definition at line 790 of file dlp_init.c.

◆ init_field_molecule()

void init_field_molecule ( int i)

initialiaze of field molecule data structurre

Parameters
ithe id of the field molecule to initialize

Definition at line 2239 of file dlp_init.c.

◆ init_field_nth_body()

field_nth_body * init_field_nth_body ( int bi,
int bd,
int * na,
int ** ma,
int ** ba )

intialize new field non bonded interaction

Parameters
bithe new non bonded interaction id
bdthe type of non bonded interaction
nathe list of field atom(s), if any
mathe list of field molecule(s), if any
bathe list of atom id in field molecule, if any

Definition at line 740 of file dlp_init.c.

◆ init_field_pmf()

field_pmf * init_field_pmf ( int id,
int num[2],
int * list[2],
float * w[2] )

initialize new field mean force potential

Parameters
idthe id of the new field PMF
numthe numbers of atom(s)
listthe lists of atom(s)
wthe weight list

Definition at line 445 of file dlp_init.c.

◆ init_field_prop()

field_prop * init_field_prop ( int ti,
int key,
gboolean show,
gboolean use )

initialize new field molecule structural property

Parameters
tithe type of field structural element to initialize
keythe formalism to use
showvisualize in the 3D window (yes / no)
useuse to create the force field input file (yes / no)

Definition at line 535 of file dlp_init.c.

◆ init_field_rigid()

field_rigid * init_field_rigid ( int id,
int num,
int * list )

initialize new field rigid constraint

Parameters
idthe id of the new field rigid
numthe number of atom(s) to fix
listthe list of atom(s) to fix

Definition at line 487 of file dlp_init.c.

◆ init_field_shell()

field_shell * init_field_shell ( int id,
int ia,
int ib )

initialize field core shell interaction

Parameters
idthe new shell id
ia1st atom id in field molecule
ib2nd atom id in field molecule

Definition at line 394 of file dlp_init.c.

◆ init_field_struct()

field_struct * init_field_struct ( int st,
int ai,
int an,
int * aid )

initialize field molecule new structural element

Parameters
stthe type of structural element (0 = bond, 1 = angle, 2 = dihedral)
aithe id of the new structural property
anthe number of atoms
aidthe list of field atoms

Definition at line 704 of file dlp_init.c.

◆ init_field_tethered()

field_tethered * init_field_tethered ( int id,
int num )

intialize new field tethered potential

Parameters
idthe new field tethered potential id
numthe atom id in the field molecule

Definition at line 510 of file dlp_init.c.

◆ init_lammps_field()

void init_lammps_field ( classical_field * new_field)

initialize a LAMMPS classical force field

Parameters
new_fieldthe force field to initialize

Definition at line 2697 of file dlp_init.c.

◆ init_vdw()

int init_vdw ( gboolean init)

initialize the VdW section of a classical force field

Parameters
init

Definition at line 2299 of file dlp_init.c.

◆ is_numbering_possible()

gboolean is_numbering_possible ( int frag)

compare if the atom numbering of two fragment(s) are identical, and it should

Parameters
fragthe fragment id

Definition at line 1502 of file dlp_init.c.

◆ is_this_numbering_possible_for_this_atom()

gboolean is_this_numbering_possible_for_this_atom ( int frag,
field_neighbor * ngma,
int atom )

check if the id in fragment for this atom is possible or not

Parameters
fragthe fragment id
ngmathe neigbbor data structure for this fragment
atomthe atom id in the model

Definition at line 1550 of file dlp_init.c.

◆ prepare_field_atom()

int prepare_field_atom ( int i,
int j,
int k,
int l,
int m )

initialiaze new type of field atom

Parameters
ithe new field atom id
jthe new field atom coordination type
kthe new field atom species
lthe number of atom(s) of for this field atom type
mthe coordination id in coordination type, if any

Definition at line 814 of file dlp_init.c.

◆ prepare_field_struct()

int prepare_field_struct ( int ids,
int sid,
int yes_no_num,
int * aid )

prepare the creation of a field structural element

Parameters
idsthe type of structural element (0 to 7)
sidthe id of the new structural element
yes_no_numis there data to save (1 or > 1) or not (0) ?
aidthe list of field atoms

Definition at line 981 of file dlp_init.c.

◆ print_all_field_struct()

void print_all_field_struct ( field_molecule * mol,
int str )
extern

print all field structural element(s)

Parameters
molthe target field molecule
strthe type of structural element

Definition at line 195 of file dlp_print.c.

◆ set_atom_id()

int set_atom_id ( field_atom * at,
int c,
int p,
int id )

set new fragment/molecule atom parameters

Parameters
atthe target field atom
cthe fragment id
pthe list id in field atom
idthe field atom id

Definition at line 224 of file dlp_init.c.

◆ set_field_atom_name()

gchar * set_field_atom_name ( field_atom * ato,
field_molecule * mol )

get name string for field atom

Parameters
atothe target field atom
molthe target field molecule

Definition at line 247 of file dlp_init.c.

◆ setup_atomic_weight()

int setup_atomic_weight ( int seq)

setup atom(s) field weight

Parameters
seqweighting sequencce

Definition at line 1877 of file dlp_init.c.

◆ test_for_angles()

int test_for_angles ( field_atom * at,
field_atom * bt,
field_atom * ct )

search for angle(s) between these field atoms

Parameters
at1st field atom
bt2nd field atom
ct3rd field atom

Definition at line 1081 of file dlp_init.c.

◆ test_for_bonds()

int test_for_bonds ( field_atom * at,
field_atom * bt )

search for bond(s) between 2 field atoms

Parameters
at1st field atom
bt2nd field atom

Definition at line 948 of file dlp_init.c.

◆ test_for_dihedrals()

int test_for_dihedrals ( field_atom * at,
field_atom * bt,
field_atom * ct,
field_atom * dt )

search for dihedral(s) between these field atoms

Parameters
at1st field atom
bt2nd field atom
ct3rd field atom
dt4th field atom

Definition at line 1181 of file dlp_init.c.

◆ was_not_created_struct()

gboolean was_not_created_struct ( int ids,
int num,
int * aid )

was this structural element already created ?

Parameters
idsthe type of structural element
numthe number of atoms
aidthe list of atom id

Definition at line 603 of file dlp_init.c.

Variable Documentation

◆ a_multi

int a_multi

Definition at line 122 of file dlp_init.c.

◆ assigned

int assigned

Definition at line 1471 of file dlp_init.c.

◆ astr

int* astr

Definition at line 116 of file dlp_init.c.

◆ i_weight

int* i_weight

Definition at line 1472 of file dlp_init.c.

◆ id_atom

int id_atom

Definition at line 120 of file dlp_init.c.

◆ init_ngb

field_neighbor* init_ngb = NULL

Definition at line 1474 of file dlp_init.c.

◆ multi

int multi

Definition at line 121 of file dlp_init.c.

◆ n_weight

int* n_weight

Definition at line 1473 of file dlp_init.c.

◆ val

float val

Definition at line 117 of file dlp_init.c.