A tool to generate exotic ice clusters.
Project description
ClustIce
A tool to generate exotic ice clusters.
version 0.7.1
Requirements
- python
- numpy
- networkx
- scikit-learn
- cycless
Installation
ClustIce is registered to PyPI (Python Package Index). Install with pip3.
pip3 install clustice
Uninstallation
pip3 uninstall clustice
API
API manual is here.
Examples
Make an icosahedral ice cluster.
import numpy as np
import networkx as nx
import genice_core
from clustice.geometry import make_layout
from clustice.gromacs import render
from clustice.water import tip4p
from clustice import graph
# O-O distance
L = 0.27
# note: g must be a graph whose labels start from 0.
# g = graph.great_icosahedron(12, separation=L)
g = graph.great_decahedron(12)
# g = graph.small_barrelan()
# g = graph.large_barrelan()
# g = graph.twistane()
# g = graph.adamantane()
# g = nx.cycle_graph(6) # hexagon
# g = nx.cycle_graph(7) # heptagon
# g = nx.cubical_graph() # cubic octamer
# g = nx.dodecahedral_graph()
if "pos" in g.nodes[0]:
# extract the embedded coords in g
layout = np.array([g.nodes[v]["pos"] for v in g])
else:
# estimate of the positions of the nodes
layout = make_layout(g, edgelen=L)
# set orientations of the hydrogen bonds.
# if vertexPositions is given, the net dipole moment is minimized.
dg = genice_core.ice_graph(g, vertexPositions=layout, dipoleOptimizationCycles=100)
# put water molecules
gro = render(dg, layout, watermodel=tip4p)
with open("sample.gro", "w") as f:
f.write(gro)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
clustice-0.7.1.tar.gz
(9.9 kB
view details)
Built Distribution
clustice-0.7.1-py3-none-any.whl
(10.8 kB
view details)
File details
Details for the file clustice-0.7.1.tar.gz
.
File metadata
- Download URL: clustice-0.7.1.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a8c796f862941c2dacbe29644a1cf58e3436c2b03e421b803decb661d40e234 |
|
MD5 | 2d88ad775d18e73ba56a1d943a368a3e |
|
BLAKE2b-256 | 87b7f1fd11a2878ee12ae7c1a68411a1d12242c57b7281a5da6f2fbf2bef62ab |
File details
Details for the file clustice-0.7.1-py3-none-any.whl
.
File metadata
- Download URL: clustice-0.7.1-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.2 CPython/3.11.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccdc9e76ff9ee04dc98f6b2f1cd60a0f5fdcabcaeb554e7dd565e4926818d526 |
|
MD5 | c2d50cca04725b3cf1f01a7411a8044b |
|
BLAKE2b-256 | 20e2956621c2b0d085076d9c3d3c8a76229610e8cee70dd7ebba7f628f1c110b |