|
OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
|
#include <MeshGenerator.h>

Public Member Functions | |
| MeshGenerator () | |
| void | setDriftReference (double minor, double major) |
| Set the drift support radius used when meshing drift spaces. | |
| void | add (const ElementBase &element) |
| void | write (const std::string &fname) |
Static Public Member Functions | |
| static bool | getTransverseSupport (const ElementBase &element, double &minor, double &major) |
| Extract a transverse support size suitable for placement/export meshes. | |
Private Types | |
| enum | MeshType { OTHER = 0 , DIPOLE , QUADRUPOLE , SEXTUPOLE , OCTUPOLE , SOLENOID , RFCAVITY , TRAVELINGWAVE , DRIFT } |
Static Private Member Functions | |
| static MeshData | getCylinder (double length, double minor, double major, double formFactor, const unsigned int numSegments=36) |
| static MeshData | getTube (double length, double innerMinor, double innerMajor, double outerMinor, double outerMajor, const unsigned int numSegments=36) |
| Build a hollow tube aligned with the local z-axis. | |
| static MeshData | getQuadrupole (double length, double minor, double major, double formFactor) |
| Build a quadrupole-like body from four longitudinal pole blocks. | |
| static MeshData | getSolenoid (double length, double minor, double major) |
| Build a solenoid body as a hollow tube with short end collars. | |
| static MeshData | getRFCavity (double length, double minor, double major) |
| Build a standing-wave cavity body from a sequence of bulged cells. | |
| static MeshData | getTravelingWave (double length, double minor, double major) |
| Build a traveling-wave structure with repeated shallow corrugations. | |
| static MeshData | getBox (double length, double width, double height, double formFactor) |
Private Attributes | |
| std::vector< MeshData > | elements_m |
| bool | hasDriftReference_m |
| double | driftMinor_m |
| double | driftMajor_m |
Definition at line 29 of file MeshGenerator.h.
|
private |
| Enumerator | |
|---|---|
| OTHER | |
| DIPOLE | |
| QUADRUPOLE | |
| SEXTUPOLE | |
| OCTUPOLE | |
| SOLENOID | |
| RFCAVITY | |
| TRAVELINGWAVE | |
| DRIFT | |
Definition at line 64 of file MeshGenerator.h.
| MeshGenerator::MeshGenerator | ( | ) |
Definition at line 42 of file MeshGenerator.cpp.
| void MeshGenerator::add | ( | const ElementBase & | element | ) |
Definition at line 87 of file MeshGenerator.cpp.
References CONIC_ELLIPTICAL, CONIC_RECTANGULAR, MeshData::decorations_m, DIPOLE, DRIFT, DRIFT, driftMajor_m, driftMinor_m, elements_m, ELLIPTICAL, ElementBase::getAperture(), getBox(), getCylinder(), ElementBase::getElementDimensions(), ElementBase::getElementLength(), Multipole::getMaxNormalComponentIndex(), PlacedElement::getNominalBodyTransform(), ElementBase::getPlacedElement(), getQuadrupole(), getRFCavity(), getSolenoid(), getTransverseSupport(), getTravelingWave(), getTube(), ElementBase::getType(), hasDriftReference_m, CoordinateSystemTrafo::inverted(), MULTIPOLE, OCTUPOLE, OTHER, QUADRUPOLE, RBEND, RBEND3D, RECTANGULAR, RFCAVITY, RFCAVITY, CoordinateSystemTrafo::rotateTo(), SBEND, SEXTUPOLE, SOLENOID, SOLENOID, CoordinateSystemTrafo::transformTo(), TRAVELINGWAVE, TRAVELINGWAVE, MeshData::type_m, and MeshData::vertices_m.
Referenced by OpalBeamline::save3DLattice(), TEST_F(), and TEST_F().

|
staticprivate |
Definition at line 1357 of file MeshGenerator.cpp.
References MeshData::decorations_m, MeshData::triangles_m, and MeshData::vertices_m.
Referenced by add(), and getQuadrupole().
|
staticprivate |
Definition at line 1160 of file MeshGenerator.cpp.
References MeshData::decorations_m, MeshData::triangles_m, Physics::two_pi, and MeshData::vertices_m.
Referenced by add().
|
staticprivate |
Build a quadrupole-like body from four longitudinal pole blocks.
The pole blocks are scaled from the element aperture and extruded along the full element length so that the resulting shape remains meaningful when the quadrupole length changes.
| length | Body length along the local z-axis. |
| minor | Aperture semi-axis in the local y-direction. |
| major | Aperture semi-axis in the local x-direction. |
| formFactor | Exit scaling factor used for conic apertures. |
Definition at line 1251 of file MeshGenerator.cpp.
References getBox().
Referenced by add().

