Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/source/usage/parameters.rst
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,14 @@ Lattice Elements

= c parameter * sqrt(Twiss beta)

* ``BeamMonitor`` a beam monitor, writing all beam particles at fixed ``s`` to openPMD files.
* ``beam_monitor`` a beam monitor, writing all beam particles at fixed ``s`` to openPMD files.
If the same element name is used multiple times, then an output series is created with multiple outputs.

* ``<element_name>.name`` (``string``, default value: ``<element_name>``)

The output series name to use.
By default, output is created under ``diags/openPMD/<element_name>.<backend>``.

* ``<element_name>.backend`` (``string``, default value: ``default``)

`I/O backend <https://openpmd-api.readthedocs.io/en/latest/backends/overview.html>`_ for `openPMD <https://www.openPMD.org>`_ data dumps.
Expand Down
4 changes: 3 additions & 1 deletion src/initialization/InitElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ namespace detail
detail::queryAddResize(pp_element, "sin_coefficients", sin_coef);
m_lattice.emplace_back( SoftQuadrupole(ds, gscale, cos_coef, sin_coef, mapsteps, nslice) );
} else if (element_type == "beam_monitor") {
std::string openpmd_name = element_name;
pp_element.queryAdd("name", openpmd_name);
std::string openpmd_backend = "default";
pp_element.queryAdd("backend", openpmd_backend);
std::string openpmd_encoding {"g"};
pp_element.queryAdd("encoding", openpmd_encoding);
m_lattice.emplace_back( diagnostics::BeamMonitor(element_name, openpmd_backend, openpmd_encoding) );
m_lattice.emplace_back( diagnostics::BeamMonitor(openpmd_name, openpmd_backend, openpmd_encoding) );
} else {
amrex::Abort("Unknown type for lattice element " + element_name + ": " + element_type);
}
Expand Down