Skip to main content

Session Workflow

Use Session when you want to initialize once and solve repeatedly with small input changes. This is useful for parameter studies where the mesh and most settings remain fixed.

import json
import eMachineSim

with open(r"Examples\thermal\bdf\input_sample_bdf_min_hexa_qvol.json") as f:
data = json.load(f)

session = eMachineSim.Session()
session.initialize(data, r"Examples\thermal\bdf")

result = session.solve()
print(result["success"])

session.update_input({
"output": {
"print_level": "summary"
}
})

result = session.solve()
session.finalize()

Notes

  • solve() runs the current input state.
  • update_input() merges a patch into the current JSON input.
  • update_volume_heat_sources() replaces the thermal_volume_heat_sources section for heat-source sweeps.

The current session workflow preserves the JSON-first execution model. It does not yet expose every internal FEM assembly step as a separate Python call.