autopdex.SimState

class autopdex.SimState(spatial_discretizations: Dict[str, Any])[source]

AutoPDEx high-level interface (HLI): orchestrator of the simulation workflow.

SimState encapsulates the complete simulation workflow (mesh import -> domain/BC/model registration -> DOF numbering -> assembly setup -> time integration) as a state machine. The object is registered as a JAX pytree and the run method is transformable via jit, jacfwd or jacrev.

__init__(spatial_discretizations: Dict[str, Any])[source]
Parameters:

spatial_discretizations – Dict mapping field name -> FE space object (e.g. Lagrange(…)). These are treated as global / fixed for the SimState instance.

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__getstate__()

Helper for pickle.

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(*args, **kwargs)

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_add_boundary_domain_to_state(...[, cell_dim])

_add_domain(domain_name, on_domain_fun[, ...])

Add a domain by grouping existing cells via a predicate on node coordinates.

_add_model_materialized(domain_name, ...[, ...])

Register a new model on a given domain (volume or surface).

_add_nodal_dirichlet_spec(field, ...)

Register a point (0-dimensional-boundary) Dirichlet condition.

_add_nodal_load_spec(field, on_boundary_fun, ...)

Register a point (0-dimensional-boundary) weak BC / nodal load.

_apply_initial_derivatives(derivatives)

_apply_internal_variable_initial_values(...)

_apply_manual_initial_conditions(*[, ...])

_apply_pending_initial_conditions()

_apply_primary_initial_values(values, ...)

_apply_restart_state(result)

_build_geometry_output_set_infos(domain_name, *)

_build_preview_trial_ansatz(set_info, ...)

_build_projection_source_connectivity(field, ...)

_cleanup_after_prepare()

Release the mesh/FE build data once the runtime is materialized.

_clear_output_projection_state()

_clear_postprocessing_callbacks()

_clear_projection_caches()

Drop the geometry-derived projection/boundary caches.

_coerce_local_initial_guess(projector, ...)

_ensure_all_boundary_mesh_info()

Return the single mesh_info that already carries all boundary facets.

_ensure_fe_built()

Build global DOF containers and connectivity tables for all fields once.

_ensure_projector_cache()

_enter_registration_phase(method_name, *[, ...])

_evaluate_registered_outputs(dofs, settings)

_geometry_projection_core_cache_key(...)

_has_active_vtu_postprocessing_policy()

_has_internal_variable_updates()

_infer_output_shapes(core_projector, output_fun)

_install_internal_variable_update_callback()

_install_nodal_load_callback()

Install external nodal loads into the manager's residual (point weak BCs).

_install_projected_dirichlet_callback()

_l2_project(*[, field, domain_name, ...])

_make_boundary_point_selector(on_boundary_fun)

_materialize_local_subsystem_solvers()

_materialize_model_specs()

_materialize_output_specs()

_materialize_projected_dirichlet_runtime()

_materialize_projected_dirichlet_specs()

_materialize_projected_ic_runtime()

_materialize_projected_ic_specs()

_mesh_top_dim()

_prepare_boundary_l2_projection(field, ...)

_prepare_geometry_output_core(domain_name, ...)

_prepare_l2_projection(field, domain_name, *)

_prepare_vtu_model_output_group(spec, layouts)

_prepare_vtu_output_group(projector, ...)

_prepare_vtu_postprocessing_policy()

_primary_domain_scalar_ids(field, domain_name)

_rebuild_mesh_info_from_source()

_require_initialized_phase(method_name)

_require_mesh_editable(method_name)

_require_prepared_phase(method_name)

_reset_discretization_dependent_caches()

Invalidate everything that depends on the FE discretization.

_resolve_nodal_dirichlet(spec)

Resolve a nodal Dirichlet spec to (field, scalar_dof_ids, coords, mask).

_resolve_source_fields_and_connectivity(...)

_resolve_source_fields_and_connectivity_cached(...)

_run_attr(name[, default])

_scatter_local_projection(projector, ...)

_set_active_domains(active_domains)

Set per-field active volume domains used to build global DOF numbering.

_solve_grouped_output_projection(spec, ...)

_source_bases_for_projection(projector, ...)

_source_sets_for_projection(projector, ...)

_store_raw_callable_ic_spec(projector_name, ...)

_temporary_boundary_mesh_info(...)

_tree_flatten(obj)

_tree_unflatten(aux_data, children)

_validate_integrator_compatibility()

Check that the configured time integrators are mutually compatible.

_write_vtu([path, dofs, settings, output_fields])

Write the current mesh together with registered projected outputs to a VTU file.

add_domain(domain_name, on_domain_fun[, ...])

Group existing cells into a named (sub)domain via a coordinate predicate.

add_local_subsystem(key, local_dae, fields, ...)

Register a local (element-level) DAE subsystem for internal variables.

add_model(domain_name, domain_type, ...[, ...])

Register a model (weak form or potential) on one or more domains.

add_strong_bc(field, on_boundary_fun, value_fun)

Register a strong boundary condition via an internal L2 projection on the selected boundary trace.

add_structured_mesh(n_elements, vertices, ...)

Generate a structured 2D or 3D mesh over a quadrilateral or hexahedral domain, with an optional subdivision into simplex (triangular/tetrahedral) elements.

add_temporal_discretization(...)

Assign a time-integration scheme to each field.

add_weak_bc(field, on_boundary_fun, value_fun)

Add a weak boundary condition as a convenience wrapper around a surface weak form.

import_mesh(mesh[, deduplicate_points, ...])

Load mesh data from a meshio mesh object.

initialize([verbose])

Finalize the input state and set up the time stepping manager.

prepare([clean_up])

Prepare the initialized simulation for run(...).

run(dt0, time_span, num_time_steps, *[, ...])

Run the prepared simulation over a time span and return the updated SimState.

set_active_domains(active_domains)

Restrict each field to a subset of volume domains.

set_dof_scaling([scales])

Configure constant per-field DOF scaling.

set_initial_conditions([values, ...])

Set domain-wise initial values or restart from a TimeSteppingManagerState.

set_postprocessing_policy([policy, ...])

Configure dae.SavePolicy for VTU/PVD output during run(...).

set_root_solver(root_solver)

Configure the root solver used by the global time stepping manager.

set_step_size_controller([controller])

Configure the dae.StepSizeController used by the global time stepping manager.

Attributes

__annotations__

__dict__

__doc__

__module__

__weakref__

list of weak references to the object

controller_state

dt

history

num_accepted

num_rejected

num_steps

q