Comput. Phys. Commun. | 2021
TurboPy: A lightweight python framework for computational physics
Abstract
Abstract Computational physics problems often have a common set of aspects to them that any particular numerical code will have to address. Because these aspects are common to many problems, having a framework already designed and ready to use will not only speed the development of new codes, but also enhance compatibility between codes. Some of the most common aspects of computational physics problems are: a grid, a clock which tracks the flow of the simulation, and a set of models describing the dynamics of various quantities on the grid. Having a framework that could deal with these basic aspects of the simulation in a common way could provide great value to computational scientists by solving various numerical and class design issues that routinely arise. This paper describes the newly developed computational framework that we have built for rapidly prototyping new physics codes. This framework, called turboPy, is a lightweight physics modeling framework based on the design of the particle-in-cell code turboWAVE. It implements a class (called Simulation ) which drives the simulation and manages communication between physics modules, a class (called PhysicsModule ) which handles the details of the dynamics of the various parts of the problem, and some additional classes such as a Grid class and a Diagnostic class to handle various ancillary issues that commonly arise. Program summary Program Title: TurboPy CPC Library link to program files: http://dx.doi.org/10.17632/rznn6s5myw.1 Developer’s repository link: https://github.com/NRL-Plasma-Physics-Division/turbopy Licensing provisions: CC0 1.0 Programming language: Python Nature of problem: Many computation physics problems have a common set of aspects to them that are often addressed in a custom way in every different code, which leads to lengthy and redundant development and testing, as well as introducing roadblocks to interoperability. Solution method: Implement a set of python classes as a lightweight framework that deals with these common problems, so that development time on new computational physics codes is reduced, and interoperability and reusability are increased. References: A.S. Richardson et\xa0al., TurboPy: A lightweight computational physics framework. NRL-Plasma-Physics-Division/turbopy (v2020.08.05). doi:10.5281/zenodo.3973693