Skip to content

Commit

Permalink
Rename element name to type (#710)
Browse files Browse the repository at this point in the history
This string just names the type of the element. We will introduce
per-element, user-defined names in a separate PR, which we will use
the `name` field for.
  • Loading branch information
ax3l authored Sep 23, 2024
1 parent 24ec19f commit ea151e0
Show file tree
Hide file tree
Showing 32 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion docs/source/usage/workflows/add_element.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ To simplify the logic, we use so-called `mixin classes <https://en.wikipedia.org
:language: cpp
:dedent: 4
:start-at: struct Drift
:end-at: static constexpr auto name = "Drift";
:end-at: static constexpr auto type = "Drift";

After this brief boilerplate, our beamline elements implement three simple parts:

Expand Down
2 changes: 1 addition & 1 deletion src/particles/PushAll.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ namespace impactx
)
{
// performance profiling per element
std::string const profile_name = "impactx::Push::" + std::string(T_Element::name);
std::string const profile_name = "impactx::Push::" + std::string(T_Element::type);
BL_PROFILE(profile_name);

// preparing to access reference particle data: RefPart
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Aperture.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Aperture";
static constexpr auto type = "Aperture";
using PType = ImpactXParticleContainer::ParticleType;

enum Shape
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Buncher.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Buncher";
static constexpr auto type = "Buncher";
using PType = ImpactXParticleContainer::ParticleType;

/** A short RF cavity element at zero crossing for bunching
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/CFbend.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "CFbend";
static constexpr auto type = "CFbend";
using PType = ImpactXParticleContainer::ParticleType;

/** An combined-function bend, consisting of an ideal sector bend with
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ChrDrift.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ChrDrift";
static constexpr auto type = "ChrDrift";
using PType = ImpactXParticleContainer::ParticleType;

/** A drift with chromatic effects included
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ChrPlasmaLens.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ChrPlasmaLens";
static constexpr auto type = "ChrPlasmaLens";
using PType = ImpactXParticleContainer::ParticleType;

/** An active cylindrically symmetric plasma lens with chromatic focusing
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ChrQuad.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ChrQuad";
static constexpr auto type = "ChrQuad";
using PType = ImpactXParticleContainer::ParticleType;

/** A Quadrupole magnet with chromatic focusing
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ChrUniformAcc.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ChrAcc";
static constexpr auto type = "ChrAcc";
using PType = ImpactXParticleContainer::ParticleType;

/** Acceleration in a uniform field Ez, with a uniform solenoidal field Bz.
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ConstF.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ConstF";
static constexpr auto type = "ConstF";
using PType = ImpactXParticleContainer::ParticleType;

/** A linear Constant Focusing element
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/DipEdge.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "DipEdge";
static constexpr auto type = "DipEdge";
using PType = ImpactXParticleContainer::ParticleType;

/** Edge focusing associated with bend entry or exit
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Drift.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Drift";
static constexpr auto type = "Drift";
using PType = ImpactXParticleContainer::ParticleType;

/** A drift
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Empty.H
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace impactx
: public elements::Thin,
public elements::NoFinalize
{
static constexpr auto name = "None";
static constexpr auto type = "None";
using PType = ImpactXParticleContainer::ParticleType;

/** This element does nothing.
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ExactDrift.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ExactDrift";
static constexpr auto type = "ExactDrift";
using PType = ImpactXParticleContainer::ParticleType;

/** A drift using the exact nonlinear transfer map
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ExactSbend.H
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ExactSbend";
static constexpr auto type = "ExactSbend";
static constexpr amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0;
using PType = ImpactXParticleContainer::ParticleType;

Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Kicker.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Kicker";
static constexpr auto type = "Kicker";
using PType = ImpactXParticleContainer::ParticleType;

enum UnitSystem
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Multipole.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Multipole";
static constexpr auto type = "Multipole";
using PType = ImpactXParticleContainer::ParticleType;

/** A general thin multipole element
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/NonlinearLens.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "NonlinearLens";
static constexpr auto type = "NonlinearLens";
using PType = ImpactXParticleContainer::ParticleType;

/** Single short segment of the nonlinear magnetic insert element
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/PRot.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace impactx
public elements::Thin,
public elements::NoFinalize
{
static constexpr auto name = "PRot";
static constexpr auto type = "PRot";
using PType = ImpactXParticleContainer::ParticleType;

static constexpr amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0;
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Programmable.H
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace impactx
{
struct Programmable
{
static constexpr auto name = "Programmable";
static constexpr auto type = "Programmable";
using PType = ImpactXParticleContainer::ParticleType;

/** This element can be programmed
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Quad.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Quad";
static constexpr auto type = "Quad";
using PType = ImpactXParticleContainer::ParticleType;

/** A Quadrupole magnet
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/RFCavity.H
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ namespace RFCavityData
public elements::Thick,
public elements::Alignment
{
static constexpr auto name = "RFCavity";
static constexpr auto type = "RFCavity";
using PType = ImpactXParticleContainer::ParticleType;

/** An RF cavity
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Sbend.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Sbend";
static constexpr auto type = "Sbend";
using PType = ImpactXParticleContainer::ParticleType;

/** An ideal sector bend
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ShortRF.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ShortRF";
static constexpr auto type = "ShortRF";
using PType = ImpactXParticleContainer::ParticleType;

/** A short RF cavity element
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/SoftQuad.H
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace SoftQuadrupoleData
public elements::Thick,
public elements::Alignment
{
static constexpr auto name = "SoftQuadrupole";
static constexpr auto type = "SoftQuadrupole";
using PType = ImpactXParticleContainer::ParticleType;

/** A soft-edge quadrupole
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/SoftSol.H
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ namespace SoftSolenoidData
public elements::Thick,
public elements::Alignment
{
static constexpr auto name = "SoftSolenoid";
static constexpr auto type = "SoftSolenoid";
using PType = ImpactXParticleContainer::ParticleType;

/** A soft-edge solenoid
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/Sol.H
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "Sol";
static constexpr auto type = "Sol";
using PType = ImpactXParticleContainer::ParticleType;

/** An ideal hard-edge Solenoid magnet
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/TaperedPL.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "TaperedPL";
static constexpr auto type = "TaperedPL";
using PType = ImpactXParticleContainer::ParticleType;

/** A short segment of a nonlinear plasma lens with a transverse taper.
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/ThinDipole.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace impactx
public elements::Alignment,
public elements::NoFinalize
{
static constexpr auto name = "ThinDipole";
static constexpr auto type = "ThinDipole";
using PType = ImpactXParticleContainer::ParticleType;

static constexpr amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace impactx::diagnostics
NonlinearLensInvariants const nonlinear_lens_invariants(alpha, beta, tn, cn);

// profile time spent here
std::string profile_name = "impactx::Push::" + std::string(BeamMonitor::name) + "::add_optional_properties";
std::string profile_name = "impactx::Push::" + std::string(BeamMonitor::type) + "::add_optional_properties";
BL_PROFILE(profile_name);

// add runtime properties for H and I
Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/diagnostics/openPMD.H
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ namespace detail
struct BeamMonitor
: public elements::Thin
{
static constexpr auto name = "BeamMonitor";
static constexpr auto type = "BeamMonitor";
using PType = typename ImpactXParticleContainer::ParticleType;
using PinnedContainer = typename ImpactXParticleContainer::ContainerLike<amrex::PinnedArenaAllocator>;

Expand Down
2 changes: 1 addition & 1 deletion src/particles/elements/diagnostics/openPMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ namespace detail
)
{
#ifdef ImpactX_USE_OPENPMD
std::string profile_name = "impactx::Push::" + std::string(BeamMonitor::name);
std::string profile_name = "impactx::Push::" + std::string(BeamMonitor::type);
BL_PROFILE(profile_name);

// preparing to access reference particle data: RefPart
Expand Down

0 comments on commit ea151e0

Please sign in to comment.