Skip to content

Commit 192e167

Browse files
authored
FieldType: Ensure Doxygen Works (#5330)
* `FieldType`: Top Doxygen Comment Add a general top level comment. * Doxygen: Expand `AMREX_ENUM` * `FieldType`: Doxygen Oneline Use a comment form that will still work after it gets pasted and squashed into a single line after macro expansion. * Doc: Include in Sphinx * RTD: Doxygen 1.9.1 to latest
1 parent 284287d commit 192e167

File tree

8 files changed

+75
-46
lines changed

8 files changed

+75
-46
lines changed

.readthedocs.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.11"
12+
python: "mambaforge-latest"
13+
# python: "3.11"
1314

1415
sphinx:
15-
configuration: Docs/source/conf.py
16+
configuration: Docs/source/conf.py
1617

17-
python:
18-
install:
19-
- requirements: Docs/requirements.txt
18+
conda:
19+
environment: Docs/conda.yml
20+
# python:
21+
# install:
22+
# - requirements: Docs/requirements.txt
2023

2124
formats:
2225
- htmlzip

Docs/Doxyfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -2245,15 +2245,15 @@ ENABLE_PREPROCESSING = YES
22452245
# The default value is: NO.
22462246
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
22472247

2248-
MACRO_EXPANSION = NO
2248+
MACRO_EXPANSION = YES
22492249

22502250
# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
22512251
# the macro expansion is limited to the macros specified with the PREDEFINED and
22522252
# EXPAND_AS_DEFINED tags.
22532253
# The default value is: NO.
22542254
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
22552255

2256-
EXPAND_ONLY_PREDEF = NO
2256+
EXPAND_ONLY_PREDEF = YES
22572257

22582258
# If the SEARCH_INCLUDES tag is set to YES, the include files in the
22592259
# INCLUDE_PATH will be searched if a #include is found.
@@ -2305,14 +2305,16 @@ PREDEFINED = AMREX_Linux=1 \
23052305
WARPX_QED=1 \
23062306
WARPX_QED_TABLE_GEN=1
23072307

2308+
PREDEFINED += "AMREX_ENUM(CLASS,...)=\"enum class CLASS : int { __VA_ARGS__ };\""
2309+
23082310
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
23092311
# tag can be used to specify a list of macro names that should be expanded. The
23102312
# macro definition that is found in the sources will be used. Use the PREDEFINED
23112313
# tag if you want to use a different macro definition that overrules the
23122314
# definition found in the source code.
23132315
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
23142316

2315-
EXPAND_AS_DEFINED =
2317+
EXPAND_AS_DEFINED = AMREX_ENUM
23162318

23172319
# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
23182320
# remove all references to function-like macros that are alone on a line, have

Docs/README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ More information can be found in Docs/source/developers/documentation.rst.
99

1010
Install the Python requirements for compiling the documentation:
1111
```
12-
python3 -m pip install -r Docs/requirements.txt
12+
cd Docs/
13+
python3 -m pip install -r requirements.txt
1314
```
1415

1516
### Compiling the documentation
1617

17-
`cd` into the `Docs/` directory and type
18+
Still in the `Docs/` directory, type
1819
```
1920
make html
2021
```

Docs/conda.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: readthedocs
2+
3+
channels:
4+
- conda-forge
5+
- nodefaults
6+
7+
dependencies:
8+
- python
9+
- doxygen
10+
- pip
11+
- pip:
12+
- -r requirements.txt

Docs/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# License: BSD-3-Clause-LBNL
66

77
# WarpX PICMI bindings w/o C++ component (used for autoclass docs)
8-
-e Python
8+
-e ../Python
99
breathe
1010
docutils>=0.17.1
1111

Docs/source/developers/documentation.rst

+3-4
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ First, make sure you are in the root directory of WarpX's source and install the
5656

5757
.. code-block:: sh
5858
59-
python3 -m pip install -r Docs/requirements.txt
59+
cd Docs/
60+
python3 -m pip install -r requirements.txt
6061
6162
You will also need Doxygen (macOS: ``brew install doxygen``; Ubuntu: ``sudo apt install doxygen``).
6263

63-
Then, to compile the documentation, use
64+
Still in the ``Docs/`` directory, compile the documentation via
6465

6566
.. code-block:: sh
6667
67-
cd Docs/
68-
6968
make html
7069
# This will first compile the Doxygen documentation (execute doxygen)
7170
# and then build html pages from rst files using sphinx and breathe.

Docs/source/developers/fields.rst

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ The ``MultiFab`` constructor (for, e.g., ``Ex`` on level ``lev``) is called in `
3737

3838
By default, the ``MultiFab`` are set to ``0`` at initialization. They can be assigned a different value in ``WarpX::InitLevelData``.
3939

40+
Field Names
41+
-----------
42+
43+
The commonly used WarpX field names are defined in:
44+
45+
.. doxygenenum:: warpx::fields::FieldType
46+
4047
Field solver
4148
------------
4249

Source/Fields.H

+36-31
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,30 @@
1818

1919
namespace warpx::fields
2020
{
21+
/** Unique identifiers for WarpX scalar and vector fields.
22+
*
23+
* These are implemented as amrex::MultiFab (one or one per component "direction",
24+
* respectively) and stored in the ablastr::fields::MultiFabRegister .
25+
*/
2126
AMREX_ENUM(FieldType,
2227
None,
23-
Efield_aux, //!< Field that the particles gather from. Obtained from Efield_fp (and Efield_cp when using MR); see UpdateAuxilaryData
24-
Bfield_aux, //!< Field that the particles gather from. Obtained from Bfield_fp (and Bfield_cp when using MR); see UpdateAuxilaryData
25-
Efield_fp, //!< The field that is updated by the field solver at each timestep
26-
Bfield_fp, //!< The field that is updated by the field solver at each timestep
27-
Efield_fp_external, //!< Stores grid particle fields provided by the user as through an openPMD file
28-
Bfield_fp_external, //!< Stores grid particle fields provided by the user as through an openPMD file
29-
current_fp, //!< The current that is used as a source for the field solver
30-
current_fp_nodal, //!< Only used when using nodal current deposition
31-
current_fp_vay, //!< Only used when using Vay current deposition
32-
current_buf, //!< Particles that are close to the edge of the MR patch (i.e. in the deposition buffer) deposit to this field.
33-
current_store, //!< Only used when doing subcycling with mesh refinement, for book-keeping of currents
34-
rho_buf, //!< Particles that are close to the edge of the MR patch (i.e. in the deposition buffer) deposit to this field.
35-
rho_fp, //!< The charge density that is used as a source for the field solver (mostly for labframe electrostatic and PSATD)
36-
F_fp, //!< Used for divE cleaning
37-
G_fp, //!< Used for divB cleaning
38-
phi_fp, //!< Obtained by the Poisson solver, for labframe electrostatic
39-
vector_potential_fp, //!< Obtained by the magnetostatic solver
28+
Efield_aux, /**< Field that the particles gather from. Obtained from Efield_fp (and Efield_cp when using MR); see UpdateAuxilaryData */
29+
Bfield_aux, /**< Field that the particles gather from. Obtained from Bfield_fp (and Bfield_cp when using MR); see UpdateAuxilaryData */
30+
Efield_fp, /**< The field that is updated by the field solver at each timestep */
31+
Bfield_fp, /**< The field that is updated by the field solver at each timestep */
32+
Efield_fp_external, /**< Stores grid particle fields provided by the user as through an openPMD file */
33+
Bfield_fp_external, /**< Stores grid particle fields provided by the user as through an openPMD file */
34+
current_fp, /**< The current that is used as a source for the field solver */
35+
current_fp_nodal, /**< Only used when using nodal current deposition */
36+
current_fp_vay, /**< Only used when using Vay current deposition */
37+
current_buf, /**< Particles that are close to the edge of the MR patch (i.e. in the deposition buffer) deposit to this field. */
38+
current_store, /**< Only used when doing subcycling with mesh refinement, for book-keeping of currents */
39+
rho_buf, /**< Particles that are close to the edge of the MR patch (i.e. in the deposition buffer) deposit to this field. */
40+
rho_fp, /**< The charge density that is used as a source for the field solver (mostly for labframe electrostatic and PSATD) */
41+
F_fp, /**< Used for divE cleaning */
42+
G_fp, /**< Used for divB cleaning */
43+
phi_fp, /**< Obtained by the Poisson solver, for labframe electrostatic */
44+
vector_potential_fp, /**< Obtained by the magnetostatic solver */
4045
vector_potential_fp_nodal,
4146
vector_potential_grad_buf_e_stag,
4247
vector_potential_grad_buf_b_stag,
@@ -45,19 +50,19 @@ namespace warpx::fields
4550
hybrid_current_fp_temp,
4651
hybrid_current_fp_ampere,
4752
hybrid_current_fp_external,
48-
Efield_cp, //!< Only used with MR. The field that is updated by the field solver at each timestep, on the coarse patch of each level
49-
Bfield_cp, //!< Only used with MR. The field that is updated by the field solver at each timestep, on the coarse patch of each level
50-
current_cp, //!< Only used with MR. The current that is used as a source for the field solver, on the coarse patch of each level
51-
rho_cp, //!< Only used with MR. The charge density that is used as a source for the field solver, on the coarse patch of each level
52-
F_cp, //!< Only used with MR. Used for divE cleaning, on the coarse patch of each level
53-
G_cp, //!< Only used with MR. Used for divB cleaning, on the coarse patch of each level
54-
Efield_cax, //!< Only used with MR. Particles that are close to the edge of the MR patch (i.e. in the gather buffer) gather from this field
55-
Bfield_cax, //!< Only used with MR. Particles that are close to the edge of the MR patch (i.e. in the gather buffer) gather from this field
56-
E_external_particle_field, //!< Stores external particle fields provided by the user as through an openPMD file
57-
B_external_particle_field, //!< Stores external particle fields provided by the user as through an openPMD file
58-
distance_to_eb, //!< Only used with embedded boundaries (EB). Stores the distance to the nearest EB
59-
edge_lengths, //!< Only used with embedded boundaries (EB). Indicates the length of the cell edge that is covered by the EB, in SI units
60-
face_areas, //!< Only used with embedded boundaries (EB). Indicates the area of the cell face that is covered by the EB, in SI units
53+
Efield_cp, /**< Only used with MR. The field that is updated by the field solver at each timestep, on the coarse patch of each level */
54+
Bfield_cp, /**< Only used with MR. The field that is updated by the field solver at each timestep, on the coarse patch of each level */
55+
current_cp, /**< Only used with MR. The current that is used as a source for the field solver, on the coarse patch of each level */
56+
rho_cp, /**< Only used with MR. The charge density that is used as a source for the field solver, on the coarse patch of each level */
57+
F_cp, /**< Only used with MR. Used for divE cleaning, on the coarse patch of each level */
58+
G_cp, /**< Only used with MR. Used for divB cleaning, on the coarse patch of each level */
59+
Efield_cax, /**< Only used with MR. Particles that are close to the edge of the MR patch (i.e. in the gather buffer) gather from this field */
60+
Bfield_cax, /**< Only used with MR. Particles that are close to the edge of the MR patch (i.e. in the gather buffer) gather from this field */
61+
E_external_particle_field, /**< Stores external particle fields provided by the user as through an openPMD file */
62+
B_external_particle_field, /**< Stores external particle fields provided by the user as through an openPMD file */
63+
distance_to_eb, /**< Only used with embedded boundaries (EB). Stores the distance to the nearest EB */
64+
edge_lengths, /**< Only used with embedded boundaries (EB). Indicates the length of the cell edge that is covered by the EB, in SI units */
65+
face_areas, /**< Only used with embedded boundaries (EB). Indicates the area of the cell face that is covered by the EB, in SI units */
6166
area_mod,
6267
pml_E_fp,
6368
pml_B_fp,
@@ -74,7 +79,7 @@ namespace warpx::fields
7479
Bfield_avg_fp,
7580
Efield_avg_cp,
7681
Bfield_avg_cp,
77-
B_old, //!< Stores the value of B at the beginning of the timestep, for the implicit solver
82+
B_old, /**< Stores the value of B at the beginning of the timestep, for the implicit solver */
7883
ECTRhofield,
7984
Venl
8085
);

0 commit comments

Comments
 (0)