Migrating from 1.x to 2.0

LMhdX is HARTMAX from 2.0. The 1.x releases stay on PyPI as lmhdx; 2.0 and later are hartmax. Install hartmax, import hartmax, and run the hartmax command. The compilation cache moves to ~/.cache/hartmax and its variable is HARTMAX_COMPILATION_CACHE. Records are written as hartmax.record; lmhdx.record files written by a 2.0 development version are still read.

Every 1.x entry point below is removed in 2.0 (1.12 and the releases before 2.0 warn). The numbers do not change: each replacement reaches the same kernel. The kernel constructors hartmax.core3d.duct_problem and hartmax.axial.fringe_duct are the presets duct and fringe_duct passed through channel_kernel, so both build the same object.

1.x

2.0

make_hartmann_case(ha, ny=n, nz=n), make_shercliff_case(...)

duct(ha, n) (one insulating square duct; field along y)

make_hunt_case(ha, ny=n, nz=n, wall_conductance_ratio=c)

duct(ha, n, wall_conductance=c); resolved walls: duct(ha, n, walls=dict(y=Wall(layers=...)))

lmhdx.solve(case) and result.state.u, .converged, .status

hartmax.solve(problem): result.velocity[0].data[0], result.residual, result.flow_rate, result.pressure_gradient

solve_fully_developed_fields(case, forcing=f, magnetic_field_scale=s)

solve_steady_state(duct_problem(...), forcing=(f, 0, 0), field_scale=s) (hartmax.steady, jittable), or problem.replace(forcing=..., B=Uniform(strength=...)) through hartmax.solve

a case with a target flow rate

duct(ha, n, flow_rate=Q): the drive is result.pressure_gradient

fluid_cell_areas, volumetric_flow_rate, linear_flow_response, drive_for_flow_rate, fixed_flow_hydraulic_power

hartmax.steady.channel_cross_section_weights, channel_flow_rate, channel_flow_response, channel_drive_for_flow_rate, channel_fixed_flow_hydraulic_power

a transient CaseSpec

hartmax.solve(problem, hartmax.Solver(dt=..., steps=...))

write_solution_outputs, write_restart_npz, load_restart_bundle

hartmax.Output(dir) and solve(..., start=path); a 1.x restart file is not read, so rerun from the start

load_run_config

hartmax.config.load

benchmark_solver

scripts/run_benchmarks.py

hartmann_validation, validation_summary, plots

the analytic profiles of validation/; ParaView files of Output

lmhdx run/validate/benchmark, schema 1 and 2 TOML files

hartmax FILE.toml over a schema 3 file; hartmax upgrade OLD.toml converts schema 1 and 2

lmx command, x64 and XLA_FLAGS set on import

hartmax; hartmax.configure(dtype="float64", gpu_gemm=True)

lmhdx.cases: the units, ratios and WallLayer

hartmax.units

lmhdx.cases: NumericalFailure

hartmax.solver.NumericalFailure

lmhdx.cases: generate_rect_duct_mesh_from_faces, make_divergence_free_cross_section_field, sample_cross_section_field, sample_tabulated_cross_section_field

the grid of the Problem; hartmax.fields.Func and Table; hartmax.fields.write_tabulated_field_npz and load_tabulated_field

lmhdx.coreflow

validation/coreflow.py (from validation.coreflow import CoreFlow from a checkout)

root names other than Problem, Solver, Output, solve, the presets and the runtime calls (from lmhdx import Wall, Q2DProblem, WallLayer)

their modules: from hartmax.problem import Wall, from hartmax.q2d import Q2DProblem, from hartmax.units import WallLayer

lmhdx.fully_developed, lmhdx.cases (CaseSpec, RunConfig), lmhdx.io

removed with their entry points above