FIND_SPHERICAL_CONTOUR

Find an isocontour in a three dimensional grid by searching over a Fibonacci sphere.

As discussed in the part of the manual on Analysis PLUMED contains a number of tools that allow you to calculate a function on a grid. The function on this grid might be a HISTOGRAM as a function of a few collective variables or it might be a phase field that has been calcualted using MULTICOLVARDENS. If this function has one or two input arguments it is relatively straightforward to plot the function. If by contrast the data has a three dimensions it can be difficult to visualize.

This action provides one tool for visualizing these functions. It can be used to search for a set of points on a contour wher the function takes a particular value. In other words, for the function \(f(x,y,z)\) this action would find a set of points \(\{x_c,y_c,z_c\}\) that have:

\[ f(x_c,y_c,z_c) - c = 0 \]

where \(c\) is some constant value that is specified by the user. The points on this contour are find by searching along a set of equally spaced radii of a sphere that centered at on particular, user-speciified atom or virtual atom. To ensure that these search radii are equally spaced on the surface of the sphere the search directions are generated by using a fibonacci spiral projected on a sphere. In other words, the search directions are given by:

\[ \mathbf{r}_i = \left( \begin{matrix} \sqrt{1 - y^2} \cos(\phi) \\ \frac{2i}{n} - 1 + \frac{1}{n} \\ \sqrt{1 - y^2} \sin(\phi) \end{matrix} \right) \]

where \(y\) is the quantity second component of the vector defined above, \(n\) is the number of directions to look in and \(\phi\) is

\[ \phi = \mod(i + R, n) \pi ( 3 - \sqrt{5} ) \]

where \(R\) is a random variable between 0 and \(n-1\) that is generated during the read in of the input file and that is fixed during the whole calculation.

It is important to note that this action can only be used to detect countours in three dimensional functions. In addition, this action will fail to find the full set of contour points if the contour does not have the same topology as a sphere. If you are uncertain that the isocontours in your function have a spherical topology you should use FIND_CONTOUR in place of FIND_SPHERICAL_CONTOUR.

- Compulsory keywords

STRIDE | ( default=1 ) the frequency with which the data should be collected and added to the quantity being averaged |

GRID | the action that creates the input grid you would like to use |

CONTOUR | the value we would like to draw the contour at in the space |

FILE | file on which to output coordinates |

UNITS | ( default=PLUMED ) the units in which to print out the coordinates. PLUMED means internal PLUMED units |

NPOINTS | the number of points for which we are looking for the contour |

INNER_RADIUS | the minimum radius on which to look for the contour |

OUTER_RADIUS | the outer radius on which to look for the contour |

NBINS | ( default=1 ) the number of discrete sections in which to divide the distance between the inner and outer radius when searching for a contour |

- Options

SERIAL | ( default=off ) do the calculation in serial. Do not parallelize |

LOWMEM | ( default=off ) lower the memory requirements |

TIMINGS | ( default=off ) output information on the timings of the various parts of the calculation |

UNORMALIZED | ( default=off ) output the unaveraged quantity/quantities. |

LOGWEIGHTS | list of actions that calculates log weights that should be used to weight configurations when calculating averages |

COMPONENT | if your input is a vector field use this to specifiy the component of the input vector field for which you wish to use |

PRECISION | The number of digits in trajectory file |

- Examples

The following input demonstrates how this action can be used. The input here is used to study the shape of a droplet that has been formed during the condensation of Lennard Jones from the vapour. The input below achieves this by calculating the coordination numbers of all the atoms within the gas. Obviously, those atoms within the droplet will have a large value for the coordination number while the isolated atoms in the gas will have a low value. As such we can detect the sizes of the droplets by constructing a CONTACT_MATRIX whose \(ij\) element tells us whether atom \(i\) and atom \(j\) have coordination number that is greater that two. The atoms within the various droplets within the system can then be found by performing a DFSCLUSTERING on this matrix to detect the connected components. We can take the largest of these connected components and find the center of the droplet by exploiting the functionality within CENTER_OF_MULTICOLVAR. We can then construct a phase field based on the positions of the atoms in the largest cluster and the values of the coordination numbers of these atoms. The final line in the input then finds the a set of points on the dividing surface that separates teh droplet from the surrounding gas. The value of the phase field on this isocontour is equal to 0.75.

# Calculate coordination numbers c1: COORDINATIONNUMBER SPECIES=1-512 SWITCH={EXP D_0=4.0 R_0=0.5 D_MAX=6.0} # Select coordination numbers that are more than 2.0 cf: MFILTER_MORE DATA=c1 SWITCH={RATIONAL D_0=2.0 R_0=0.1} LOWMEM # Build a contact matrix mat: CONTACT_MATRIX ATOMS=cf SWITCH={EXP D_0=4.0 R_0=0.5 D_MAX=6.0} # Find largest cluster dfs: DFSCLUSTERING MATRIX=mat clust1: CLUSTER_PROPERTIES CLUSTERS=dfs CLUSTER=1 # Find center of largest cluster trans1: MTRANSFORM_MORE DATA=clust1 SWITCH={RATIONAL D_0=2.0 R_0=0.1} LOWMEM cent: CENTER_OF_MULTICOLVAR DATA=trans1 # Calculate the phase field of the coordination dens: MULTICOLVARDENS DATA=trans1 ORIGIN=cent DIR=xyz NBINS=30,30,30 BANDWIDTH=2.0,2.0,2.0 # Find the isocontour around the nucleus FIND_SPHERICAL_CONTOUR GRID=dens CONTOUR=0.85 INNER_RADIUS=10.0 OUTER_RADIUS=40.0 FILE=mysurface.xyz UNITS=A PRECISION=4 NPOINTS=100