mosdef-hub / mbuild

A hierarchical, component based molecule builder
https://mbuild.mosdef.org
Other
171 stars 80 forks source link

Adding ports to surfaces of arbitrary shape - Detection of normal direction #108

Open summeraz opened 9 years ago

summeraz commented 9 years ago

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.

ctk3b commented 9 years ago

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.

summeraz commented 9 years ago

We could maybe approach this by utilizing the method Ahmed was using for interface detection for his dynamic cutoff work. screen shot 2015-08-17 at 5 46 47 pm (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.

ctk3b commented 9 years ago

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.

chrisiacovella commented 9 years ago

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).

ctk3b commented 7 years ago

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