WarpX structure¶
Repo organization¶
All the WarpX source code is located in Source/. All sub-directories have a pretty straigtforward name. The PIC loop is part of the WarpX class, in function WarpX::EvolveEM implemented in Source/WarpXEvolveEM.cpp. The core of the PIC loop (i.e., without diagnostics etc.) is in WarpX::OneStep_nosub (when subcycling is OFF) or WarpX::OneStep_sub1 (when subcycling is ON, with method 1).
Code organization¶
The main WarpX class is WarpX, implemented in Source/WarpX.cpp.
Build system¶
WarpX uses the AMReX build system (GNUMake).
Each sub-folder contains a file Make.package with the names of source files (.cpp) that are added to the build.
Do not list header files (.H) here.
C++ Includes¶
All WarpX header files need to be specified relative to the Source/ directory.
e.g.
#include "Utils/WarpXConst.H"files in the same directory as the including header-file can be included with
#include "FileName.H"
The include order and proper quotation marks are:
In a
<MyName>.cppfile:#include "<MyName>.H"(its header) then(further) WarpX header files
#include "..."thenPICSAR and AMReX header files
#include <...>thenother third party includes
#include <...>thenstandard library includes, e.g.
#include <vector>
For details why this is needed, please see PR #874, the LLVM guidelines, and include-what-you-use.
WarpX-specific vocabulary¶
Evolveis a generic term to advance a quantity (this comes from AMReX). For instance,WarpX::EvolveE(dt)advances the electric field for durationdt,PhysicalParticleContainer::Evolve(...)does field gather + particle push + current deposition for all particles inPhysicalParticleContainer, andWarpX::EvolveEMis the centralWarpXfunction that performs 1 PIC iteration.