Skip to content

Linear Magnetic Solver

LinearMagneticSolver computes the perturbed magnetic field inside a heterogeneous susceptibility distribution, given an applied field H0 and a linear spatial gradient tensor H0. The solver is linear in H — each phase contributes χα to the local mixture χ(ϕ)=αϕαχα — and the output feeds the magnetic driving force back into the phase-field equation. The magnetism overview covers the constitutive relation and the applied-field parameterisation; this page lists the full input contract.

Key Classes and Concepts

  • LinearMagneticSolver : public OPObject: the field solver and driving-force publisher.

Usage

Input

Defined in the @LinearMagneticSolver block.

text
@LinearMagneticSolver

# Applied uniform field (A/m) {#applied-uniform-field-am}
$H0X    Applied field X component   : 1.0
$H0Y    Applied field Y component   : 0.0
$H0Z    Applied field Z component   : 0.0

# Linear gradient ∂H_i / ∂x_j  (row = i, column = j) {#linear-gradient-h_i-x_j-row-i-column-j}
$H0XX   ∂Hx/∂x                     : 0.0
$H0YX   ∂Hy/∂x                     : 0.0
$H0ZX   ∂Hz/∂x                     : 0.0
$H0XY   ∂Hx/∂y                     : 0.0
$H0YY   ∂Hy/∂y                     : 0.0
$H0ZY   ∂Hz/∂y                     : 0.0
$H0XZ   ∂Hx/∂z                     : 0.0
$H0YZ   ∂Hy/∂z                     : 0.0
$H0ZZ   ∂Hz/∂z                     : 0.0

# Per-phase susceptibility {#per-phase-susceptibility}
$chi_0  Susceptibility of phase 0   : 1.0e-5
$chi_1  Susceptibility of phase 1   : 5.0e-5

Every $H0* token defaults to 0.0. $chi_<n> must be supplied for each active phase.

Output

  • VTK: the solver writes the applied-field, perturbed-field, and magnetisation fields through WriteVTK (consult the header for the exact names).
  • The magnetic driving force is added to the shared DrivingForce object when the solver is stepped.

Example

cpp
#include "Magnetism/LinearMagneticSolver.h"

LinearMagneticSolver LMS(OPSettings, InputFile);

for(RTC.tStep = RTC.tStart; RTC.tStep <= RTC.nSteps; RTC.IncrementTimeStep())
{
    // ... phase-field update ...
    LMS.Solve(Phi, BC);

    if (RTC.WriteVTK()) LMS.WriteVTK(OPSettings, RTC.tStep);
}

Dependencies

Released under the GNU GPLv3 License.