mbuild
mbuild copied to clipboard
Adding ports to surfaces of arbitrary shape - Detection of normal direction
Given a surface or arbitrary shape, be able to identify locations where ports should be added. Determine the direction normal to the surface and add a port in this direction.
The interface should probably look something along the lines of:
mb.add_surface_ports(surface, binding_site_types='OS')
where binding_site_types
can be a list of eligible atom names.
We could maybe approach this by utilizing the method Ahmed was using for interface detection for his dynamic cutoff work.
(Image taken from: Springer, Ismail, and Bientinesi, "A Scalable, Linear-Time Dynamic Cutoff Algorithm for Molecular Dynamics", Proceedings of the International Supercomputing Conference (ISC), July 2015, Accepted.)
Using this to find the structure of the interface around a binding site, determining the normal direction (or at least a vector close to the actual normal) should be fairly easy.
Hmmm it might be worth trying out. Any interest in giving it a try?
My main worry is that this won't provide the fidelity we really need. We would need fairly small voxels to differentiate atoms that are just too low or at just too acute an angle with their neighbors to qualify but if we make them too small we run the risk of having some empty voxels right in around the atoms.
Hopefully sometime this week or more likely next I'll give the convex hull approach a try but if that fails I'll try this too.
For the amorphous silica, I poked the surface using a regular grid (you can specify the probe size). I'll note that I first identified surface particles by doing a rough cell-list (like ahmed's voxel approach), so that I was always starting the probe from just above where I thought the surface was. For the propane+nanowire paper with Will (http://dx.doi.org/10.1021/jp203837r) we shot particles at the surface from various directions (this might work better for arbitrary shapes).
Just randomly found this. Haven't tried it but looks relevant
http://stackoverflow.com/questions/20410501/how-to-estimate-local-tangent-plane-for-3d-points