-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs
136 lines (93 loc) · 7.44 KB
/
docs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
1. parameters.py
----------------
Contains the parameters for the simulations:
+ seed: seed for the random number generator.
+ shape: shape of the supercell
+ Ca_Si_ratio:
+ W_Si_ratio :
+ Al_Si_ratio :
+ Al_Four : #0~1,The proportion of tetra-coordinated aluminum atoms to the total aluminum atoms.
+ Al_Six : #0~1,The proportion of penta-coordinated aluminum atoms to the total aluminum atoms.
+ Al_Five : #0~1,The proportion of hexa-coordinated aluminum atoms to the total aluminum atoms.
#Al_Four+Al_Six+Al_Five = 1
+ Al_Five_inter : #The proportion of penta-coordinated aluminum atoms that enter the interlayer to the total penta-coordinated aluminum atoms.
+ Al_Six_inter : #The proportion of hexa-coordinated aluminum atoms that enter the interlayer to the total hexa-coordinated aluminum atoms.
#It is recommended that estimates be made in terms of the total number, setting a relatively low rate.
+ N_samples :
+ create : if True generates N_samples samples
+ read_from_file : if True reads a user defined brick code and generates the lammps input for it. The input file for reading is like the ".log" that the code generates (for now the empty lines have to be respected)
2. mod_construct_brick.py
-------------------------
Creates all the possible bricks.
+ Piece (class):
is a class that contains all the information of a pieces (Block): number of atoms, species, coordinates, etc.
+ pieces (dictionary) :
dictionary with all the pieces. Each entry of the dictionary contains an object of the class "Piece".
+ Brick (class):
a class containing all the information of a brick. Also contains a list of elegible_water for that brick. Here I also count some variables needed for computing SiOH/Si, CaOH/Ca, MCL,parameters related to aluminum etc.
+ above_layer()/below_layer():
Make all possible combinations for making the upper or lower chains. Here I also add the OH groups that may be bonded to the Ca atoms in the chains.
+ interlayer():
Make all possible combinations for the interlayer.
+ check_restrictions():
Remove the combinations (bricks) that have incompatible bridgings and OH: oMDR is incompatible with SD and SDo etc.
+ get_all_bricks():
create all possible bricks. The bricks are stored in a nested dictionary sorted by its
[The number of penta-coordinated interlayer aluminum atoms, The number of hexa-coordinated interlayer aluminum atoms, The total number of tetra-coordinated aluminum atoms, The total number of penta-coordinated aluminum atoms, The total number of hexa-coordinated aluminum atoms,
Ca/Si ratio, Q, SiOH/Si ratio and CaOH/Ca ratio].
For example :
sorted_bricks[N_Al_Five_inter=1][N_Al_Six_inter=0][N_Al_Four=0][N_Al_Five=1][N_Al_Six=0][Ca_Si=1.5][Q=0][SiOH=1][CaOH=0.1667]
contains a list with the bricks with those specific ratios. This is used later for sampling supercells with specific ratios.
#If you do not need the presence of interlayer aluminum, you can set Al_Six_inter and Al_Five_inter to 0 in the parameters. Alternatively, you can contact us via email to request a version without the interlayer aluminum feature.
+ read_brick():
reads a ".log" file and returns the supercell (named "crystal" in the code) defined by the user.
3.mod_sample.py
--------------
Create a supercell (crystal) with a given Ca/Si and water/Si ratio.
+ Sample_Ca_Si_ratio():
We use the number of 5 different types of aluminum atoms for the selection of CASH, followed by the use of use 4 gaussian distributions to select a brick from the dictionary of bricks created in "get_all_bricks()":
5 different types of aluminum atoms:
-The number of penta-coordinated interlayer aluminum atoms. #If you use the version of the CASHgen program that does not contain interlayer aluminum atoms, this number will not exist.
-The number of hexa-coordinated interlayer aluminum atoms. #If you use the version of the CASHgen program that does not contain interlayer aluminum atoms, this number will not exist.
-The total number of tetra-coordinated aluminum atoms.
-The total number of penta-coordinated aluminum atoms.
-The total number of hexa-coordinated aluminum atoms.
4 gaussian distributions:
-The first gaussian is centered around the desired Ca/Si ratio.
-The second around the charge Q=0 so that the system is neutral.
-The third around the experimental SiOH/Si ratio for the desired Ca/Si ratio.
-The fourth around the experimental SiOH/Si ratio for the desired Ca/Si ratio.
Once we sampled the amount of bricks needed for the supercell, we check if the whole supercell is neutral and whether it can contain all the water that the user has requested. If it can't, another supercell is constructed from scratch.
Returns a list of brick type of objects.
+ fill_water():
randomly introduces water in a crystal. Returns a list of water for each of the bricks.
4. mod_construct_supercell.py
-----------------------------
Gets all the coordinates, bonds, angles, etc. for the atoms in the supercell. This is the most messy file.
+ reshape_crystal():
takes the list of bricks and water generated in previous step and reshape them with the shape of the supercell. The output is a tensor of dimensions shape=( Na, Nb, Nc ).
We will randomize the order of the unit cells to avoid interference from the sequence of unit cells in the generation of the supercell.
+ get_coordinates_brick():
Given a brick code (e.g. ["<L", "<R", ">L", ">R"]) and a cell vector correspoding to the position of the brick in the supercell computes the positions of the atoms and the bonds.
If the brick contains an "Oh", we add the Oh, and the corresponding bond.
If the brick contains an "O", we add the shell "O".
This information is stored in a dictionary brick_dict, where the information for each piece in the brick is stored. For example:
brick_dict["<Lo"]
contains the coordinates and species of all the atoms in that brick. This information is stored in lists of the kind: [ atom_index, atom_specie, charge, x, y, z ]
Then we add the coordinates of the water molecules, adding the "Hw" hydrogens and the bonds. The information is stored in a similar dictionary named water_dict.
+ get_full_coordinates():
Computes the coordinates and bonds for all the bricks in the supercell using the previous function. The information is stored in a dictionary made of the dictionaries created in that function. For example:
crystal_dict[(i,j,k)]
contains the brick_dict corresponding to the (i,j,k) cell of the supercell.
This information is needed to compute the angles, since we need to track the relative positions of the bricks along the "b" direction.
+ get_angles():
Uses the "crystal_dict" dictionary to compute the list of angles. This is the most hard function to read/understand. Here I just hard-code all the bonds for each type of piece.
- First we make a list of the indexes of the oxygen atoms bonded to the central Si. In the cases where it is needed, we get the oxygens from the adjacent bricks.
- Then we do all the possible O-Si-O angles and add the to a list.
The same is done for the water molecules in "water_dict".
5. mod_write.py
---------------
This just contains some functions to write the output of the code. It gives the output in the lammps ".data" files, ready to run, in ".vasp" format (easier to directly visualize in vesta), and the ".log" containg all the codes of the brick.
6. main_brick.py
----------------
The main program where all the previously defined functions are used.