diff --git a/src/initialization/InitElement.cpp b/src/initialization/InitElement.cpp index 622ed2998..92a33e5fd 100644 --- a/src/initialization/InitElement.cpp +++ b/src/initialization/InitElement.cpp @@ -502,7 +502,7 @@ namespace detail amrex::ParticleReal ds = 0.0; pp_element.queryAdd("ds", ds); - elements::LinearTransport::Map6x6 transport_map = elements::LinearTransport::Map6x6::Identity(); + elements::mixin::LinearTransport::Map6x6 transport_map = elements::mixin::LinearTransport::Map6x6::Identity(); // safe to ParmParse inputs for reproducibility for (int i=1; i<=6; ++i) { diff --git a/src/particles/elements/Aperture.H b/src/particles/elements/Aperture.H index 324b6d5ab..d9bea0602 100644 --- a/src/particles/elements/Aperture.H +++ b/src/particles/elements/Aperture.H @@ -26,11 +26,11 @@ namespace impactx { struct Aperture - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "Aperture"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Buncher.H b/src/particles/elements/Buncher.H index 0ca7efb1e..3079875ee 100644 --- a/src/particles/elements/Buncher.H +++ b/src/particles/elements/Buncher.H @@ -26,11 +26,11 @@ namespace impactx { struct Buncher - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "Buncher"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/CFbend.H b/src/particles/elements/CFbend.H index 9a2492b62..8b2d7c990 100644 --- a/src/particles/elements/CFbend.H +++ b/src/particles/elements/CFbend.H @@ -28,12 +28,12 @@ namespace impactx { struct CFbend - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "CFbend"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ChrDrift.H b/src/particles/elements/ChrDrift.H index 507019239..4b75742ee 100644 --- a/src/particles/elements/ChrDrift.H +++ b/src/particles/elements/ChrDrift.H @@ -27,12 +27,12 @@ namespace impactx { struct ChrDrift - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ChrDrift"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ChrPlasmaLens.H b/src/particles/elements/ChrPlasmaLens.H index 8c5990c51..6648078b6 100644 --- a/src/particles/elements/ChrPlasmaLens.H +++ b/src/particles/elements/ChrPlasmaLens.H @@ -27,12 +27,12 @@ namespace impactx { struct ChrPlasmaLens - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ChrPlasmaLens"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ChrQuad.H b/src/particles/elements/ChrQuad.H index 82875fcec..46f488963 100644 --- a/src/particles/elements/ChrQuad.H +++ b/src/particles/elements/ChrQuad.H @@ -28,12 +28,12 @@ namespace impactx { struct ChrQuad - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ChrQuad"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ChrUniformAcc.H b/src/particles/elements/ChrUniformAcc.H index 338cbde8c..738a60876 100644 --- a/src/particles/elements/ChrUniformAcc.H +++ b/src/particles/elements/ChrUniformAcc.H @@ -27,12 +27,12 @@ namespace impactx { struct ChrAcc - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ChrAcc"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ConstF.H b/src/particles/elements/ConstF.H index 3202d1c6b..2dc27ce3b 100644 --- a/src/particles/elements/ConstF.H +++ b/src/particles/elements/ConstF.H @@ -27,12 +27,12 @@ namespace impactx { struct ConstF - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ConstF"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/DipEdge.H b/src/particles/elements/DipEdge.H index 12b528e5f..825bd0112 100644 --- a/src/particles/elements/DipEdge.H +++ b/src/particles/elements/DipEdge.H @@ -26,11 +26,11 @@ namespace impactx { struct DipEdge - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "DipEdge"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Drift.H b/src/particles/elements/Drift.H index 1171cf69f..e1e87040f 100644 --- a/src/particles/elements/Drift.H +++ b/src/particles/elements/Drift.H @@ -30,12 +30,12 @@ namespace impactx { struct Drift - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "Drift"; using PType = ImpactXParticleContainer::ParticleType; @@ -178,7 +178,7 @@ namespace impactx * @returns 6x6 transport matrix */ AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE - elements::LinearTransport::Map6x6 + elements::mixin::LinearTransport::Map6x6 transport_map (RefPart & AMREX_RESTRICT refpart) const { using namespace amrex::literals; // for _rt and _prt @@ -191,7 +191,7 @@ namespace impactx amrex::ParticleReal const betgam2 = std::pow(pt_ref, 2) - 1.0_prt; // assign linear map matrix elements - elements::LinearTransport::Map6x6 R = elements::LinearTransport::Map6x6::Identity(); + elements::mixin::LinearTransport::Map6x6 R = elements::mixin::LinearTransport::Map6x6::Identity(); R(1,2) = slice_ds; R(3,4) = slice_ds; R(5,6) = slice_ds / betgam2; diff --git a/src/particles/elements/Empty.H b/src/particles/elements/Empty.H index 9ce3eece8..30b29d3ac 100644 --- a/src/particles/elements/Empty.H +++ b/src/particles/elements/Empty.H @@ -22,8 +22,8 @@ namespace impactx { struct Empty - : public elements::Thin, - public elements::NoFinalize + : public elements::mixin::Thin, + public elements::mixin::NoFinalize { static constexpr auto type = "None"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ExactDrift.H b/src/particles/elements/ExactDrift.H index 581bb4b6e..db8703330 100644 --- a/src/particles/elements/ExactDrift.H +++ b/src/particles/elements/ExactDrift.H @@ -27,12 +27,12 @@ namespace impactx { struct ExactDrift - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ExactDrift"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ExactSbend.H b/src/particles/elements/ExactSbend.H index a78d46640..040082df7 100644 --- a/src/particles/elements/ExactSbend.H +++ b/src/particles/elements/ExactSbend.H @@ -29,12 +29,12 @@ namespace impactx { struct ExactSbend - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "ExactSbend"; static constexpr amrex::ParticleReal degree2rad = ablastr::constant::math::pi / 180.0; diff --git a/src/particles/elements/Kicker.H b/src/particles/elements/Kicker.H index 7bd3c17c0..cd3556ed1 100644 --- a/src/particles/elements/Kicker.H +++ b/src/particles/elements/Kicker.H @@ -26,11 +26,11 @@ namespace impactx { struct Kicker - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "Kicker"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/LinearMap.H b/src/particles/elements/LinearMap.H index 472ae12be..4d66c9131 100644 --- a/src/particles/elements/LinearMap.H +++ b/src/particles/elements/LinearMap.H @@ -26,11 +26,11 @@ namespace impactx { struct LinearMap - : public elements::Named, - public elements::BeamOptic, - public elements::Alignment, - public elements::LinearTransport, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Alignment, + public elements::mixin::LinearTransport, + public elements::mixin::NoFinalize { static constexpr auto type = "LinearMap"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Marker.H b/src/particles/elements/Marker.H index 3291aff79..5fd90ab88 100644 --- a/src/particles/elements/Marker.H +++ b/src/particles/elements/Marker.H @@ -22,9 +22,9 @@ namespace impactx { struct Marker - : public elements::Named, - public elements::Thin, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::Thin, + public elements::mixin::NoFinalize { static constexpr auto type = "Marker"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Multipole.H b/src/particles/elements/Multipole.H index f2db02d58..121c2665b 100644 --- a/src/particles/elements/Multipole.H +++ b/src/particles/elements/Multipole.H @@ -26,11 +26,11 @@ namespace impactx { struct Multipole - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "Multipole"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/NonlinearLens.H b/src/particles/elements/NonlinearLens.H index 8413d000e..d268e0366 100644 --- a/src/particles/elements/NonlinearLens.H +++ b/src/particles/elements/NonlinearLens.H @@ -26,11 +26,11 @@ namespace impactx { struct NonlinearLens - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "NonlinearLens"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/PRot.H b/src/particles/elements/PRot.H index 242a82534..5683c1e6f 100644 --- a/src/particles/elements/PRot.H +++ b/src/particles/elements/PRot.H @@ -28,10 +28,10 @@ namespace impactx { struct PRot - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::NoFinalize { static constexpr auto type = "PRot"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/PlaneXYRot.H b/src/particles/elements/PlaneXYRot.H index eeb56bfca..250deb4d6 100644 --- a/src/particles/elements/PlaneXYRot.H +++ b/src/particles/elements/PlaneXYRot.H @@ -29,11 +29,11 @@ namespace impactx { struct PlaneXYRot - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "PlaneXYRot"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Programmable.H b/src/particles/elements/Programmable.H index 2227fd64b..582612424 100644 --- a/src/particles/elements/Programmable.H +++ b/src/particles/elements/Programmable.H @@ -23,7 +23,7 @@ namespace impactx { struct Programmable - : public elements::Named + : public elements::mixin::Named { static constexpr auto type = "Programmable"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Quad.H b/src/particles/elements/Quad.H index 791a88c1a..eb828f9a3 100644 --- a/src/particles/elements/Quad.H +++ b/src/particles/elements/Quad.H @@ -27,12 +27,12 @@ namespace impactx { struct Quad - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "Quad"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/RFCavity.H b/src/particles/elements/RFCavity.H index c843f629d..08b978d63 100644 --- a/src/particles/elements/RFCavity.H +++ b/src/particles/elements/RFCavity.H @@ -104,11 +104,11 @@ namespace RFCavityData } // namespace RFCavityData struct RFCavity - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture { static constexpr auto type = "RFCavity"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Sbend.H b/src/particles/elements/Sbend.H index 946394e51..30447dd11 100644 --- a/src/particles/elements/Sbend.H +++ b/src/particles/elements/Sbend.H @@ -28,12 +28,12 @@ namespace impactx { struct Sbend - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "Sbend"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ShortRF.H b/src/particles/elements/ShortRF.H index 64546503a..024e007fb 100644 --- a/src/particles/elements/ShortRF.H +++ b/src/particles/elements/ShortRF.H @@ -26,11 +26,11 @@ namespace impactx { struct ShortRF - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "ShortRF"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/SoftQuad.H b/src/particles/elements/SoftQuad.H index 481236be4..839eebfc3 100644 --- a/src/particles/elements/SoftQuad.H +++ b/src/particles/elements/SoftQuad.H @@ -113,11 +113,11 @@ namespace SoftQuadrupoleData } // namespace SoftQuadrupoleData struct SoftQuadrupole - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture { static constexpr auto type = "SoftQuadrupole"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/SoftSol.H b/src/particles/elements/SoftSol.H index d4e4330b0..be76ea081 100644 --- a/src/particles/elements/SoftSol.H +++ b/src/particles/elements/SoftSol.H @@ -118,11 +118,11 @@ namespace SoftSolenoidData } // namespace SoftSolenoidData struct SoftSolenoid - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture { static constexpr auto type = "SoftSolenoid"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/Sol.H b/src/particles/elements/Sol.H index 193612706..10ea4fd81 100644 --- a/src/particles/elements/Sol.H +++ b/src/particles/elements/Sol.H @@ -28,12 +28,12 @@ namespace impactx { struct Sol - : public elements::Named, - public elements::BeamOptic, - public elements::Thick, - public elements::Alignment, - public elements::PipeAperture, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thick, + public elements::mixin::Alignment, + public elements::mixin::PipeAperture, + public elements::mixin::NoFinalize { static constexpr auto type = "Sol"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/TaperedPL.H b/src/particles/elements/TaperedPL.H index 2f7dabad4..8039e2a97 100644 --- a/src/particles/elements/TaperedPL.H +++ b/src/particles/elements/TaperedPL.H @@ -26,11 +26,11 @@ namespace impactx { struct TaperedPL - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "TaperedPL"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/ThinDipole.H b/src/particles/elements/ThinDipole.H index 097cb85c4..14ed4f062 100644 --- a/src/particles/elements/ThinDipole.H +++ b/src/particles/elements/ThinDipole.H @@ -24,11 +24,11 @@ namespace impactx { struct ThinDipole - : public elements::Named, - public elements::BeamOptic, - public elements::Thin, - public elements::Alignment, - public elements::NoFinalize + : public elements::mixin::Named, + public elements::mixin::BeamOptic, + public elements::mixin::Thin, + public elements::mixin::Alignment, + public elements::mixin::NoFinalize { static constexpr auto type = "ThinDipole"; using PType = ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/diagnostics/openPMD.H b/src/particles/elements/diagnostics/openPMD.H index f5ee0d4a8..6d47ecee6 100644 --- a/src/particles/elements/diagnostics/openPMD.H +++ b/src/particles/elements/diagnostics/openPMD.H @@ -63,7 +63,7 @@ namespace detail * same series name as an existing instance. */ struct BeamMonitor - : public elements::Thin + : public elements::mixin::Thin { static constexpr auto type = "BeamMonitor"; using PType = typename ImpactXParticleContainer::ParticleType; diff --git a/src/particles/elements/mixin/alignment.H b/src/particles/elements/mixin/alignment.H index d108c4e1b..283e85147 100644 --- a/src/particles/elements/mixin/alignment.H +++ b/src/particles/elements/mixin/alignment.H @@ -19,7 +19,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for lattice elements with horizontal/vertical alignment errors */ @@ -147,6 +147,6 @@ namespace impactx::elements amrex::ParticleReal m_rotation = 0; //! rotation error in the transverse plane [rad] }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_ALIGNMENT_H diff --git a/src/particles/elements/mixin/aperture.H b/src/particles/elements/mixin/aperture.H index 9916ff2f1..be336bc08 100644 --- a/src/particles/elements/mixin/aperture.H +++ b/src/particles/elements/mixin/aperture.H @@ -7,8 +7,8 @@ * Authors: Axel Huebl, Chad Mitchell * License: BSD-3-Clause-LBNL */ -#ifndef IMPACTX_ELEMENTS_MIXIN_APERTURE_H -#define IMPACTX_ELEMENTS_MIXIN_APERTURE_H +#ifndef IMPACTX_ELEMENTS_MIXIN_PIPE_APERTURE_H +#define IMPACTX_ELEMENTS_MIXIN_PIPE_APERTURE_H #include #include @@ -17,7 +17,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for applying a transverse aperture restriction to thick lattice elements */ @@ -98,6 +98,6 @@ namespace impactx::elements amrex::ParticleReal m_aperture_y = 0; //! vertical aperture size [m] }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin -#endif // IMPACTX_ELEMENTS_MIXIN_APERTURE_H +#endif // IMPACTX_ELEMENTS_MIXIN_PIPE_APERTURE_H diff --git a/src/particles/elements/mixin/beamoptic.H b/src/particles/elements/mixin/beamoptic.H index 0616b5374..bd1d5f314 100644 --- a/src/particles/elements/mixin/beamoptic.H +++ b/src/particles/elements/mixin/beamoptic.H @@ -19,7 +19,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { namespace detail { @@ -190,6 +190,6 @@ namespace detail } }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_BEAMOPTIC_H diff --git a/src/particles/elements/mixin/lineartransport.H b/src/particles/elements/mixin/lineartransport.H index 9fce44ff6..add40df61 100644 --- a/src/particles/elements/mixin/lineartransport.H +++ b/src/particles/elements/mixin/lineartransport.H @@ -20,7 +20,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for lattice elements that can be expressed as linear transport maps. */ @@ -47,6 +47,6 @@ namespace impactx::elements // Map6x6 m_transport_map; ///< linearized map }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_LINEAR_TRANSPORT_H diff --git a/src/particles/elements/mixin/named.H b/src/particles/elements/mixin/named.H index f06a6d86c..1ebaea4fc 100644 --- a/src/particles/elements/mixin/named.H +++ b/src/particles/elements/mixin/named.H @@ -21,7 +21,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for lattice elements with a user-defined name */ @@ -148,6 +148,6 @@ namespace impactx::elements char * m_name = nullptr; //! a user defined and not necessarily unique name of the element }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_NAMED_H diff --git a/src/particles/elements/mixin/nofinalize.H b/src/particles/elements/mixin/nofinalize.H index 3ab5a9607..7ea6e4da0 100644 --- a/src/particles/elements/mixin/nofinalize.H +++ b/src/particles/elements/mixin/nofinalize.H @@ -11,7 +11,7 @@ #define IMPACTX_ELEMENTS_MIXIN_NOFINALIZE_H -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for lattice elements that need no finalize function. * @@ -29,6 +29,6 @@ namespace impactx::elements } }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_NOFINALIZE_H diff --git a/src/particles/elements/mixin/thick.H b/src/particles/elements/mixin/thick.H index 4572d2a67..85a9917d5 100644 --- a/src/particles/elements/mixin/thick.H +++ b/src/particles/elements/mixin/thick.H @@ -16,7 +16,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for lattice elements with finite length */ @@ -59,6 +59,6 @@ namespace impactx::elements int m_nslice; //! number of slices used for the application of space charge }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_THICK_H diff --git a/src/particles/elements/mixin/thin.H b/src/particles/elements/mixin/thin.H index b9c165e64..87138a95c 100644 --- a/src/particles/elements/mixin/thin.H +++ b/src/particles/elements/mixin/thin.H @@ -16,7 +16,7 @@ #include -namespace impactx::elements +namespace impactx::elements::mixin { /** This is a helper class for lattice elements with zero length */ @@ -54,6 +54,6 @@ namespace impactx::elements } }; -} // namespace impactx::elements +} // namespace impactx::elements::mixin #endif // IMPACTX_ELEMENTS_MIXIN_THIN_H diff --git a/src/python/elements.cpp b/src/python/elements.cpp index 6220e33f2..3e601c580 100644 --- a/src/python/elements.cpp +++ b/src/python/elements.cpp @@ -154,87 +154,87 @@ void init_elements(py::module& m) "Mixin classes for accelerator lattice elements in ImpactX" ); - py::class_(mx, "Named") + py::class_(mx, "Named") .def_property("name", - [](elements::Named & nm) { return nm.name(); }, - [](elements::Named & nm, std::string new_name) { nm.set_name(new_name); }, + [](elements::mixin::Named & nm) { return nm.name(); }, + [](elements::mixin::Named & nm, std::string new_name) { nm.set_name(new_name); }, "segment length in m" ) - .def_property_readonly("has_name", &elements::Named::has_name) + .def_property_readonly("has_name", &elements::mixin::Named::has_name) ; - py::class_(mx, "Thick") + py::class_(mx, "Thick") .def_property("ds", - [](elements::Thick & th) { return th.m_ds; }, - [](elements::Thick & th, amrex::ParticleReal ds) { th.m_ds = ds; }, + [](elements::mixin::Thick & th) { return th.m_ds; }, + [](elements::mixin::Thick & th, amrex::ParticleReal ds) { th.m_ds = ds; }, "segment length in m" ) .def_property("nslice", - [](elements::Thick & th) { return th.m_nslice; }, - [](elements::Thick & th, int nslice) { th.m_nslice = nslice; }, + [](elements::mixin::Thick & th) { return th.m_nslice; }, + [](elements::mixin::Thick & th, int nslice) { th.m_nslice = nslice; }, "number of slices used for the application of space charge" ) ; - py::class_(mx, "Thin") + py::class_(mx, "Thin") .def_property_readonly("ds", - &elements::Thin::ds, + &elements::mixin::Thin::ds, "segment length in m" ) .def_property_readonly("nslice", - &elements::Thin::nslice, + &elements::mixin::Thin::nslice, "number of slices used for the application of space charge" ) ; - py::class_(mx, "Alignment") + py::class_(mx, "Alignment") .def_property("dx", - [](elements::Alignment & a) { return a.dx(); }, - [](elements::Alignment & a, amrex::ParticleReal dx) { a.m_dx = dx; }, + [](elements::mixin::Alignment & a) { return a.dx(); }, + [](elements::mixin::Alignment & a, amrex::ParticleReal dx) { a.m_dx = dx; }, "horizontal translation error in m" ) .def_property("dy", - [](elements::Alignment & a) { return a.dy(); }, - [](elements::Alignment & a, amrex::ParticleReal dy) { a.m_dy = dy; }, + [](elements::mixin::Alignment & a) { return a.dy(); }, + [](elements::mixin::Alignment & a, amrex::ParticleReal dy) { a.m_dy = dy; }, "vertical translation error in m" ) .def_property("rotation", - [](elements::Alignment & a) { return a.rotation(); }, - [](elements::Alignment & a, amrex::ParticleReal rotation_degree) + [](elements::mixin::Alignment & a) { return a.rotation(); }, + [](elements::mixin::Alignment & a, amrex::ParticleReal rotation_degree) { - a.m_rotation = rotation_degree * elements::Alignment::degree2rad; + a.m_rotation = rotation_degree * elements::mixin::Alignment::degree2rad; }, "rotation error in the transverse plane in degree" ) ; - py::class_(mx, "PipeAperture") + py::class_(mx, "PipeAperture") .def_property_readonly("aperture_x", - &elements::PipeAperture::aperture_x, + &elements::mixin::PipeAperture::aperture_x, "horizontal aperture in m" ) .def_property_readonly("aperture_y", - &elements::PipeAperture::aperture_y, + &elements::mixin::PipeAperture::aperture_y, "vertical aperture in m" ) ; - py::class_(mx, "LinearTransport") + py::class_(mx, "LinearTransport") // type of map .def_property_readonly_static("Map6x6", - [](py::object /* lt */){ return py::type::of(); }, + [](py::object /* lt */){ return py::type::of(); }, "1-indexed, Fortran-ordered, 6x6 linear transport map type" ) // values of the map //.def_property_readonly("R", - // [](elements::LinearTransport const & lt) { return lt.m_transport_map; }, + // [](elements::mixin::LinearTransport const & lt) { return lt.m_transport_map; }, // "1-indexed, Fortran-ordered, 6x6 linear transport map values" //) ; // diagnostics - py::class_ py_BeamMonitor(me, "BeamMonitor"); + py::class_ py_BeamMonitor(me, "BeamMonitor"); py_BeamMonitor .def(py::init(), py::arg("name"), @@ -295,7 +295,7 @@ void init_elements(py::module& m) // beam optics - py::class_ py_Aperture(me, "Aperture"); + py::class_ py_Aperture(me, "Aperture"); py_Aperture .def("__repr__", [](Aperture const & ap) { @@ -400,7 +400,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Aperture); - py::class_ py_ChrDrift(me, "ChrDrift"); + py::class_ py_ChrDrift(me, "ChrDrift"); py_ChrDrift .def("__repr__", [](ChrDrift const & chr_drift) { @@ -433,7 +433,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ChrDrift); - py::class_ py_ChrQuad(me, "ChrQuad"); + py::class_ py_ChrQuad(me, "ChrQuad"); py_ChrQuad .def("__repr__", [](ChrQuad const & chr_quad) { @@ -481,7 +481,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ChrQuad); - py::class_ py_ChrPlasmaLens(me, "ChrPlasmaLens"); + py::class_ py_ChrPlasmaLens(me, "ChrPlasmaLens"); py_ChrPlasmaLens .def("__repr__", [](ChrPlasmaLens const & chr_pl_lens) { @@ -529,7 +529,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ChrPlasmaLens); - py::class_ py_ChrAcc(me, "ChrAcc"); + py::class_ py_ChrAcc(me, "ChrAcc"); py_ChrAcc .def("__repr__", [](ChrAcc const & chr_acc) { @@ -578,7 +578,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ChrAcc); - py::class_ py_ConstF(me, "ConstF"); + py::class_ py_ConstF(me, "ConstF"); py_ConstF .def("__repr__", [](ConstF const & constf) { @@ -635,7 +635,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ConstF); - py::class_ py_DipEdge(me, "DipEdge"); + py::class_ py_DipEdge(me, "DipEdge"); py_DipEdge .def("__repr__", [](DipEdge const & dip_edge) { @@ -691,7 +691,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_DipEdge); - py::class_ py_Drift(me, "Drift"); + py::class_ py_Drift(me, "Drift"); py_Drift .def("__repr__", [](Drift const & drift) { @@ -724,7 +724,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Drift); - py::class_ py_ExactDrift(me, "ExactDrift"); + py::class_ py_ExactDrift(me, "ExactDrift"); py_ExactDrift .def("__repr__", [](ExactDrift const & exact_drift) { @@ -757,7 +757,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ExactDrift); - py::class_ py_ExactSbend(me, "ExactSbend"); + py::class_ py_ExactSbend(me, "ExactSbend"); py_ExactSbend .def("__repr__", [](ExactSbend const & exact_sbend) { @@ -806,7 +806,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ExactSbend); - py::class_ py_Kicker(me, "Kicker"); + py::class_ py_Kicker(me, "Kicker"); py_Kicker .def("__repr__", [](Kicker const & kicker) { @@ -858,7 +858,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Kicker); - py::class_ py_Multipole(me, "Multipole"); + py::class_ py_Multipole(me, "Multipole"); py_Multipole .def("__repr__", [](Multipole const & multipole) { @@ -907,7 +907,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Multipole); - py::class_ py_Empty(me, "Empty"); + py::class_ py_Empty(me, "Empty"); py_Empty .def("__repr__", [](Empty const & /* empty */) { @@ -920,7 +920,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Empty); - py::class_ py_Marker(me, "Marker"); + py::class_ py_Marker(me, "Marker"); py_Marker .def("__repr__", [](Marker const & marker) { @@ -933,7 +933,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Marker); - py::class_ py_NonlinearLens(me, "NonlinearLens"); + py::class_ py_NonlinearLens(me, "NonlinearLens"); py_NonlinearLens .def("__repr__", [](NonlinearLens const & nl) { @@ -973,7 +973,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_NonlinearLens); - py::class_ py_PlaneXYRot(me, "PlaneXYRot"); + py::class_ py_PlaneXYRot(me, "PlaneXYRot"); py_PlaneXYRot .def("__repr__", [](PlaneXYRot const & plane_xyrot) { @@ -1005,7 +1005,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_PlaneXYRot); - py::class_(me, "Programmable", py::dynamic_attr()) + py::class_(me, "Programmable", py::dynamic_attr()) .def("__repr__", [](Programmable const & prg) { return element_name( @@ -1060,7 +1060,7 @@ void init_elements(py::module& m) ) ; - py::class_ py_Quad(me, "Quad"); + py::class_ py_Quad(me, "Quad"); py_Quad .def("__repr__", [](Quad const & quad) { @@ -1101,7 +1101,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Quad); - py::class_ py_RFCavity(me, "RFCavity"); + py::class_ py_RFCavity(me, "RFCavity"); py_RFCavity .def("__repr__", [](RFCavity const & rfc) { @@ -1171,7 +1171,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_RFCavity); - py::class_ py_Sbend(me, "Sbend"); + py::class_ py_Sbend(me, "Sbend"); py_Sbend .def("__repr__", [](Sbend const & sbend) { @@ -1212,7 +1212,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Sbend); - py::class_ py_CFbend(me, "CFbend"); + py::class_ py_CFbend(me, "CFbend"); py_CFbend .def("__repr__", [](CFbend const & cfbend) { @@ -1261,7 +1261,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_CFbend); - py::class_ py_Buncher(me, "Buncher"); + py::class_ py_Buncher(me, "Buncher"); py_Buncher .def("__repr__", [](Buncher const & buncher) { @@ -1301,7 +1301,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Buncher); - py::class_ py_ShortRF(me, "ShortRF"); + py::class_ py_ShortRF(me, "ShortRF"); py_ShortRF .def("__repr__", [](ShortRF const & short_rf) { @@ -1349,7 +1349,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ShortRF); - py::class_ py_SoftSolenoid(me, "SoftSolenoid"); + py::class_ py_SoftSolenoid(me, "SoftSolenoid"); py_SoftSolenoid .def("__repr__", [](SoftSolenoid const & soft_sol) { @@ -1410,7 +1410,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_SoftSolenoid); - py::class_ py_Sol(me, "Sol"); + py::class_ py_Sol(me, "Sol"); py_Sol .def("__repr__", [](Sol const & sol) { @@ -1451,7 +1451,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_Sol); - py::class_ py_PRot(me, "PRot"); + py::class_ py_PRot(me, "PRot"); py_PRot .def("__repr__", [](PRot const & prot) { @@ -1485,7 +1485,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_PRot); - py::class_ py_SoftQuadrupole(me, "SoftQuadrupole"); + py::class_ py_SoftQuadrupole(me, "SoftQuadrupole"); py_SoftQuadrupole .def("__repr__", [](SoftQuadrupole const & soft_quad) { @@ -1539,7 +1539,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_SoftQuadrupole); - py::class_ py_ThinDipole(me, "ThinDipole"); + py::class_ py_ThinDipole(me, "ThinDipole"); py_ThinDipole .def("__repr__", [](ThinDipole const & thin_dp) { @@ -1579,7 +1579,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_ThinDipole); - py::class_ py_TaperedPL(me, "TaperedPL"); + py::class_ py_TaperedPL(me, "TaperedPL"); py_TaperedPL .def("__repr__", [](TaperedPL const & taperedpl) { @@ -1633,7 +1633,7 @@ void init_elements(py::module& m) ; register_beamoptics_push(py_TaperedPL); - py::class_ py_LinearMap(me, "LinearMap"); + py::class_ py_LinearMap(me, "LinearMap"); py_LinearMap .def("__repr__", [](LinearMap const & linearmap) { @@ -1643,7 +1643,7 @@ void init_elements(py::module& m) } ) .def(py::init< - elements::LinearTransport::Map6x6, + elements::mixin::LinearTransport::Map6x6, amrex::ParticleReal, amrex::ParticleReal, amrex::ParticleReal, @@ -1660,7 +1660,7 @@ void init_elements(py::module& m) ) .def_property("R", [](LinearMap & linearmap) { return linearmap.m_transport_map; }, - [](LinearMap & linearmap, elements::LinearTransport::Map6x6 R) { linearmap.m_transport_map = R; }, + [](LinearMap & linearmap, elements::mixin::LinearTransport::Map6x6 R) { linearmap.m_transport_map = R; }, "linear map as a 6x6 transport matrix" ) .def_property("ds",