Skip to content

Commit

Permalink
Docs: Update Repo-Structure (#2039)
Browse files Browse the repository at this point in the history
- update build system references
- move "evolve" term to glossary
- update titles to typical spelling
- minor formatting
  • Loading branch information
ax3l authored Jun 28, 2021
1 parent 82600d8 commit add16de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Docs/source/developers/repo_organization.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
.. _developers-repo-structure:

WarpX structure
WarpX Structure
===============

Repo organization
Repo Organization
-----------------

All the WarpX source code is located in ``Source/``. All sub-directories have a pretty straightforward 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).
All the WarpX source code is located in ``Source/``.
All sub-directories have a pretty straightforward 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
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.
WarpX uses the :ref:`CMake build system generator <building-cmake>`.
Each sub-folder contains a file ``CMakeLists.txt`` with the names of the source files (``.cpp``) that are added to the build.
Do not list header files (``.H``) here.

For experienced developers, we also support AMReX' :ref:`GNUmake build script collection <developers-gnumake>`.
The file ``Make.package`` in each sub-folder has the same purpose as the ``CMakeLists.txt`` file, please add new ``.cpp`` files to both dirs.

C++ Includes
------------

Expand Down Expand Up @@ -62,7 +68,7 @@ Each of these groups of header files should ideally be sorted alphabetically, an

For details why this is needed, please see `PR #874 <https://github.com/ECP-WarpX/WarpX/pull/874#issuecomment-607038803>`_, `PR #1947 <https://github.com/ECP-WarpX/WarpX/pull/1947>`_, the `LLVM guidelines <https://llvm.org/docs/CodingStandards.html#include-style>`_, and `include-what-you-use <https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/WhyIWYU.md>`_.

Forward declaration headers
Forward Declaration Headers
---------------------------
Forward declarations can be used when a header file needs only to know that a given class exists, without any further detail (e.g., when only a pointer to an instance of
that class is used). Forward declaration headers are a convenient way to organize forward declarations. If a forward declaration is needed for a given class ``MyClass``, declared in ``MyClass.H``,
Expand Down Expand Up @@ -97,7 +103,3 @@ Usage: in ``SimpleUsage.H``
#include "MyClass_fwd.H"
#include <memory>
WarpX-specific vocabulary
-------------------------

- ``Evolve`` is a generic term to advance a quantity (this comes from AMReX). For instance, ``WarpX::EvolveE(dt)`` advances the electric field for duration ``dt``, ``PhysicalParticleContainer::Evolve(...)`` does field gather + particle push + current deposition for all particles in ``PhysicalParticleContainer``, and ``WarpX::EvolveEM`` is the central ``WarpX`` function that performs 1 PIC iteration.
4 changes: 4 additions & 0 deletions Docs/source/glossary.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _glossary:

Glossary
========

Expand Down Expand Up @@ -42,6 +44,8 @@ Terms
* **accelerator:** depending on context, either a *particle accelerator* in physics or a *hardware accelerator* (e.g. GPU) in computing
* **AMReX:** `C++ library for block-structured adaptive mesh-refinement <https://amrex-codes.github.io/>`__, a primary dependency of WarpX
* **boosted frame:** a :ref:`Lorentz-boosted frame of reference <theory-boostedframe>` for a simulation
* **evolve:** this is a generic term to advance a quantity (same nomenclature in AMReX).
For instance, ``WarpX::EvolveE(dt)`` advances the electric field for duration ``dt``, ``PhysicalParticleContainer::Evolve(...)`` does field gather + particle push + current deposition for all particles in ``PhysicalParticleContainer``, and ``WarpX::EvolveEM`` is the central ``WarpX`` function that performs 1 PIC iteration.
* **Frontier:** an `Exascale supercomputer at OLCF <https://www.olcf.ornl.gov/frontier/>`__
* **laser:** most of the time, we mean a `laser pulse <https://en.wikipedia.org/wiki/Ultrashort_pulse>`__
* **openPMD**: `Open Standard for Particle-Mesh Data Files <https://www.openPMD.org>`__, a community meta-data project for scientific data
Expand Down

0 comments on commit add16de

Please sign in to comment.