mufem.Simulation

class mufem.Simulation

Bases: pybind11_object

Manages domain, runner, materials, reports, and coefficient functions for a μfem simulation.

__init__(self: mufem.Simulation, arg0: str) None

Construct a new Simulation instance.

Parameters:

name (str) – The name of the simulation.

Methods

New(name[, mesh_path, enable_server_mode, ...])

Create a new simulation instance.

__init__(self, arg0)

Construct a new Simulation instance.

get_coefficient_manager(self)

Get the coefficient function manager.

get_domain(self)

Get the simulation domain.

get_field_exporter(self)

Get the field exporter.

get_machine(self)

Get the associated machine context.

get_model_manager(self)

Get the model manager.

get_monitor_manager(self)

Get the monitor manager.

get_name(self)

Get the name of the simulation.

get_report_manager(self)

Get the report manager.

get_runner(self)

Get the simulation runner.

run(self)

Execute the simulation.

set_runner(self, arg0)

Set the simulation runner.

static New(name: str, mesh_path: str | None = None, enable_server_mode: bool = False, periodic: bool = False, print_only_warnings: bool = False) mufem.Simulation

Create a new simulation instance.

Parameters:
  • name (str) – Name of the simulation.

  • mesh_path (Optional[str]) – Optional path to mesh file.

  • enable_server_mode (bool, default=False) – Enable server-based mode for the simulation.

  • periodic (bool, default=False) – Whether the mesh is periodic.

  • print_only_warnings (bool, default=True) – If True, suppress all logs except warnings.

Returns:

A new Simulation instance.

Return type:

Simulation

get_coefficient_manager(self: mufem.Simulation) mufem.CoefficientFunctionManager

Get the coefficient function manager.

Returns:

Manager for coefficient functions used in the simulation.

Return type:

CoefficientFunctionManager

get_domain(self: mufem.Simulation) Domain

Get the simulation domain.

Returns:

The computational domain of the simulation.

Return type:

Domain

get_field_exporter(self: mufem.Simulation) FieldExporter

Get the field exporter.

Returns:

Object responsible for exporting simulation fields.

Return type:

FieldExporter

get_machine(self: mufem.Simulation) mufem.Machine

Get the associated machine context.

Returns:

The machine instance used in the simulation.

Return type:

Machine

get_model_manager(self: mufem.Simulation) mufem.ModelManager

Get the model manager.

Returns:

The model manager is responsible for the models within a simulation.

Return type:

ModelManager

get_monitor_manager(self: mufem.Simulation) mufem.MonitorManager

Get the monitor manager.

Returns:

Manager for monitoring simulation metrics.

Return type:

MonitorManager

get_name(self: mufem.Simulation) str

Get the name of the simulation.

Returns:

The name of the simulation.

Return type:

str

get_report_manager(self: mufem.Simulation) mufem.ReportManager

Get the report manager.

Returns:

Manager for generating simulation reports.

Return type:

ReportManager

get_runner(self: mufem.Simulation) RunnerTrait

Get the simulation runner.

Returns:

The current simulation runner.

Return type:

RunnerTrait

run(self: mufem.Simulation) None

Execute the simulation.

set_runner(self: mufem.Simulation, arg0: RunnerTrait) None

Set the simulation runner.

Parameters:

runner (RunnerTrait) – Runner used to drive the simulation.