dockonsurf / modules / script_add_adsorbate+diss.sh @ 86112fec
Historique | Voir | Annoter | Télécharger (2,76 ko)
1 |
#!/bin/bash |
---|---|
2 |
|
3 |
# script surface.xyz at.surf molecule.xyz at.mol distance at.surf2 at.mol2 alpha theta output(.xyz) |
4 |
|
5 |
distance_mol_surf=2 |
6 |
|
7 |
nom_de_la_molecule=$1 |
8 |
surface_d_adsorption=$2 |
9 |
list_atom_1_mol=($3) |
10 |
list_atom_2_mol=($4) |
11 |
list_atom_surf=($5) |
12 |
|
13 |
nombre_atom_mol=${#list_atom_1_mol[@]} |
14 |
|
15 |
angles_phi=(0 0 0 270 270 270 180 180 180 90 90 90) |
16 |
angles_theta=(0 300 300 0 300 300 0 300 300 0 300 300) |
17 |
angles_psi=(0 0 315 0 0 315 0 0 315 0 0 315) |
18 |
|
19 |
nombre_atom_surf=${#list_atom_surf[@]} |
20 |
nombre_angles=${#angles_phi[@]} |
21 |
|
22 |
if [ ! -d ${MolOnSurf_results_path}/${nom_de_la_molecule} ] |
23 |
then mkdir ${MolOnSurf_results_path}/${nom_de_la_molecule} |
24 |
else |
25 |
echo "There is already a directory for this molecule: remove this directory?" |
26 |
read reponse |
27 |
if [[ "$reponse" == "yes" ]] |
28 |
then rm -r ${MolOnSurf_results_path}/${nom_de_la_molecule}/* |
29 |
fi |
30 |
fi |
31 |
|
32 |
|
33 |
################## |
34 |
# Détermination du numéro correspondant à la molécule ayant la structure la plus stable |
35 |
################## |
36 |
|
37 |
|
38 |
n="$(find ${Molecule_results_path}/${nom_de_la_molecule}/${nom_de_la_molecule}*/coord.xyz | wc -l)" |
39 |
min_energy_molecule=0 |
40 |
|
41 |
for ((a=1; a<=n; a++)) ; do |
42 |
energy_molecule="$(awk '/ENERGY/{E=$NF} END{print E}' ${Molecule_results_path}/${nom_de_la_molecule}/${nom_de_la_molecule}_$a/*${nom_de_la_molecule}.out)" |
43 |
if [[ "$energy_molecule" > "$min_energy_molecule" ]] |
44 |
then |
45 |
min_energy_molecule=$energy_molecule |
46 |
numero_mol_stable=$a |
47 |
fi |
48 |
done |
49 |
|
50 |
|
51 |
################## |
52 |
# Génération des structures de molécules adsorbées sur la surface |
53 |
################## |
54 |
|
55 |
b=1 |
56 |
|
57 |
mkdir ${MolOnSurf_results_path}/${nom_de_la_molecule}/coords |
58 |
|
59 |
molecule_a_adsorber=${nom_de_la_molecule}_${numero_mol_stable} |
60 |
for ((i=0; i<${nombre_atom_surf}; i++)) ; do |
61 |
atom_surf=${list_atom_surf[$i]} |
62 |
for ((j=0; j<${nombre_atom_mol}; j++)) ; do |
63 |
atom_1_mol=${list_atom_1_mol[$j]} |
64 |
atom_2_mol=${list_atom_2_mol[$j]} |
65 |
echo " " |
66 |
echo "Adsorption of atom $atom_1_mol on atom $atom_surf" |
67 |
for ((k=0; k<${nombre_angles}; k++)) ; do |
68 |
angle_phi=${angles_phi[$k]} |
69 |
angle_theta=${angles_theta[$k]} |
70 |
angle_psi=${angles_psi[$k]} |
71 |
${DockOnSurf_path}/modules/add_adsorbate_euler+dissociation.py ${Surface_path}/${surface_d_adsorption}.xyz ${atom_surf} ${Molecule_results_path}/${nom_de_la_molecule}/${molecule_a_adsorber}/coord.xyz ${atom_1_mol} ${distance_mol_surf} ${atom_2_mol} ${angle_phi} ${angle_theta} ${angle_psi} ${MolOnSurf_results_path}/${nom_de_la_molecule}/coords/${nom_de_la_molecule}_$b |
72 |
b=$((b+1)) |
73 |
done |
74 |
done |
75 |
done |
76 |
|
77 |
for file_molsurf in ${MolOnSurf_results_path}/${nom_de_la_molecule}/coords/*; do |
78 |
name="$(echo $file_molsurf | awk -F/ '{print $NF}' | awk -F. '{print $(NF-1)}')" |
79 |
mkdir ${MolOnSurf_results_path}/${nom_de_la_molecule}/$name |
80 |
mv $file_molsurf ${MolOnSurf_results_path}/${nom_de_la_molecule}/$name/coord.xyz |
81 |
done |
82 |
rm -r ${MolOnSurf_results_path}/${nom_de_la_molecule}/coords |
83 |
|