|
Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
|
Abstract base class for all charge distributions. More...
#include <ChargeSource.hpp>

Public Member Functions | |
| virtual | ~ChargeSource ()=default |
| virtual Vector3< Quantity< NewtonPerCoulomb > > | GetElectricFieldAt (const Vector3< Quantity< Meter > > &point) const =0 |
| Compute the electric field at a point. | |
| virtual Quantity< Volt > | GetElectricPotentialAt (const Vector3< Quantity< Meter > > &point) const =0 |
| Compute the electric potential 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. | |
Abstract base class for all charge distributions.
ChargeSource defines the interface for any charge distribution that produces an electric field and potential. Subclasses represent specific geometries such as point charges, line charges, surface charges, volume charges, or dipoles.
The interface provides methods for computing:
Example: class PointCharge : public ChargeSource { // Implements GetElectricFieldAt, GetElectricPotentialAt, // GetTotalChargeValue, GetMinimumDistanceTo };
Definition at line 30 of file ChargeSource.hpp.
|
virtualdefault |
|
inlinevirtual |
Get the charge density at a point.
| point | Position in 3D space (meters) |
The default implementation returns zero for non-distributed sources (point charges, dipoles). Subclasses for distributed sources (line, surface, volume charges) should override this.
Reimplemented in Phyth::Electromagnetics::VolumeCharge.
Definition at line 79 of file ChargeSource.hpp.
|
pure virtual |
Compute the electric field at a point.
| point | Position in 3D space (meters) |
For point charges, this uses Coulomb's law. For distributed charges, this integrates over the source geometry.
Implemented in Phyth::Electromagnetics::DipoleCharge, Phyth::Electromagnetics::LineCharge, Phyth::Electromagnetics::MagneticDipole, Phyth::Electromagnetics::PointCharge, Phyth::Electromagnetics::SurfaceCharge, and Phyth::Electromagnetics::VolumeCharge.
|
pure virtual |
Compute the electric potential at a point.
| point | Position in 3D space (meters) |
For point charges, this uses V = k * q / r. For distributed charges, this integrates over the source geometry.
Implemented in Phyth::Electromagnetics::DipoleCharge, Phyth::Electromagnetics::LineCharge, Phyth::Electromagnetics::MagneticDipole, Phyth::Electromagnetics::PointCharge, Phyth::Electromagnetics::SurfaceCharge, and Phyth::Electromagnetics::VolumeCharge.
|
pure virtual |
Get the minimum distance from a point to this charge source.
| point | Position in 3D space (meters) |
This is used for regularization in field computations to avoid singularities. For point charges, this returns the distance to the point charge location. For extended sources, this returns the distance to the nearest point on the source geometry.
Implemented in Phyth::Electromagnetics::DipoleCharge, Phyth::Electromagnetics::LineCharge, Phyth::Electromagnetics::MagneticDipole, Phyth::Electromagnetics::PointCharge, Phyth::Electromagnetics::SurfaceCharge, and Phyth::Electromagnetics::VolumeCharge.
|
pure virtual |
Get the total charge of this source.
For point charges, this is the charge value itself. For distributed charges, this is the integral of charge density.
Implemented in Phyth::Electromagnetics::DipoleCharge, Phyth::Electromagnetics::LineCharge, Phyth::Electromagnetics::MagneticDipole, Phyth::Electromagnetics::PointCharge, Phyth::Electromagnetics::SurfaceCharge, and Phyth::Electromagnetics::VolumeCharge.