Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
Loading...
Searching...
No Matches
ChargeSource.hpp
Go to the documentation of this file.
1#ifndef PHYTH_CHARGE_SOURCE_HPP
2#define PHYTH_CHARGE_SOURCE_HPP
3
7
31 public:
32 virtual ~ChargeSource() = default;
33
45
55 [[nodiscard]] virtual Quantity<Volt>
57
67
80 return 0_Cpm3;
81 }
82
94 [[nodiscard]] virtual Quantity<Meter>
96 };
97
105 template<typename T>
106 inline constexpr bool is_charge_source_v = std::is_base_of_v<ChargeSource, T>;
107}
108
109#endif // PHYTH_CHARGE_SOURCE_HPP
Abstract base class for all charge distributions.
virtual Quantity< Volt > GetElectricPotentialAt(const Vector3< Quantity< Meter > > &point) const =0
Compute the electric potential at a point.
virtual Vector3< Quantity< NewtonPerCoulomb > > GetElectricFieldAt(const Vector3< Quantity< Meter > > &point) const =0
Compute the electric field at a point.
virtual Quantity< Coulomb > GetTotalChargeValue() const =0
Get the total charge of this source.
virtual Quantity< CoulombPerCubicMeter > GetChargeDensityAt(const Vector3< Quantity< Meter > > &point) const
Get the charge density at a point.
virtual Quantity< Meter > GetMinimumDistanceTo(const Vector3< Quantity< Meter > > &point) const =0
Get the minimum distance from a point to this charge source.
constexpr bool is_charge_source_v
Type trait to check if a type is a ChargeSource.
constexpr bool is_unit_v
Definition Unit.hpp:79
Physical quantity with a value and a compile-time unit.
Definition Quantity.hpp:27
3D vector with Quantity components
Definition Vector3.hpp:28