Skip to main content

Wrapper of velocity distribution solver written in Fortran

Project description

vdist-solver-fortran

Lang: 日本語 | English

DOI CI PyPI version

Fortran で実装した速度分布ソルバを Python から利用するためのパッケージです。

コアは EMSES 計算結果の上でバックトレース (時間逆行) と、境界に紐付けた ソース分布 (Maxwellian、raycast 光電子、吸収) を組み合わせて位相空間 確率密度を評価します。共有ライブラリを ctypes ラッパ経由で Python から駆動する構成です。

必要環境

  • gfortran
  • make
  • fpm
  • Python 3.7 以上 (開発は .venv/ 内の 3.12 で実施)

インストール

PyPI からのインストールを推奨します。pip のビルド中に make install が 走り、Fortran 共有ライブラリをビルドして Python package に同梱します。

[!Note] macOS でもビルド自体は通る想定ですが CI では検証していません。

python -m pip install -U pip setuptools wheel
python -m pip install vdist-solver-fortran

開発版を GitHub から直接入れることもできます。

python -m pip install "git+https://github.com/Nkzono99/vdist-solver-fortran.git"

pip 経由のビルドでは既定で INSTALL_PROFILE=auto を使います。必要なら INSTALL_PROFILE=genericINSTALL_PROFILE=camphor を環境変数で 指定してください。

INSTALL_PROFILE=generic python -m pip install vdist-solver-fortran

クイックスタート

import emout
from vdsolverf.core import Particle
from vdsolverf.emses import get_backtrace

data = emout.Emout("EMSES-simulation-directory")

ts, probability, positions, velocities = get_backtrace(
    directory=data.directory,
    ispec=0,                             # 0 電子, 1 イオン, 2 光電子
    istep=-1,
    particle=Particle([32, 32, 400], [0, 0, -10]),
    dt=data.inp.dt,
    max_step=300_000,
    output_interval=1,
    use_adaptive_dt=False,
)

光電子の評価には EMSES の namelist /emissn/use_raycast = .true. を設定する必要があります。詳細は Namelist リファレンス を参照。

ドキュメント

ドキュメント 概要
使用方法 Python レシピ集: 単一/多粒子バックトレース、位相空間確率
速度空間 Octree 確率ソルバ adaptive/sparse な速度空間探索、アルゴリズム、実行方法、sample/leaf 出力
速度範囲自動推定 セルごとの速度範囲推定、validation、diagnostics
Namelist リファレンス サポートしている plasma.inp のグループとパラメータ
物理モデル リウビル定理、Maxwellian 放出、raycast 光電子
アーキテクチャ Fortran / Python レイアウト、モジュール依存、拡張ポイント
開発ガイド ビルド、テスト、貢献手順

サンプルノートブック

ライセンス

Apache License 2.0。詳細は LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vdist_solver_fortran-1.6.0.tar.gz (119.2 kB view details)

Uploaded Source

File details

Details for the file vdist_solver_fortran-1.6.0.tar.gz.

File metadata

  • Download URL: vdist_solver_fortran-1.6.0.tar.gz
  • Upload date:
  • Size: 119.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vdist_solver_fortran-1.6.0.tar.gz
Algorithm Hash digest
SHA256 cca74e2c620093d6d052bccb54405b63d25a3e9993197439405cddc0f58e2838
MD5 40b237b72c024b23b688b92c928bbf3c
BLAKE2b-256 5927921faa852e5538a7609db33562e8f89c749087a0bfce7a2c9b31f512f6d0

See more details on using hashes here.

Provenance

The following attestation bundles were made for vdist_solver_fortran-1.6.0.tar.gz:

Publisher: publish-pypi.yml on Nkzono99/vdist-solver-fortran

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page