Menu
Syntax
- style = lookup or linear or spline or bitmap = method of interpolation
- N = use N values in lookup, linear, spline tables
- N = use 2^N values in bitmap tables
- zero or more keywords may be appended
- keyword = ewald or pppm or msm or dispersion or tip4p
In our previous paper [27], we demonstrated that the self-assembly process can interpolate points in between the EB-generated pattern, thus attaining. [Show full abstract] four-fold density. Sep 17, 2012 - Summary: When doing prepping points for construction stakeouts it would be great to interpolate points along a curve or Polyline.
Examples
Description
Style table creates interpolation tables from potential energy andforce values listed in a file(s) as a function of distance. Whenperforming dynamics or minimization, the interpolation tables are usedto evaluate energy and forces for pairwise interactions betweenparticles, similar to how analytic formulas are used for other pairstyles.
The interpolation tables are created as a pre-computation by fittingcubic splines to the file values and interpolating energy and forcevalues at each of N distances. During a simulation, the tables areused to interpolate energy and force values as needed for each pair ofparticles separated by a distance R. The interpolation is done inone of 4 styles: lookup, linear, spline, or bitmap.
For the lookup style, the distance R is used to find the nearesttable entry, which is the energy or force.
For the linear style, the distance R is used to find the 2surrounding table values from which an energy or force is computed bylinear interpolation.
For the spline style, a cubic spline coefficients are computed andstored for each of the N values in the table, one set of splines forenergy, another for force. Note that these splines are different thanthe ones used to pre-compute the N values. Those splines were fitto the Nfile values in the tabulated file, where often Nfile <N. The distance R is used to find the appropriate set of splinecoefficients which are used to evaluate a cubic polynomial whichcomputes the energy or force.
For the bitmap style, the specified N is used to createinterpolation tables that are 2^N in length. The distance R is usedto index into the table via a fast bit-mapping technique due to(Wolff), and a linear interpolation is performed betweenadjacent table values.
The following coefficients must be defined for each pair of atomstypes via the pair_coeff command as in the examplesabove.
- filename
- keyword
- cutoff (distance units)
The filename specifies a file containing tabulated energy and forcevalues. The keyword specifies a section of the file. The cutoff isan optional coefficient. If not specified, the outer cutoff in thetable itself (see below) will be used to build an interpolation tablethat extend to the largest tabulated distance. If specified, onlyfile values up to the cutoff are used to create the interpolationtable. The format of this file is described below.
If your tabulated potential(s) are designed to be used as theshort-range part of one of the long-range solvers specified by thekspace_style command, then you must use one ormore of the optional keywords listed above for the pair_style command.These are ewald or pppm or msm or dispersion or tip4p. Thisis so LAMMPS can insure the short-range potential and long-rangesolver are compatible with each other, as it does for othershort-range pair styles, such as pair_style lj/cut/coul/long. Note that it is up to you to insurethe tabulated values for each pair of atom types has the correctfunctional form to be compatible with the matching long-range solver.
Here are some guidelines for using the pair_style table command tobest effect:
- Vary the number of table points; you may need to use more than you thinkto get good resolution.
- Always use the pair_write command to produce a plotof what the final interpolated potential looks like. This can show upinterpolation “features” you may not like.
- Start with the linear style; it’s the style least likely to have problems.
- Use N in the pair_style command equal to the “N” in the tabulationfile, and use the “RSQ” or “BITMAP” parameter, so additional interpolationis not needed. See discussion below.
- Make sure that your tabulated forces and tabulated energies areconsistent (dE/dr = -F) over the entire range of r values. LAMMPSwill warn if this is not the case.
- Use as large an inner cutoff as possible. This avoids fitting splinesto very steep parts of the potential.
The format of a tabulated file is a series of one or more sections,defined as follows (without the parenthesized comments):
A section begins with a non-blank line whose 1st character is not a“#”; blank lines or lines starting with “#” can be used as commentsbetween sections. The first line begins with a keyword whichidentifies the section. The line can contain additional text, but theinitial text must match the argument specified in the pair_coeffcommand. The next line lists (in any order) one or more parametersfor the table. Each parameter is a keyword followed by one or morenumeric values.
The parameter “N” is required and its value is the number of tableentries that follow. Note that this may be different than the Nspecified in the pair_style table command. LetNtable = N in the pair_style command, and Nfile = “N” in thetabulated file. What LAMMPS does is a preliminary interpolation bycreating splines using the Nfile tabulated values as nodal points. Ituses these to interpolate energy and force values at Ntable differentpoints. The resulting tables of length Ntable are then used asdescribed above, when computing energy and force for individual pairdistances. This means that if you want the interpolation tables oflength Ntable to match exactly what is in the tabulated file (witheffectively no preliminary interpolation), you should set Ntable =Nfile, and use the “RSQ” or “BITMAP” parameter. This is because theinternal table abscissa is always RSQ (separation distance squared),for efficient lookup.
All other parameters are optional. If “R” or “RSQ” or “BITMAP” doesnot appear, then the distances in each line of the table are usedas-is to perform spline interpolation. In this case, the table valuescan be spaced in r uniformly or however you wish to position tablevalues in regions of large gradients.
If used, the parameters “R” or “RSQ” are followed by 2 values rloand rhi. If specified, the distance associated with each energy andforce value is computed from these 2 values (at high accuracy), ratherthan using the (low-accuracy) value listed in each line of the table.The distance values in the table file are ignored in this case.For “R”, distances uniformly spaced between rlo and rhi arecomputed; for “RSQ”, squared distances uniformly spaced betweenrlo*rlo and rhi*rhi are computed.
Note
If you use “R” or “RSQ”, the tabulated distance values in thefile are effectively ignored, and replaced by new values as describedin the previous paragraph. If the distance value in the table is notvery close to the new value (i.e. round-off difference), then you willbe assigning energy/force values to a different distance, which isprobably not what you want. LAMMPS will warn if this is occurring.
If used, the parameter “BITMAP” is also followed by 2 values rlo andrhi. These values, along with the “N” value determine the orderingof the N lines that follow and what distance is associated with each.This ordering is complex, so it is not documented here, since thisfile is typically produced by the pair_write commandwith its bitmap option. When the table is in BITMAP format, the “N”parameter in the file must be equal to 2^M where M is the valuespecified in the pair_style command. Also, a cutoff parameter cannotbe used as an optional 3rd argument in the pair_coeff command; theentire table extent as specified in the file must be used.
If used, the parameter “FPRIME” is followed by 2 values fplo andfphi which are the derivative of the force at the innermost andoutermost distances listed in the table. These values are needed bythe spline construction routines. If not specified by the “FPRIME”parameter, they are estimated (less accurately) by the first 2 andlast 2 force values in the table. This parameter is not used byBITMAP tables.
Following a blank line, the next N lines list the tabulated values.On each line, the 1st value is the index from 1 to N, the 2nd value isr (in distance units), the 3rd value is the energy (in energy units),and the 4th is the force (in force units). The r values must increasefrom one line to the next (unless the BITMAP parameter is specified).
Note that one file can contain many sections, each with a tabulatedpotential. LAMMPS reads the file section by section until it findsone that matches the specified keyword.
Styles with a gpu, intel, kk, omp, or opt suffix arefunctionally the same as the corresponding style without the suffix.They have been optimized to run faster, depending on your availablehardware, as discussed on the Speed packages docpage. The accelerated styles take the same arguments and shouldproduce the same results, except for round-off and precision issues.
These accelerated styles are part of the GPU, USER-INTEL, KOKKOS,USER-OMP and OPT packages, respectively. They are only enabled ifLAMMPS was built with those packages. See the Build package doc page for more info.
You can specify the accelerated styles explicitly in your input scriptby including their suffix, or you can use the -suffix command-line switch when you invoke LAMMPS, or you can use thesuffix command in your input script.
See the Speed packages doc page for moreinstructions on how to use the accelerated styles effectively.
Mixing, shift, table, tail correction, restart, rRESPA info:
This pair style does not support mixing. Thus, coefficients for allI,J pairs must be specified explicitly.
The pair_modify shift, table, and tail options arenot relevant for this pair style.
This pair style writes the settings for the “pair_style table” commandto binary restart files, so a pair_style command doesnot need to specified in an input script that reads a restart file.However, the coefficient information is not stored in the restartfile, since it is tabulated in the potential files. Thus, pair_coeffcommands do need to be specified in the restart input script.
This pair style can only be used via the pair keyword of therun_style respa command. It does not support theinner, middle, outer keywords.
Related commands
pair_coeff, pair_write
Default: none
(Wolff) Wolff and Rudd, Comp Phys Comm, 120, 200-32 (1999).
Line[{p1,p2,…}]
represents the line segments joining a sequence for points pi.
Line[{{p11,p12,…},{p21,…},…}]
represents a collection of lines.
- Line is also known as poly-line or line-segments.
- Line can be used as a geometric region or a graphics primitive.
- Line represents a piecewise linear curve where the segment from pi to pi+1 is given by .
- Line can be used in Graphics and Graphics3D.
- In graphics, the points pi can be Scaled, Offset, ImageScaled, and Dynamic expressions.
- Graphics rendering is affected by directives such as Thickness, Dashing, JoinForm, CapForm, and color.
- The following options and settings can be used in graphics:
VertexColors None vertex colors to be interpolated VertexNormals None effective vertex normals for shading - Line can be used with symbolic points in GeometricScene.
- Line is a graphics and geometry primitive that represents a geometric line segment or sequence of connected line segments (a 'poly-line'). The location of a Line connecting points in -dimensional space is specified as a list argument consisting of sublists, with each sublist containing Cartesian coordinate values. The coordinate sublists of Line objects may consist of exact or approximate values, where RegionEmbeddingDimension can be used to determine the dimension for a given Line expression. A collection of lines (or poly-lines) may be represented as a nested lists of -tuples inside a single Line primitive (a 'multiline'). The coordinates of Line objects may have exact or approximate values.
- Line objects can be visually formatted in two and three dimensions using Graphics and Graphics3D, respectively. Line objects can also be used in geographical maps using GeoGraphics and GeoPosition (e.g. GeoGraphics[Line[GeoPosition[{{38.9,-77.0},{40.1,-88.3}}]]]). In addition, Line may serve as a region specification over which a computation should be performed.
- While lines themselves have dimension 1 (as reported by the RegionDimension function) with zero thickness, Line objects in formatted graphics expressions are by default styled to appear 'thicker' than a one-dimensional mathematical line. Furthermore, in graphical visualizations, lines are displayed at the same size regardless of varying distances from the view point. The appearance of Line objects in graphics can be modified by specifying thickness directives such as Thickness, AbsoluteThickness, Thick, and Thin; dashing directives such as Dashing, AbsoluteDashing, Dashed, Dotted, and DotDashed; edge and cap directives EdgeForm and CapForm; color directives such as Red; the transparency directive Opacity; and the style option Antialiasing. In addition, the colors of multilines may be specified using VertexColors, while the shading and simulated lighting of multilines within Graphics3D may be specified using VertexNormals.
- GeometricTransformation and more specific transformation functions such as Translate and Rotate can be used to change the coordinates at which a Line object is displayed while leaving the underlying Line expression untouched.
- Other graphics primitives such as Tube, Arrow, HalfLine, and InfiniteLine may resemble those of stylized Line objects. While poly-lines consist only of straight line segments, smooth curves may be constructed via splines using BSplineCurve or BezierCurve or via an interpolating function using Interpolation. A function related to Line as a geometric region is Interval, which interprets pairs of numbers as endpoints of a line segment lying on the number line and which can be directly operated on using arithmetic and relational operators.
- While the Line primitive explicitly appears in graphics and geometric region specification expressions, it should be noted that coordinates are commonly represented as bare lists in other contexts in the Wolfram Language. However, a number of graphics functions including Plot, ParametricPlot, ParametricPlot3D, and ContourPlot return graphical expressions that explicitly include Line objects.
Basic Examples(4)
A line primitive:
In[2]:= |
Out[2]= |
Differently styled 2D lines:
In[1]:= |
Differently styled 3D lines:
In[1]:= |
Compute the ArcLength of a line:
Centroid:
In[2]:= |
Out[2]= |
Scope(24)
Options(3)
Applications(6)
Properties & Relations(4)
Possible Issues(1)
Neat Examples(4)
ArrowPolygonBezierCurveBSplineCurveTubeEdgeFormThickThinInfiniteLineListLinePlotPointHilbertCurveGeometricScene
- ▪▪▪
- ▪▪▪▪▪▪▪▪
(10.0)