OneSimulation docs Website Free books Plans on Gumroad

Docs › Numerical API reference › onesim.numerics.discretization

B.3 onesim.numerics.discretization

CapabilitySet class

CapabilitySet(features: frozenset[str], guarantees: frozenset[str] = frozenset()) -> None

Describe the feature and guarantee identifiers offered by a provider.

CellAverageProjection class

CellAverageProjection(*, quadrature_order: int | None = None) -> None

Initialize FV cell means by physical volume quadrature. Set quadrature_order when the model needs a different rule.

Methods and properties.

project(*, initial, space, time, linear_solver=None)

Project initial data onto the requested space.

count function

count(value, name, *, minimum=1, maximum=None)

Return a validated built-in integer within inclusive bounds. The name identifies the option in a ValueError.

evaluate_method_provider function

evaluate_method_provider(prototype_id: str, additional: RequirementSet | None = None, *, provider=None, context=None) -> CompatibilityReport

Compare the supplied provider's offer against method requirements and any additional requirements. Returns a compatibility report.

EvaluationCacheControl protocol

EvaluationCacheControl(*args, **kwargs)

Structural port for an operator that exposes evaluation cache controls.

Methods and properties.

invalidate_evaluation_cache() -> None

Invalidate owned evaluation state after an explicit input update.

L2Projection class

L2Projection(*, quadrature_order: int | None = None) -> None

Project initial values by the supported mass solve with a selectable quadrature order.

Methods and properties.

project(*, initial, space, time, linear_solver=None)

Project initial data onto the requested space.

LumpedParameters class

LumpedParameters(*, provider: object | None = None, stability: object | None = None, algebraic_solver: object | None = None) -> None

Choose the zero-dimensional spatial contract for a LumpedMesh. Optional collaborators supply stability or algebraic operations.

Methods and properties.

to_mapping()

Return the mapping representation used for configuration and diagnostics.

MethodProviderOffer class

MethodProviderOffer(provider_id: str, capabilities: CapabilitySet, available: bool | None = None, diagnostics: tuple[str, ...] = (), rejection_kind: str = 'unconfirmed') -> None

Pass a provider's actual capability offer to compatibility evaluation. Availability and diagnostics describe the supplied context.

NodalInterpolation class

NodalInterpolation() -> None

Evaluate initial values at native nodes through the spatial initialization port.

Methods and properties.

project(*, initial, space, time, linear_solver=None)

Project initial data onto the requested space.

NumericalCompatibilityError class

NumericalCompatibilityError(message, *, kind, option, required_capabilities=())

Exception with a machine-readable rejection kind, rejected option and required capabilities.

NumericalExecutionPlan class

NumericalExecutionPlan(plan_id: str, problem_id: str, bindings: tuple[ProviderBinding, ...], stage_requirement_ids: tuple[str, ...], ir_content_sha256: str = '', study_kind: str = 'stationary', equation_ids: tuple[str, ...] = (), term_ids: tuple[str, ...] = (), field_ids: tuple[str, ...] = (), spatial_method_ids: tuple[str, ...] = (), time_method_id: str | None = None, coupling_ids: tuple[str, ...] = (), solver_id: str | None = None, backend_id: str | None = None, term_method_bindings: tuple[tuple[str, str], ...] = (), splitting_id: str | None = None, preconditioner_id: str | None = None, resource_policy_id: str | None = None, requires_spatial_discretization: bool = True, coupling_mode: str = 'fully_coupled', coupling_blocks: tuple[tuple[str, ...], ...] = (), coupling_strategy_id: str | None = None, nonlinear_solver_id: str | None = None, schema_version: str | None = None, component_configurations: tuple[tuple[str, str], ...] = ()) -> None

Inspect the resolved provider and method bindings, study kind, stage requirements, and execution identity.

Methods and properties.

provider_for(requirement_id: str) -> ProviderBinding

Return the binding selected for one IR requirement.

to_dict() -> dict[str, object]

Return the structured dictionary representation.

from_dict(payload: Mapping[str, object]) -> NumericalExecutionPlan

Reconstruct this declaration from the supplied dictionary. content_sha256. Read the content fingerprint of the resolved declaration or plan.

NumericalIR class

NumericalIR(problem_id: str, equation_ids: tuple[str, ...], field_ids: tuple[str, ...], spatial_method_ids: tuple[str, ...], requirements: tuple[NumericalRequirement, ...], stage_requirement_ids: tuple[str, ...] = (), term_ids: tuple[str, ...] = (), time_method_id: str | None = None, coupling_ids: tuple[str, ...] = (), solver_id: str | None = None, backend_id: str | None = None, study_kind: str = 'stationary', schema_version: str = '1.0', term_method_bindings: tuple[tuple[str, str], ...] = (), splitting_id: str | None = None, preconditioner_id: str | None = None, resource_policy_id: str | None = None, requires_spatial_discretization: bool = True, coupling_mode: str = 'fully_coupled', coupling_blocks: tuple[tuple[str, ...], ...] = (), coupling_strategy_id: str | None = None, nonlinear_solver_id: str | None = None, semantic_field_bindings: tuple[tuple[str, str, str], ...] = (), component_configurations: tuple[tuple[str, str], ...] = ()) -> None

Inspect the equation, field, term and method requirements supplied to numerical resolution.

Methods and properties.

to_dict() -> dict[str, object]

Return the complete provider-neutral, canonical serialization.

from_dict(payload: Mapping[str, object]) -> "'NumericalIR'"

Reconstruct this declaration from the supplied dictionary. content_sha256. Read the content fingerprint of the resolved declaration or plan.

Numerics class

Numerics(*, spatial: object, linear_solver: object | None = None, nonlinear_solver: object | None = None, linearized_solver: object | None = None, time_integrator: object | None = None, step_limits: TimeStepLimits = <factory>, coupling: object | None = None, initial_guess: Mapping[FieldRef, object] | None = None, field_scales: Mapping[FieldRef, object] | None = None) -> None

Compose independent spatial, linear, nonlinear, time, and coupling selections. Initial guesses and scales are mappings keyed by owned field references.

OperatorConditions protocol

OperatorConditions(*args, **kwargs)

Structural port for a bound spatial operator's condition evaluation.

Methods and properties.

conditions(time: float) -> tuple

Return (essential constraints, boundary contributions, boundary loads).

OperatorFacetTopology protocol

OperatorFacetTopology(*args, **kwargs)

Structural port for an operator that exposes boundary or facet topology.

Methods and properties.

facet_owners(facet) -> tuple[int, ...]

Return the incident cell IDs used to orient the supplied facet.

RequirementSet class

RequirementSet(required: frozenset[str], preferred: frozenset[str] = frozenset()) -> None

Specify required and preferred feature identifiers for compatibility checks.