Skip to content

Commit 8618faa

Browse files
committed
Update index.md
1 parent c78ac43 commit 8618faa

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

docs/src/index.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#### Monoatomic Bravais Lattices:
1313
Whenever possible crystals are implemented using a conventional unit cell so that patterning a simulation cell is simple. A trinclinic boundary will work for the remaining lattices.
1414

15-
SimpleCrystals.jl re-exports [Unitful.jl](https://painterqubits.github.io/Unitful.jl/stable/) and [StatcArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl) and can handle any atomic symbols from [PeriodicTable.jl](https://github.com/JuliaPhysics/PeriodicTable.jl). For example, The code below creates an FCC crystal of carbon with a conventional cell that is 5.4 Angstroms. The cell is patterened 4 times in the x, y, and z directions. The coordinates can be obtained in code with the `atoms` member variable or saved to a XYZ file with `to_xyz()`.
15+
SimpleCrystals.jl re-exports [Unitful.jl](https://painterqubits.github.io/Unitful.jl/stable/) and [StatcArrays.jl](https://github.com/JuliaArrays/StaticArrays.jl) and can handle any atomic symbols from [PeriodicTable.jl](https://github.com/JuliaPhysics/PeriodicTable.jl). For example, the code below creates an FCC crystal of carbon with a conventional cell that is 5.4 Angstroms. The cell is patterened 4 times in the x, y, and z directions. The coordinates can be obtained in code with the `atoms` member variable or saved to a XYZ file with `to_xyz()`.
1616

1717
```julia
1818
a = 5.4u""
@@ -24,7 +24,7 @@ to_xyz(fcc_crystal, raw"./positions_fcc.xyz")
2424
#### 3D Bravais Lattices
2525
All 3D Bravais lattices created from the SimpleCrystal's API and visualized in [OVITO](https://ovito.org/). The radius of the atoms is chosen arbitrarily in OVITO.
2626

27-
27+
```@raw html
2828
<table>
2929
<tr>
3030
<th>Crystal Family</th>
@@ -84,7 +84,7 @@ All 3D Bravais lattices created from the SimpleCrystal's API and visualized in [
8484
</tr>
8585
8686
</table>
87-
87+
```
8888

8989
#### Other 3D Structrues
9090
Diamond and HCP are also implemented as part of the API:
@@ -206,10 +206,14 @@ fcc_crystal = FCC(a, :C, SVector(4,4,4))
206206
to_xyz(fcc_crystal, raw"C:\Users\ejmei\Desktop\positions_fcc.xyz")
207207
```
208208

209-
To get the list of atoms in code you can use the `atoms` member variable. The code below will return the array of atoms that the to_xyz() function builds internally.
209+
To get the list of atoms in code you can use the `atoms` member variable. The code below will return the array of atoms that the to_xyz() function builds internally. AlLternatively, you can loop over the crystal object which will iterate through the `crystal.atoms` list.
210210

211211
```julia
212212
a = 5.4u""
213-
fcc_crystal = FCC(a, :C, SVector(4,4,4))
213+
fcc_crystal = FCC(a, :C, SVector(2,2,2))
214214
atoms = fcc_crystal.atoms
215+
216+
for atom in fcc_crystal
217+
#do something
218+
end
215219
```

0 commit comments

Comments
 (0)