Nodemag dynamic solver

Z_sim_dynamic_stereo_nodemag subclasses Z_sim_dynamic_stereo_base with mixed unknowns (q_A, q_B) only. The demag term is stripped from energy_terms; set_magnetostatics and set_BEMcpp are no-ops.

Use when shape demagnetization is negligible or when external Zeeman fields are prescribed. Exchange, anisotropy, Zeeman, atlas logic, BDF stepping, and acceptance gates match the demag variant. Allowed outputs are listed under Output targets (demag-only names raise ValueError).

Typical call sequence

set_mesh → set_materials → set_external_field → initialize charts → init_dynamic → solve_problem.

Configuration keys: Configuration reference. Workflow example: Getting started.

class Zmag_bins.Zmag_dynamic_stereo_nodemag.Z_sim_dynamic_stereo_nodemag(args_init_sim: dict)[source]

Bases: Z_sim_dynamic_stereo_base

Stereographic LLG with mixed unknowns (q_A, q_B) only.

Shares the base-class time loop and atlas with the demag variant but omits V_phi and magnetostatics.

__init__(args_init_sim: dict) → None[source]

Initialize no-demag solver configuration and chart basis.

Parameters:

args_init_sim (dict) – See class docstring. Raises ValueError if no energy terms remain after removing demag.

init_dynamic(args_init_dyn: dict)[source]

Configure time integration, SNES, BDF history, ramps, and I/O for (q_A, q_B).

Same contract as the demag solver except magnetostatics, demag continuation, and demag-only outputs are absent.

Parameters:

args_init_dyn (dict) – Dynamic configuration dictionary (requires cfl_settings). See Configuration reference in the manual.

Raises:
  • ValueError – On invalid configuration keys or values.

  • FileNotFoundError – If required path_dirs entries are missing.

  • KeyError – If a required path_dirs key is absent.

compute_energy()[source]

Evaluate atlas-weighted energy without a demag term.

Returns:

  • numpy.ndarray

  • Energy components followed by total.

solve_weak_form(max_outer_override=None)[source]

Advance one timestep on (q_A,q_B) with q-only outer fixed-point and SNES.

Called from solve_problem() inside each retry attempt. Acceptance gates (residual, thermo, closure) run in the base class after this returns.

Parameters:

max_outer_override (int, optional) – Cap outer-split iterations.

Returns:

q_defect, converged, outer-iteration metadata.

Return type:

dict

solve_magnetostatics(step)[source]

Write restart magnetization checkpoint when resuming from a saved state.

open_output(target: str, filename: str)[source]

Open BP (VTX) and optional XDMF time-series writers for a field target.

Parameters:
  • target (str) – Field name (see FEATURE_MATRIX.md). Demag-only targets raise in nodemag.

  • filename (str) – Base path for .bp output (XDMF uses parallel .xdmf naming).

close_output(target: str)[source]

Close qAqB-local output writers.

write_output(target: str)[source]

Update and write fields for target at current time self.t.

Parameters:

target (str)

write_checkpoint(filename)[source]

Checkpoint mesh, tags, and qA/qB BDF history npz files.

write_phi1_boundary(filename)[source]

Not supported in nodemag; raises ValueError.

write_xdmf_checkpoint(target: str, filename: str)[source]

Checkpoint field in XDMF for no-demag qA/qB model.

set_magnetostatics(interfaces: list[dict], surface_tag: int)[source]

Ignored in nodemag; present so shared drivers can call the demag API safely.

set_BEMcpp(BEM_dir: str)[source]

Ignored in nodemag; no BEM demagnetizing operator is assembled.

read_checkpoint_demag(filename)[source]

Not supported in nodemag.

Raises:
  • ValueError –

  • Always raised. –

read_checkpoint_mesh(mpi_comm, filename)[source]

Read checkpointed mesh and tags from BP.

read_checkpoint_time(run_dir, filename)[source]

Read restart step/time/dt from checkpoint energies table.

See also

Module overview: Zmag_bins.Zmag_dynamic_stereo_nodemag