aboutsummaryrefslogtreecommitdiff
path: root/Docs/source/developers/dimensionality.rst
blob: 607a62dcc1aaf8eab055f8b7aa3295abaa64b463 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.. _developers-dimensionality:

Dimensionality
==============

This section describes the handling of dimensionality in WarpX.

Build Options
-------------

==========  ===================
Dimensions  CMake Option
==========  ===================
**3D3V**    ``WarpX_DIMS=3``
**2D3V**    ``WarpX_DIMS=2``
**RZ**      ``WarpX_DIMS=RZ``
==========  ===================

See :ref:`building from source <install-developers>` for further details.

Defines
-------

Depending on the build variant of WarpX, the following preprocessor macros will be set:

==================  ===========  ===========  ===========
Macro               3D3V         2D3V         RZ
==================  ===========  ===========  ===========
``AMREX_SPACEDIM``  ``3``        ``2``        ``2``
``WARPX_DIM_3D``    **defined**  *undefined*  *undefined*
``WARPX_DIM_XZ``    *undefined*  **defined**  *undefined*
``WARPX_DIM_RZ``    *undefined*  *undefined*  **defined**
==================  ===========  ===========  ===========

At the same time, the following conventions will apply:

====================  ===========  ===========  ===========
**Convention**        **3D3V**     **2D3V**     **RZ**
--------------------  -----------  -----------  -----------
*Fields*
-----------------------------------------------------------
AMReX Box dimensions  ``3``         ``2``       ``2``
WarpX axis labels     ``x, y, z``   ``x, z``    ``x, z``
--------------------  -----------  -----------  -----------
*Particles*
-----------------------------------------------------------
AMReX AoS ``.pos()``  ``0, 1, 2``  ``0, 1``     ``0, 1``
WarpX position names  ``x, y, z``  ``x, z``     ``r, z``
extra SoA attribute                             ``theta``
====================  ===========  ===========  ===========

Please see the following sections for particle AoS and SoA details.