Skip to content

Simulation

Introduction

Simulation is the top-level object that owns and wires together the core components needed to run a μfem analysis.

It manages the:

  • Domain: holds the mesh and geometric/topological information.
  • Runner: drives execution (initialize(), run(), reset()), e.g. steady or unsteady workflows.
  • Models: define and solve specific physics equations and couple sub-systems.
  • Coefficient functions: represent field quantities over the mesh and provide input data to models.
  • Monitoring and reporting: collect metrics and results and provide structured output for inspection.

A Simulation instance is the main entry point from Python.

Example

import mufem

sim = mufem.Simulation.New("My Example", "data/geometry.mesh")

runner = mufem.SteadyRunner(total_iterations=3)
sim.set_runner(runner)

sim.initialize()
sim.run()