Skip to content

num::magnetic_solver

Defined in header <pde/field_solver.hpp>

class magnetic_solver;

The static magnetic field of a current density, by three Poisson solves.

Members

member description
static constexpr double MU0 = 1.2566370614e-6 mu_0 [H/m]
static vector_field_3d current_density(const scalar_field_3d &sigma, const scalar_field_3d &phi) Compute current density J = -sigma*grad(phi) [A/m^2].
static vector_field_3d solve_magnetic_field(const vector_field_3d &J, double tol = 1e-6, int max_iter = 500) Solve for static magnetic field B given current density J. Solves Laplacian(A) = -mu0*J (Coulomb gauge, Dirichlet A=0) via three CG solves, then returns B = curl(A).