Source code for neofoam.framework.context

# SPDX-License-Identifier: GPL-3.0-or-later
#
# SPDX-FileCopyrightText: 2023 NeoFOAM authors

"""Simulation context: shared field/model state passed through operations."""

from __future__ import annotations

from typing import Any

from pydantic import BaseModel


[docs] class FieldUpdates(dict[str, Any]): """ A dictionary that collects the pending field updates for Context.fields. """ pass
[docs] class Context(BaseModel): """ The Context object holds the state of the framework at a given point in time. It contains fields and models that are used by various components of the framework. The relevant fields or models are injected into the operations """ model_config = {"arbitrary_types_allowed": True} fields: dict[str, Any] models: dict[str, Any] mesh: Any = None runtime: Any = None