Extending and Modifying LAMMPS Writing Your Own Source Code
eBook - ePub

Extending and Modifying LAMMPS Writing Your Own Source Code

Dr. Shafat Mubin, Jichen Li, Dr. Steven Plimpton

Buch teilen
  1. 394 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Extending and Modifying LAMMPS Writing Your Own Source Code

Dr. Shafat Mubin, Jichen Li, Dr. Steven Plimpton

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Understand the LAMMPS source code and modify it to meet your research needs, and run simulations for bespoke applications involving forces, thermostats, pair potentials and more with easeKey Features• Understand the structure of the LAMMPS source code• Implement custom features in the LAMMPS source code to meet your research needs• Run example simulations involving forces, thermostats, and pair potentials based on implemented featuresBook DescriptionLAMMPS is one of the most widely used tools for running simulations for research in molecular dynamics. While the tool itself is fairly easy to use, more often than not you'll need to customize it to meet your specific simulation requirements. Extending and Modifying LAMMPS bridges this learning gap and helps you achieve this by writing custom code to add new features to LAMMPS source code. Written by ardent supporters of LAMMPS, this practical guide will enable you to extend the capabilities of LAMMPS with the help of step-by-step explanations of essential concepts, practical examples, and self-assessment questions. This LAMMPS book provides a hands-on approach to implementing associated methodologies that will get you up and running and productive in no time. You'll begin with a short introduction to the internal mechanisms of LAMMPS, and gradually transition to an overview of the source code along with a tutorial on modifying it. As you advance, you'll understand the structure, syntax, and organization of LAMMPS source code, and be able to write your own source code extensions to LAMMPS that implement features beyond the ones available in standard downloadable versions. By the end of this book, you'll have learned how to add your own extensions and modifications to the LAMMPS source code that can implement features that suit your simulation requirements.What you will learn• Identify how LAMMPS input script commands are parsed within the source code• Understand the architecture of the source code• Relate source code elements to simulated quantities• Learn how stored quantities are accessed within the source code• Explore the mechanisms controlling pair styles, computes, and fixes• Modify the source code to implement custom features in LAMMPSWho this book is forThis book is for students, faculty members, and researchers who are currently using LAMMPS or considering switching to LAMMPS, have a basic knowledge of how to use LAMMPS, and are looking to extend LAMMPS source code for research purposes. This book is not a tutorial on using LAMMPS or writing LAMMPS scripts, and it is assumed that the reader is comfortable with the basic LAMMPS syntax. The book is geared toward users with little to no experience in source code editing. Familiarity with C++ programming is helpful but not necessary.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Extending and Modifying LAMMPS Writing Your Own Source Code als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Extending and Modifying LAMMPS Writing Your Own Source Code von Dr. Shafat Mubin, Jichen Li, Dr. Steven Plimpton im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Computer Science & Programming. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2021
ISBN
9781800567238

Section 1: Getting Started with LAMMPS

A LAMMPS input script performs molecular dynamics simulations according to the input commands provided. But what happens behind the scenes as each command is parsed and executed? How are these commands processed and how are relevant calculations invoked within the source code?
This section introduces you to molecular dynamics theory and standard simulation practices that are implemented in LAMMPS, along with the corresponding syntax. The theory and practices will be revisited in later sections when the LAMMPS source code is analyzed.
This section comprises the following chapters:
  • Chapter 1, MD Theory and Simulation Practices
  • Chapter 2, LAMMPS Syntax and Source Code Repository

Chapter 1: MD Theory and Simulation Practices

This chapter introduces the theory behind molecular dynamics (MD) and some common simulation practices. Starting from Newton's laws, we outline the physics behind the dynamics of point particles and rigid bodies, discuss iterative updating and the relevance of temperature, and end by listing computational practices.
In this chapter, we will cover the follow topics:
  • Introducing MD theory
  • Understanding the dynamics of point particles
  • Performing iterative updates using the Velocity Verlet algorithm
  • Understanding rotational motion
  • Examining temperature and velocity distribution of particles
  • Implementing MD simulation practices including cutoff, periodic boundaries, and neighbor lists
By the end of this chapter, you will have grasped an understanding of the theoretical fundamentals implemented in MD software.

Technical requirements

You can find the full source code used in this book here: https://github.com/PacktPublishing/Extending-and-Modifying-LAMMPS-Writing-Your-Own-Source-Code

Introducing MD theory

MD is based on simulating individual particle trajectories over a desired time period to analyze the time evolution of an entire system of particles in a solid, liquid, or gaseous state. Each particle (usually an atom) is allowed to traverse in space as determined by Newton's laws of classical dynamics, where the atomic positions, velocities, and accelerations at one point in time are used to calculate the corresponding kinematics quantities at a different point in time. This process is repeated over a sufficiently long-time interval for every atom in a system, and the final configuration of the atoms indicates the time evolution of the system over the said time interval.
Typical MD simulations are limited to the study of atomistic systems consisting of atoms in the range of
to
, occupying a simulation box with a length in the order of nanometers, over a regular timescale of nanoseconds. MD simulations of such microscopic systems are relevant when the systems are able to represent the time evolution of corresponding macroscopic systems.
The theory behind MD is described briefly in the following sections. For a more detailed understanding, you are advised to refer to the dedicated literature on MD theory (Computer Simulation of Liquids by Michael P. Allen and Dominic J. Tildesley, and Understanding Molecular Simulation by Daan Frenkel and Berend Smit).

Understanding the dynamics of point particles

The trajectory
of a point particle over time t is calculated from its mass m and net force
using Newton's equation, as illustrated here:
is determined from the sum of all forces acting on the particle. In a system of interacting particles, the force
acting between one pair of particles can be determined from the gradient of the potential energy function
. Here,
is the displacement vector that points to the particle for which we are calculating
(using the following equation) and originates from the other particle in the pair (shown in Figure 1.1):
This gives us the three components of
. The (x) force component is given as follows:
The (y) force component is calculated by the following formula:
The (z) force component is given by the following formula:
Here,
is the distance between the pair of particles. By Newton's third law, it follows that the force components acting on the other particle in the pair have the same magnitudes, with...

Inhaltsverzeichnis