autopdex.SimState.add_model

SimState.add_model(domain_name: str | list[str], domain_type: str, integrand_fun: Callable, integration_order: int | None = None, int_pts_and_weights: Dict[str, Any] | None = None, internal_variables: str | List[str] | Tuple[str, ...] | None = None, internal_variable_update_fun: Callable | None = None)[source]

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

The contribution is integrated over the named domain(s); connectivity and quadrature kernels are built lazily in initialize(...).

Parameters:
  • domain_name – Domain name or list of names, looked up in mesh_info.domains.

  • domain_type"weak form" for a residual integrand, or "potential" for a scalar potential/energy integrand that is differentiated automatically.

  • integrand_funModelContext callable returning the integrand (see models).

  • integration_order – Quadrature order; if None a default is derived from the field spaces.

  • int_pts_and_weights – Optional quadrature: None (defaults), a dict keyed by cell type (e.g. "triangle6" or base "triangle"), or an explicit (xi, w) pair.

  • internal_variables – Internal variable field name(s) this model reads/updates, if any.

  • internal_variable_update_fun – Optional ModelContext callable that updates those internal variables after a step; requires internal_variables.