|
Phyth v0.1.0
A dimensional safe C++ header-only mechanics and electromagnetics simulation library.
|
Uniform surface charge distribution on a rectangular patch. More...
#include <SurfaceCharge.hpp>


Private Member Functions | |
| Vector3< Quantity< NewtonPerCoulomb > > | NumericalIntegrateField (const Vector3< Quantity< Meter > > &point, const int nu, const int nv) const |
| Numerical integration of electric field over the surface. | |
| Quantity< Volt > | NumericalIntegratePotential (const Vector3< Quantity< Meter > > &point, const int nu, const int nv) const |
| Numerical integration of electric potential over the surface. | |
Private Attributes | |
| Vector3< Quantity< Meter > > | center_ |
| Vector3< Scalar > | u_axis_ |
| Vector3< Scalar > | v_axis_ |
| Quantity< Meter > | width_ |
| Quantity< Meter > | height_ |
| Quantity< CoulombPerSquareMeter > | sigma_ |
Uniform surface charge distribution on a rectangular patch.
SurfaceCharge represents a flat rectangular surface with uniform charge density sigma (C/m^2). The surface is defined by its center, two orthogonal axes (u and v), and dimensions (width and height).
Field and potential are computed by numerical integration over the surface using the midpoint rule. Default resolution is 32x32 segments.
Example: auto center = Vector3<Quantity<Meter>>(0_m, 0_m, 0_m); auto u_axis = Vector3<Scalar>(1, 0, 0); auto v_axis = Vector3<Scalar>(0, 1, 0); auto sigma = 1.0e-9_C/m2;
SurfaceCharge surface(center, u_axis, v_axis, 1.0_m, 1.0_m, sigma); auto point = Vector3<Quantity<Meter>>(0_m, 0_m, 0.1_m); auto E = surface.GetElectricFieldAt(point); auto V = surface.GetElectricPotentialAt(point);
Note: The field is evaluated numerically, so accuracy depends on the integration resolution.
Definition at line 34 of file SurfaceCharge.hpp.
|
inline |
Construct a rectangular surface charge.
| center | Center of the rectangle (meters) |
| u_axis | Direction of the width axis (must be unit vector) |
| v_axis | Direction of the height axis (must be unit vector) |
| width | Length along u_axis (meters) |
| height | Length along v_axis (meters) |
| sigma | Surface charge density (C/m^2) |
u_axis and v_axis must be orthogonal. This is checked at runtime with an assert.
Definition at line 49 of file SurfaceCharge.hpp.
|
inlineoverridevirtual |
Compute the electric field at a point using numerical integration.
| point | Position to evaluate the field (meters) |
The field is integrated using the midpoint rule with 32x32 segments. Points on the surface are skipped (their contribution is ignored).
Implements Phyth::Electromagnetics::ChargeSource.
Definition at line 71 of file SurfaceCharge.hpp.
|
inlineoverridevirtual |
Compute the electric potential at a point using numerical integration.
| point | Position to evaluate the potential (meters) |
The potential is integrated using the midpoint rule with 32x32 segments. Points on the surface are skipped (their contribution is ignored).
Implements Phyth::Electromagnetics::ChargeSource.
Definition at line 85 of file SurfaceCharge.hpp.
|
inlineoverridevirtual |
Get the minimum distance from a point to the rectangular surface.
| point | Position to compute distance from |
The closest point is found by projecting the point onto the surface plane and clamping to the rectangle bounds.
Implements Phyth::Electromagnetics::ChargeSource.
Definition at line 108 of file SurfaceCharge.hpp.
|
inline |
Definition at line 122 of file SurfaceCharge.hpp.
|
inlineoverridevirtual |
Get the total charge of the surface.
Implements Phyth::Electromagnetics::ChargeSource.
Definition at line 94 of file SurfaceCharge.hpp.
|
inlineprivate |
Numerical integration of electric field over the surface.
Uses the midpoint rule with nu * nv segments. Each segment contributes dE = k_E * dq / r^2 * hat_r.
| point | Evaluation point |
| nu | Number of segments along u axis |
| nv | Number of segments along v axis |
Definition at line 142 of file SurfaceCharge.hpp.
|
inlineprivate |
Numerical integration of electric potential over the surface.
Uses the midpoint rule with nu * nv segments. Each segment contributes dV = k_E * dq / r.
| point | Evaluation point |
| nu | Number of segments along u axis |
| nv | Number of segments along v axis |
Definition at line 178 of file SurfaceCharge.hpp.
Definition at line 125 of file SurfaceCharge.hpp.
Definition at line 127 of file SurfaceCharge.hpp.
|
private |
Definition at line 128 of file SurfaceCharge.hpp.
Definition at line 126 of file SurfaceCharge.hpp.
Definition at line 126 of file SurfaceCharge.hpp.
Definition at line 127 of file SurfaceCharge.hpp.