OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
TestLaser.cpp File Reference
#include "Algorithms/DefaultVisitor.h"
#include "Algorithms/ParallelTracker.h"
#include "Attributes/Attributes.h"
#include "BeamlineCore/LaserRep.h"
#include "BeamlineCore/RBendRep.h"
#include "BeamlineCore/SBendRep.h"
#include "Beamlines/FlaggedElmPtr.h"
#include "Beamlines/TBeamline.h"
#include "Elements/OpalLaser.h"
#include "Physics/Physics.h"
#include "Utilities/LogicalError.h"
#include "Utilities/OpalException.h"
#include "gtest/gtest.h"
#include <cmath>
Include dependency graph for TestLaser.cpp:

Go to the source code of this file.

Functions

 TEST (TestLaser, UpdateStoresValidatedParameters)
 
 TEST (TestLaser, UpdateDefaultsStokesToZero)
 
 TEST (TestLaser, UpdateRequiresWavelength)
 
 TEST (TestLaser, UpdateRejectsNonPositivePulseEnergy)
 
 TEST (TestLaser, UpdateRejectsBadDirectionSize)
 
 TEST (TestLaser, UpdateRejectsZeroDirection)
 
 TEST (TestLaser, UpdateRejectsBadStokesSize)
 
 TEST (TestLaser, UpdateRejectsStokesNormAboveOne)
 
 TEST (TestLaser, UpdateRejectsNegativeLength)
 
 TEST (TestLaser, LinearComptonForwardPhotonEnergyMatchesExactNinetyDegreeKinematics)
 Benchmark the CAIN-inspired linear Compton helper for a 90 degree laser crossing.
 
 TEST (TestLaser, BeamlineVisitorDispatchesLaserAndBendsToSpecificHooks)
 

Function Documentation

◆ TEST() [1/11]

TEST ( TestLaser  ,
BeamlineVisitorDispatchesLaserAndBendsToSpecificHooks   
)

Definition at line 200 of file TestLaser.cpp.

References Laser::accept(), RBend::accept(), and SBend::accept().

Here is the call graph for this function:

◆ TEST() [2/11]

TEST ( TestLaser  ,
LinearComptonForwardPhotonEnergyMatchesExactNinetyDegreeKinematics   
)

Benchmark the CAIN-inspired linear Compton helper for a 90 degree laser crossing.

The configuration is the simplest fixed-angle case used as a physics-facing unit test: an electron with total energy \(E_e\) moves along \(+\hat z\), the laser propagates along \(+\hat x\), and the scattered photon is evaluated in the forward electron direction \(+\hat z\).

The exact reference formulas used in this test are

\[ \omega_L = \frac{2\pi \hbar c}{\lambda_L}, \]

\[ p_e = \sqrt{E_e^2 - m_e^2}, \]

\[ x = \frac{2 E_e \omega_L}{m_e^2}, \]

and the forward scattered photon energy from exact energy-momentum conservation, written in a numerically stable form,

\[ \omega_\gamma^{\prime} = \frac{E_e\,\omega_L}{\omega_L + m_e^2/(E_e + p_e)}. \]

The stable denominator avoids catastrophic cancellation in the equivalent expression \(E_e - p_e + \omega_L\) for relativistic electrons.

Definition at line 167 of file TestLaser.cpp.

References OpalLaser::DIR, Element::getElement(), Object::itsAttr, Physics::m_e, Attributes::setRealArray(), and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [3/11]

TEST ( TestLaser  ,
UpdateDefaultsStokesToZero   
)

Definition at line 67 of file TestLaser.cpp.

References Element::getElement(), and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [4/11]

TEST ( TestLaser  ,
UpdateRejectsBadDirectionSize   
)

Definition at line 99 of file TestLaser.cpp.

References OpalLaser::DIR, Object::itsAttr, Attributes::setRealArray(), and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [5/11]

TEST ( TestLaser  ,
UpdateRejectsBadStokesSize   
)

Definition at line 115 of file TestLaser.cpp.

References Object::itsAttr, Attributes::setRealArray(), OpalLaser::STOKES, and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [6/11]

TEST ( TestLaser  ,
UpdateRejectsNegativeLength   
)

Definition at line 131 of file TestLaser.cpp.

References Object::itsAttr, OpalElement::LENGTH, Attributes::setReal(), and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [7/11]

TEST ( TestLaser  ,
UpdateRejectsNonPositivePulseEnergy   
)

Definition at line 91 of file TestLaser.cpp.

References Object::itsAttr, OpalLaser::PULSEENERGY, Attributes::setReal(), and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [8/11]

TEST ( TestLaser  ,
UpdateRejectsStokesNormAboveOne   
)

Definition at line 123 of file TestLaser.cpp.

References Object::itsAttr, Attributes::setRealArray(), OpalLaser::STOKES, and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [9/11]

TEST ( TestLaser  ,
UpdateRejectsZeroDirection   
)

Definition at line 107 of file TestLaser.cpp.

References OpalLaser::DIR, Object::itsAttr, Attributes::setRealArray(), and OpalLaser::update().

Here is the call graph for this function:

◆ TEST() [10/11]

TEST ( TestLaser  ,
UpdateRequiresWavelength   
)

◆ TEST() [11/11]

TEST ( TestLaser  ,
UpdateStoresValidatedParameters   
)

Definition at line 45 of file TestLaser.cpp.

References Element::getElement(), Object::itsAttr, OpalElement::LENGTH, Attributes::setReal(), Attributes::setRealArray(), OpalLaser::STOKES, and OpalLaser::update().

Here is the call graph for this function: