45#include <gtest/gtest.h>
103 char** argv =
nullptr;
104 ippl::initialize(argc, argv);
122 EXPECT_FALSE(monitor.
bends());
139 EXPECT_DOUBLE_EQ(zBegin, -0.005);
140 EXPECT_DOUBLE_EQ(zEnd, 0.005);
207 EXPECT_FALSE(monitor.
apply(std::shared_ptr<ParticleContainer_t>()));
239 EXPECT_FALSE(monitor.
apply(R, P, 0.0, E, B));
241 EXPECT_DOUBLE_EQ(E(0), 1.0);
242 EXPECT_DOUBLE_EQ(E(1), 2.0);
243 EXPECT_DOUBLE_EQ(E(2), 3.0);
245 EXPECT_DOUBLE_EQ(B(0), 4.0);
246 EXPECT_DOUBLE_EQ(B(1), 5.0);
247 EXPECT_DOUBLE_EQ(B(2), 6.0);
ippl::Vector< T, Dim > Vector_t
TEST_F(MonitorTest, GetType)
void scale(double) override
Scale the field.
Abstract base class for electromagnetic fields.
static void TearDownTestSuite()
static void SetUpTestSuite()
virtual void goOnline(const double &kineticEnergy) override
@ XY
Monitor acts on both planes.
@ OFF
Monitor is off (inactive).
virtual ElementType getType() const override
virtual bool isInside(const Vector_t< double, 3 > &r) const override
virtual void goOffline() override
virtual bool applyToReferenceParticle(const Vector_t< double, 3 > &R, const Vector_t< double, 3 > &P, const double &t, Vector_t< double, 3 > &E, Vector_t< double, 3 > &B) override
Apply to reference particle with position R and momemtum P.
virtual int getRequiredNumberOfTimeSteps() const override
virtual bool bends() const override
virtual void getFieldExtend(double &zBegin, double &zEnd) const override
Return the field-support extent of the component.
void setCollectionType(CollectionType type)
virtual bool apply(const std::shared_ptr< ParticleContainer_t > &pc) override
Apply to all particles. Kernel launch moved inside the function.
A geometry representing a straight line.
virtual void setElementLength(double length)
Set design length.
TestMonitor(const std::string &name)
const StraightGeometry & getGeometry() const override
Get geometry. Version for const object.
const EMField & getField() const override
Return field.
Plane getPlane() const override
Get plane on which monitor observes.
StraightGeometry & getGeometry() override
Get geometry.
void setPlane(Plane plane)
void setLength(double length)
ElementBase * clone() const override
Return clone.
EMField & getField() override
Return field.