|
numerics
|
#include "field.hpp"#include <raylib.h>#include <raymath.h>#include <chrono>#include <cmath>#include <cstdio>#include <vector>Go to the source code of this file.
Functions | |
| int | main () |
DC current through an aluminum rod + movable permanent magnet.
Physics: Rod B field – precomputed once via div(sigmagradphi)=0 -> J -> laplacianA=-mu_0J -> B=curlA Magnet – magnetic dipole field, evaluated analytically every frame: B_dip = mu_0/4pi * [3(m*r_hat)r_hat - m] / r^3 (m = M0*y_hat) Total B – B_rod (sampled from grid) + B_dip (analytical)
Controls: LMB drag – orbit camera RMB drag – pan Scroll – zoom Shift + LMB drag – move magnet (horizontal -> XZ, vertical -> Y)
Definition in file main.cpp.
| int main | ( | ) |
Definition at line 84 of file main.cpp.
References num::MagneticSolver::current_density(), num::ScalarField3D::grid(), num::Grid3D::set(), num::MagneticSolver::solve_magnetic_field(), physics::ElectricSolver::solve_potential(), num::VectorField3D::x, num::VectorField3D::y, and num::VectorField3D::z.