Class ModulatedMagneticFieldGrid

Inheritance Relationships

Base Type

Class Documentation

class ModulatedMagneticFieldGrid : public MagneticField

Modulated magnetic field on a periodic grid.

This class wraps a Grid3f to serve as a MagneticField. The field is modulated on-the-fly with a Grid1f. The Grid3f and Grid1f do not need to share the same origin, spacing or size.

Public Functions

inline ModulatedMagneticFieldGrid()
ModulatedMagneticFieldGrid(ref_ptr<Grid3f> grid, ref_ptr<Grid1f> modGrid)

Constructor

Parameters:
  • grid – Grid3f storing the magnetic field vectors

  • modGrid – Grid1f used to scale the magnetic field strength B^new_i = B^old_i * scale

void setGrid(ref_ptr<Grid3f> grid)
void setModulationGrid(ref_ptr<Grid1f> modGrid)
ref_ptr<Grid3f> getGrid()
ref_ptr<Grid1f> getModulationGrid()
void setReflective(bool gridReflective, bool modGridReflective)
virtual Vector3d getField(const Vector3d &position) const
inline virtual Vector3d getField(const Vector3d &position, double z) const
inline size_t addReference() const
inline size_t removeReference() const
inline int removeReferenceNoDelete() const
inline size_t getReferenceCount() const

Protected Attributes

mutable size_t _referenceCount