Back to Search
Start Over
A resistive magnetohydrodynamics solver using modern C++ and the Boost library
- Source :
- Computer Physics Communications. 206:69-77
- Publication Year :
- 2016
- Publisher :
- Elsevier BV, 2016.
-
Abstract
- In this paper we describe the implementation of our C++ resistive magnetohydrodynamics solver. The framework developed facilitates the separation of the code implementing the specific numerical method and the physical model from the handling of boundary conditions and the management of the computational domain. In particular, this will allow us to use finite difference stencils which are only defined in the interior of the domain (the boundary conditions are handled automatically). We will discuss this and other design considerations and their impact on performance in some detail. In addition, we provide a documentation of the code developed and demonstrate that a performance comparable to Fortran can be achieved, while still maintaining a maximum of code readability and extensibility. Program summary Program title: cppmhd Catalogue identifier: AFAH_v1_0 Program summary URL: http://cpc.cs.qub.ac.uk/summaries/AFAH_v1_0.html Program obtainable from: CPC Program Library, Queen’s University, Belfast, N. Ireland Licensing provisions: Standard CPC licence, http://cpc.cs.qub.ac.uk/licence/licence.html No. of lines in distributed program, including test data, etc.: 592774 No. of bytes in distributed program, including test data, etc.: 43771395 Distribution format: tar.gz Programming language: C++03. Computer: PC, HPC systems. Operating system: POSIX compatible (extensively tested on various Linux systems). In fact only the timing class requires POSIX routines; all other parts of the program can be run on any system where a C++ compiler, Boost, CVODE, and an implementation of BLAS are available. RAM: Hundredths of Kilobytes to Gigabytes (depending on the problem size) Classification: 19.10, 4.3. External routines: Boost, CVODE, either a BLAS library or Intel MKL Nature of problem: An approximate solution to the equations of resistive magnetohydrodynamics for a given initial value and given boundary conditions is computed. Solution method: The discretization is performed using a finite difference approximation in space and the CVODE library in time (which employs a scheme based on the backward differentiation formulas). Restrictions: We consider the 2.5 dimensional case; that is, the magnetic field and the velocity field are three dimensional but all quantities depend only on x and y (but not z). Unusual features: We provide an implementation in C++ using the Boost library that combines high level techniques (which greatly increases code maintainability and extensibility) with performance that is comparable to Fortran implementations. Running time: From seconds to weeks (depending on the problem size).
- Subjects :
- Computer science
Fortran
General Physics and Astronomy
Byte
010103 numerical & computational mathematics
Parallel computing
Solver
computer.software_genre
01 natural sciences
Domain (software engineering)
010101 applied mathematics
Template
Hardware and Architecture
POSIX
Compiler
0101 mathematics
computer
Test data
computer.programming_language
Subjects
Details
- ISSN :
- 00104655
- Volume :
- 206
- Database :
- OpenAIRE
- Journal :
- Computer Physics Communications
- Accession number :
- edsair.doi...........320da82d147c70f12d554d9b500babea
- Full Text :
- https://doi.org/10.1016/j.cpc.2016.04.015