|
staticprivate |
Build a standing-wave cavity body from a sequence of bulged cells.
The body is assembled from hollow tube segments with alternating neck and cell radii. This produces a programmer-facing standing-wave cavity shape while remaining purely geometric and length-scaled.
| length | Body length along the local z-axis. |
| minor | Outer semi-axis in the local y-direction. |
| major | Outer semi-axis in the local x-direction. |
Definition at line 1307 of file MeshGenerator.cpp.
References getTube().
Referenced by add().

|
staticprivate |
Build a solenoid body as a hollow tube with short end collars.
The body is scaled from the transverse support envelope and extruded over the full element length. Short end collars make the solenoid visually distinct from both drifts and plain cylindrical supports.
| length | Body length along the local z-axis. |
| minor | Outer semi-axis in the local y-direction. |
| major | Outer semi-axis in the local x-direction. |
Definition at line 1281 of file MeshGenerator.cpp.
References getTube().
Referenced by add().

|
static |
Extract a transverse support size suitable for placement/export meshes.
The returned radii are in the element-local transverse frame. This is used both for direct meshing and for deriving a representative drift radius from the first non-drift element in the lattice.
| element | Beamline element to inspect. |
| minor | Output minor transverse radius. |
| major | Output major transverse radius. |
Definition at line 45 of file MeshGenerator.cpp.
References CONIC_ELLIPTICAL, CONIC_RECTANGULAR, DRIFT, ELLIPTICAL, ElementBase::getAperture(), ElementBase::getType(), RECTANGULAR, and SOLENOID.
Referenced by add(), and OpalBeamline::save3DLattice().

|
staticprivate |
Build a traveling-wave structure with repeated shallow corrugations.
Compared to the standing-wave cavity, the modulation is more uniform and elongated to suggest a periodic accelerating structure.
| length | Body length along the local z-axis. |
| minor | Outer semi-axis in the local y-direction. |
| major | Outer semi-axis in the local x-direction. |
Definition at line 1332 of file MeshGenerator.cpp.
References getTube().
Referenced by add().

|
staticprivate |
Build a hollow tube aligned with the local z-axis.
The tube is represented by triangulated inner and outer walls without end caps. This is used for drift sections to visualise the beam pipe rather than a solid support body.
| length | Tube length along the local z-axis. |
| innerMinor | Inner semi-axis in the local y-direction. |
| innerMajor | Inner semi-axis in the local x-direction. |
| outerMinor | Outer semi-axis in the local y-direction. |
| outerMajor | Outer semi-axis in the local x-direction. |
| numSegments | Number of azimuthal segments. |
Definition at line 1202 of file MeshGenerator.cpp.
References MeshData::triangles_m, Physics::two_pi, and MeshData::vertices_m.
Referenced by add(), getRFCavity(), getSolenoid(), and getTravelingWave().
| void MeshGenerator::setDriftReference | ( | double | minor, |
| double | major | ||
| ) |
Set the drift support radius used when meshing drift spaces.
Drifts do not carry their own physical support envelope. For visualisation we derive a representative cylindrical radius from the first non-drift element in the beamline and reuse it for all drifts.
| minor | Minor transverse radius. |
| major | Major transverse radius. |
Definition at line 81 of file MeshGenerator.cpp.
References driftMajor_m, driftMinor_m, and hasDriftReference_m.
Referenced by OpalBeamline::save3DLattice().
| void MeshGenerator::write | ( | const std::string & | fname | ) |
Definition at line 205 of file MeshGenerator.cpp.
References Util::base64_encode(), Util::combineFilePath(), elements_m, OpalData::getAuxiliaryOutputDirectory(), and OpalData::getInstance().
Referenced by OpalBeamline::save3DLattice(), TEST_F(), and TEST_F().

|
private |
Definition at line 160 of file MeshGenerator.h.
Referenced by add(), and setDriftReference().
|
private |
Definition at line 159 of file MeshGenerator.h.
Referenced by add(), and setDriftReference().
|
private |
Definition at line 157 of file MeshGenerator.h.
|
private |
Definition at line 158 of file MeshGenerator.h.
Referenced by add(), and setDriftReference().