1#ifndef PHYTH_MAGNETIC_FIELD_HPP
2#define PHYTH_MAGNETIC_FIELD_HPP
56 template<
typename...
Args>
89 template<
typename T,
typename = std::enable_if<is_magnetic_source_v<T> > >
90 [[
nodiscard]] std::unordered_set<std::shared_ptr<T> >
92 std::unordered_set<std::shared_ptr<T> >
sources;
125 template<
typename...
Args>
136 std::unordered_set<std::shared_ptr<MagneticSource> >
sources_;
Magnetic field composed of multiple magnetic sources.
void AddSource(std::shared_ptr< MagneticSource > source)
Add a single magnetic source to the field.
void RemoveSources(Args &&... args)
Remove multiple sources.
std::unordered_set< std::shared_ptr< MagneticSource > > GetSources() const
Get all sources currently in the field.
Vector3< Quantity< Tesla > > GetValueAt(const Vector3< Quantity< Meter > > &point) const override
Compute the total magnetic field at a point.
void Clear()
Remove all sources from the field.
std::unordered_set< std::shared_ptr< MagneticSource > > sources_
void AddSources(Args &&... args)
Add multiple magnetic sources.
std::unordered_set< std::shared_ptr< T > > GetMagneticSources() const
Get all sources of a specific type.
void RemoveSource(const std::shared_ptr< MagneticSource > &source)
Remove a specific source from the field.
Base class for physical fields (scalar or vector)
Physical quantity with a value and a compile-time unit.
3D vector with Quantity components