Hi, I was wondering is there a way to create atoms exactly on the surface of a sphere?
by given the following parameters, the radius of sphere and the average distance between atoms on the surface (or atom density).
I understand that one can define two spherical regions with slightly difference radius, then use intersect to get a shell. And create atoms in that shell. However, atoms created by this does not perfectly lie on the spherical surface.
You could write a program that creates those positions and output them as a data file or a file that can be read by either OVITO or VMD and then output by them as a data file. Please note that having atoms evenly spaced on a spherical surface requires some advanced geometry knowledge. 
True, but you use this as a starting point and perhaps use some features of the MANIFOLD package to have the atoms align properly on a sphere. Check out: fix manifoldforce command ā LAMMPS documentation
Your guidance help me a lot, thank you.
I came across this issue in the past and used spherical coordinates --which have the disadvantage that if you sample linearly on sperical coordinates, you end up having more points at the poles and less in the equator. A better strategy is to to use a Fibonacci series (thanks to @stukowski for the python code):
import math
import numpy as np
def fibonacci_sphere(samples):
""" Fibonacci sphere algorithm for evenly distributing N points over a unit sphere.
See https://stackoverflow.com/questions/9600801/evenly-distributing-n-points-on-a-sphere
Function returns an Nx3 array with points on a sphere.
"""
points = np.empty((samples, 3))
for i in range(samples):
y = i * 2 / samples - 1.0 + 1.0 / samples
r = math.sqrt(1.0 - y*y)
phi = i * math.pi * (3.0 - math.sqrt(5.0))
x = math.cos(phi) * r
z = math.sin(phi) * r
points[i] = (x,y,z)
return points
Then you need to multiply the coordinates by the radius. It works for ellipsoids too!
3 Likes
Iām appreciated your help, thank you