実行コンテキストと native kernel

Beach.context は実行結果と設定の解決を保持します。 Beach.kernel() から受け取る kernel はセッションが所有します。 field_kernel_from_result で作る場合は呼び出し側が閉じます。

class beach.analysis.context.RunContext(result, requested_config_path=None)[ソース]

Resolved run plus lazily loaded, cached nearby configuration.

パラメータ:
  • result (RunResult)

  • requested_config_path (Path | None)

classmethod from_value(value, *, config_path=None)[ソース]

Return the context of a result, a context, or a Beach session.

A Beach contributes its own Beach.context, so its config path and cached config carry over. An explicit config_path replaces the inherited one.

パラメータ:
  • value (RunResult | object)

  • config_path (str | Path | None)

戻り値の型:

RunContext

beach.analysis.field_kernel.field_kernel_from_result(result, *, step=-1, periodic2=None, theta=None, leaf_max=None, order=None, config_path=None, library_path=None)[ソース]

Build a native kernel from one BEACH output directory (heavy).

The kernel holds the run's panels with the step charges (-1 latest history snapshot, None final charges.csv). The caller owns it and closes it; beach.Beach.kernel() returns a session-owned, cached one instead.

パラメータ:
  • result (RunResult | object)

  • step (int | None)

  • periodic2 (Mapping[str, object] | None)

  • theta (float | None)

  • leaf_max (int | None)

  • order (int | None)

  • config_path (str | Path | None)

  • library_path (str | Path | None)

戻り値の型:

beach.native.kernel.FieldKernel

class beach.native.periodic2.Periodic2Config(axes, lengths, origins, image_layers, far_correction, ewald_alpha, ewald_layers)[ソース]

Validated periodic2 settings with legacy tuple compatibility.

パラメータ:
  • axes (tuple[int, int])

  • lengths (tuple[float, float])

  • origins (tuple[float, float])

  • image_layers (int)

  • far_correction (str)

  • ewald_alpha (float)

  • ewald_layers (int)

axes: tuple[int, int]

Alias for field number 0

lengths: tuple[float, float]

Alias for field number 1

origins: tuple[float, float]

Alias for field number 2

image_layers: int

Alias for field number 3

far_correction: str

Alias for field number 4

ewald_alpha: float

Alias for field number 5

ewald_layers: int

Alias for field number 6