Skip to main content

A vectorized “near neighbors” algorithm of order N using a monotonic logical grid

  • Conference paper
  • First Online:
The Free-Lagrange Method

Part of the book series: Lecture Notes in Physics ((LNP,volume 238))

Abstract

In free Lagrangian representations of fluid dynamics, the fluid is assigned to discretized parcels which are defined throughout the flow by a large number of nodes moving with the local fluid velocity. These Lagrangian nodes define a finite difference or finite element grid for calculating fluid dynamic averages and driving gradients in the vicinity of the fluid parcels. Because the nodes move with the fluid, the convective terms in continuity equations governing the flow are transformed away. Thus unwanted numerical diffusion is reduced greatly or eliminated. The price for this improved numerical accuracy is having to compute derivatives in a complicated shifting geometry and having to keep track of which of the many Lagrangian nodes are nearby.

When N nodes move essentially randomly in space, N*(N-1)/2 interactions might be important in determining how a given node moves. The exact positions and velocities of the neighboring nodes must be known. Knowing statistical averages and the general properties of the Lagrangian fluid parcels currently nearby does not provide enough data to compute local interactions accurately. At any instant a given Lagrangian node may interact strongly with only a few of the others. Unfortunately, keeping track of the other nodes with which it interacts or recomputing them each timestep is computationally very expensive. The goal is efficient, simple algorithms which select only the important near neighbor without having to check all N-squared interactions. Effort on the near neighbors problem has persisted in computational physics for several decades. To date the best algorithms scale nominally as N, or N log N rather than N2, but they are scalar algorithms and address memory randomly using linked lists.

This report introduces a simple three-dimensional nearest-neighbors algorithm whose cost scales as N(1+ ε log N) with e a small coefficient, not as the square of N, and which vectorizes using data from contiguous memory locations. A compact data structure to store the object data, called a Monotonic Logical Grid (MLG), is defined dynamically so that nodes which are adjacent in real space automatically have close address indices in the MLG data arrays as well. As two nodes move past each other in space, their data are exchanged or “swapped” in the MLG data arrays

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. R.W. Hockney and J.W. Eastwood, “Computer Simulation Using Particles”, Chapter 8, pp267–304 (McGraw-Hill Inc, New York, 1981).

    Google Scholar 

  2. W.F. Gunsteren, H.J.C. Berendsen, F. Colonna, D. Perahia, J.P. Hollenberg, and D. Lellouch, “On Searching Neighbors in Computer Simulations of Macromolecular Systems”, Journal of Computational Chemistry, Vol. 5, No. 3, pp272–279 (1984).

    Google Scholar 

  3. G.C. Fox and S.W. Otto, “Algorithms for Concurrent Processors”, Physics Today, pp50–59, May 1984.

    Google Scholar 

  4. L.M. Adams and H.F. Jordan, “Is SOR Color-Blind?”, ICASE Report No. 84–14, NASA Langley Research Center, May 1984.

    Google Scholar 

  5. J.P. Boris, M. Fritts, and K.L. Hain, “Free Surface Hydrodynamics Using a Lagrangian Triangular Mesh”, Proceedings of the First International Conference on Numerical Ship Hydrodynamics, Gaithersburg, MD, October 20–22, 1975.

    Google Scholar 

  6. M.J. Fritts and J.P. Boris, “The Lagrangian Solution of Transient Problems in Hydrodynamics Using a Triangular Mesh”, J. Comp. Phys., Vol 31, No 2, p173, May 1979.

    Article  Google Scholar 

  7. W.P. Crowley, “FLAG: A Free Lagrange Method for Numerically Simulating Hydrodynamic Flows in Two Dimensions”, Proceedings of the Second International Conference on Numerical Methods in Fluid Dynamics, (Springer-Verlag, New York, 1971).

    Google Scholar 

  8. C.R. Devore, “Vectorization and Implementation of an Efficient Multigrid Algorithm for the Solution of Elliptic Partial Differential Equations”, NRL Memorandum Report, October, 1984.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Martin J. Fritts W. Patrick Crowley Harold Trease

Rights and permissions

Reprints and permissions

Copyright information

© 1985 Springer-Verlag

About this paper

Cite this paper

Boris, J.P., Lambrakos, S.G. (1985). A vectorized “near neighbors” algorithm of order N using a monotonic logical grid. In: Fritts, M.J., Crowley, W.P., Trease, H. (eds) The Free-Lagrange Method. Lecture Notes in Physics, vol 238. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0032246

Download citation

  • DOI: https://doi.org/10.1007/BFb0032246

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-15992-6

  • Online ISBN: 978-3-540-39697-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics