-
Notifications
You must be signed in to change notification settings - Fork 226
update binning plugin domain info docs #5660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ikbuibui
wants to merge
3
commits into
ComputationalRadiationPhysics:dev
Choose a base branch
from
ikbuibui:binningDocs
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+95
−32
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,22 +101,6 @@ For two fields with one extra data parameter: | |
|
|
||
| Fields and extra data may be tuples with multiple elements which are unpacked and passed to the user-defined functors. Therefore, it is the responsibility of the user to ensure that their functors have an appropriate number of arguments to match the provided tuples. | ||
|
|
||
| Domain Info | ||
| """"""""""" | ||
| Enables the user to find the location of the particle or field in the simulation domain. Contains | ||
|
|
||
| For particle binning, the ``DomainInfo`` class contains: | ||
|
|
||
| .. doxygenclass:: picongpu::plugins::binning::DomainInfoBase | ||
| :members: | ||
|
|
||
| The global and local offsets can be understood by looking at the `PIConGPU domain definitions <https://github.com/ComputationalRadiationPhysics/picongpu/wiki/PIConGPU-domain-definitions>`_. | ||
|
|
||
| For particle binning, the particle position is obtained at cell precision by default. To get sub-cell precision or SI units, use optional template parameters with ``getParticlePosition<DomainOrigin, PositionPrecision, PositionUnits>``. | ||
|
|
||
| For field binning, the field ``DomainInfo`` additionally holds the localCellIndex in the supercell and has a method to ``getCellIndex<DomainOrigin, PositionUnits>`` to get the current cell index being binned relative to an origin (global, total, local). To get the exact position of the fields inside the cell, relative to the cell index, use the ``FieldPosition`` trait. | ||
|
|
||
|
|
||
| Dimensionality and units | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
| Users can specify the units of their functor output using a 7 dimensional array. Each element of the array corresponds to an SI base unit, and the value stored in that index is the exponent of the unit. | ||
|
|
@@ -132,6 +116,75 @@ If no units are given, the quantity is assumed to be dimensionless. | |
| .. doxygenenum:: picongpu::SIBaseUnits::SIBaseUnits_t | ||
|
|
||
|
|
||
| Domain Info | ||
| ----------- | ||
| The binning plugin passes the domain info object to functors as a parameter to give the user access to some useful PIConGPU quantities inside the functor. | ||
| Importantly, it enables the user to find the location of the particle or field in the simulation domain. | ||
|
|
||
| The ``DomainInfo`` class contains: | ||
|
|
||
| .. doxygenclass:: picongpu::plugins::binning::DomainInfoBase | ||
| :members: | ||
|
|
||
| The global and local offsets can be understood by looking at the `PIConGPU domain definitions <https://github.com/ComputationalRadiationPhysics/picongpu/wiki/PIConGPU-domain-definitions>`_. | ||
|
|
||
| Particle binning | ||
| ^^^^^^^^^^^^^^^^ | ||
|
|
||
| For particle binning, we can use the ``getParticlePosition`` function. | ||
|
|
||
| .. code-block:: cpp | ||
|
|
||
| getParticlePosition<DomainOrigin, PositionPrecision, PositionUnits>() | ||
|
|
||
| The particle position has the default precision set to cell precision, and the position is returned in cell units by default. | ||
|
|
||
| To request a different origin, precision, or unit system, use the template parameters as described below. | ||
|
|
||
| Field binning | ||
| ^^^^^^^^^^^^^ | ||
|
|
||
| For field binning, ``DomainInfo`` additionally stores the ``localCellIndex`` within the supercell we can use the ``getCellIndex`` function. | ||
|
|
||
| .. code-block:: cpp | ||
|
|
||
| getCellIndex<DomainOrigin, PositionUnits>() | ||
|
|
||
| This returns the current cell index being binned relative to the selected origin. | ||
|
|
||
| To obtain the exact position of a field inside the cell, relative to the cell index, use the ``FieldPosition`` trait. | ||
|
|
||
| Domain origin | ||
| ^^^^^^^^^^^^^ | ||
|
|
||
| The reference origin for returned positions is selected with ``DomainOrigin``: | ||
|
|
||
| The available origins are: | ||
|
|
||
| .. doxygenenum:: picongpu::plugins::binning::DomainOrigin | ||
|
|
||
| Position precision | ||
| ^^^^^^^^^^^^^^^^^^ | ||
|
|
||
| For particle positions, the precision is selected with ``PositionPrecision``. | ||
|
|
||
| The available precisions are: | ||
|
|
||
| .. doxygenenum:: picongpu::plugins::binning::PositionPrecision | ||
|
|
||
| Position units | ||
| ^^^^^^^^^^^^^^ | ||
|
|
||
| The output units for positions are selected with ``PositionUnits``. | ||
|
|
||
| The available units are: | ||
|
|
||
| .. doxygenenum:: picongpu::plugins::binning::PositionUnits | ||
|
|
||
| .. note:: | ||
|
|
||
| Using positions in SI/PIC units introduces floating point numerical errors and may be especially problematic when using the ``TOTAL`` origin with moving window, because floating-point precision decreases as the distance from the origin increases. | ||
|
|
||
|
Comment on lines
+157
to
+187
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should probably say something about the return type of |
||
| Axis | ||
| ---- | ||
| Axis is a combination of a :ref:`functor description <usage/plugins/binningPlugin:Functor Description>` and an :ref:`axis splitting <usage/plugins/binningPlugin:Axis Splitting>`. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why wouldn't those be
doxygenclass::(or rather the equivalent for functions) as well? Same forgetCellIndexof course.