-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add smooth silica surface * update README * Update entry points * Fix import bug * fix test
- Loading branch information
Showing
7 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Surface Coatings | ||
|
||
## Overview | ||
Surface Coatings (`surface_coatings`) is an [mBuild](https://mbuild.mosdef.org/) recipe to construct monolayer systems, | ||
i.e., surfaces coated with monolayers. | ||
Recipes are desgined to be add-ons to [mBuild](https://mbuild.mosdef.org/), | ||
allowing users to construct classes of chemical sysetms utilizing routines developed earlier using [mBuild](https://mbuild.mosdef.org/). | ||
|
||
|
||
## Installation | ||
The `surface_coatings` can be install using `pip`. While its dependencies can be found in `environment.yml`. | ||
```bash | ||
conda env update --file environemnt.yml | ||
pip install . | ||
``` | ||
|
||
## Example Usage | ||
```python | ||
import mbuild as mb | ||
from mbuild.lib.molecules import WaterSPC as H2O | ||
from surface_coatings.surfaces import SiicaInterfaceCarve | ||
from surface_coatings.chains import Alkylsilane | ||
from surface_coatings import Monolayer, DualMonolayer, SolvatedMonolayer, SolvatedDualMonolayer | ||
|
||
silane_chain = Alkylsilane() | ||
silica_surface = SiicaInterfaceCarve() | ||
|
||
silica_monolayer = Monolayer(surface=silica_surface, | ||
chains=silane_chain, | ||
n_chains=100, | ||
tile_x=1, | ||
tile_y=1) | ||
silica.visualize() | ||
|
||
# Create a dual monolayer with the created monolayer | ||
dual_monolayer = DualMonolayer(top=mb.clone(silica_monolayer), | ||
bottom=mb.cone(silica_monolayer), | ||
separation=3) | ||
dual_monolayer.visualize() | ||
|
||
# Solvate a monolayer system | ||
solvated_monolayer = SolvatedMonolayer(monolayer=mb.clone(silica_monolayer), | ||
solvent=H2O()) | ||
|
||
solvated_monolayer.visualize() | ||
|
||
# Solvate a dual monolayer system | ||
solvated_dual_monolayer = SolvatedDualMonolayer(dual_monolayer=dual_monolayer, | ||
solvent=H2O()) | ||
solvated_dual_monolayer.visualize() | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from .silicon_interface import SiliconInterface | ||
from .silica_interface_carve import SilicaInterfaceCarve | ||
from .silica_interface import SilicaInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import mbuild as mb | ||
from mbuild.lib.surfaces import Betacristobalite | ||
|
||
class SilicaInterface(mb.Compound): | ||
def __init__(self, tile_x=1, tile_y=1): | ||
super(SilicaInterface, self).__init__() | ||
silica_crystal = Betacristobalite() | ||
tiled_compound = mb.lib.recipes.TiledCompound(mb.clone(silica_crystal), | ||
n_tiles=(tile_x, tile_y, 1)) | ||
self.add(tiled_compound, "TiledCompound") | ||
self._transfer_ports() | ||
self.periodicity = (True, True, False) | ||
|
||
def _transfer_ports(self): | ||
"""Transfer available ports from TiledCompound to parents level""" | ||
for port in self["TiledCompound"].available_ports(): | ||
clone_port = mb.clone(port) | ||
clone_port.anchor = port.anchor | ||
self.remove(port) | ||
self.add(clone_port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters