356 research outputs found
High performance Python for direct numerical simulations of turbulent flows
Direct Numerical Simulations (DNS) of the Navier Stokes equations is an
invaluable research tool in fluid dynamics. Still, there are few publicly
available research codes and, due to the heavy number crunching implied,
available codes are usually written in low-level languages such as C/C++ or
Fortran. In this paper we describe a pure scientific Python pseudo-spectral DNS
code that nearly matches the performance of C++ for thousands of processors and
billions of unknowns. We also describe a version optimized through Cython, that
is found to match the speed of C++. The solvers are written from scratch in
Python, both the mesh, the MPI domain decomposition, and the temporal
integrators. The solvers have been verified and benchmarked on the Shaheen
supercomputer at the KAUST supercomputing laboratory, and we are able to show
very good scaling up to several thousand cores.
A very important part of the implementation is the mesh decomposition (we
implement both slab and pencil decompositions) and 3D parallel Fast Fourier
Transforms (FFT). The mesh decomposition and FFT routines have been implemented
in Python using serial FFT routines (either NumPy, pyFFTW or any other serial
FFT module), NumPy array manipulations and with MPI communications handled by
MPI for Python (mpi4py). We show how we are able to execute a 3D parallel FFT
in Python for a slab mesh decomposition using 4 lines of compact Python code,
for which the parallel performance on Shaheen is found to be slightly better
than similar routines provided through the FFTW library. For a pencil mesh
decomposition 7 lines of code is required to execute a transform
Finite Difference Computing with Exponential Decay Models
Computational Science and Engineering; software Engineering; Programming Technique
Pulse-induced acoustoelectric vibrations in surface-gated GaAs-based quantum devices
We present the results of a numerical investigation which show the excitation
of acoustoelectric modes of vibration in GaAs-based heterostructures due to
sharp nano-second electric-field pulses applied across surface gates. In
particular, we show that the pulses applied in quantum information processing
applications are capable of exciting acoustoelectric modes of vibration
including surface acoustic modes which propagate for distances greater than
conventional device dimensions. We show that the pulse-induced acoustoelectric
vibrations are capable of inducing significant undesired perturbations to the
evolution of quantum systems.Comment: To be published in Phys. Rev.
Unified Framework for Finite Element Assembly
At the heart of any finite element simulation is the assembly of matrices and
vectors from discrete variational forms. We propose a general interface between
problem-specific and general-purpose components of finite element programs.
This interface is called Unified Form-assembly Code (UFC). A wide range of
finite element problems is covered, including mixed finite elements and
discontinuous Galerkin methods. We discuss how the UFC interface enables
implementations of variational form evaluation to be independent of mesh and
linear algebra components. UFC does not depend on any external libraries, and
is released into the public domain
Programming for Computations - Python: A Gentle Introduction to Numerical Simulations with Python
Numerical simulations; programming; Pytho
Solving PDEs in Python
This book offers a concise and gentle introduction to finite element programming in Python based on the popular FEniCS software library. Using a series of examples, including the Poisson equation, the equations of linear elasticity, the incompressible Navier–Stokes equations, and systems of nonlinear advection–diffusion–reaction equations, it guides readers through the essential steps to quickly solving a PDE in FEniCS, such as how to define a finite variational problem, how to set boundary conditions, how to solve linear and nonlinear systems, and how to visualize solutions and structure finite element Python programs. This book is open access under a CC BY license
- …