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 レシピ集: 単一/多粒子バックトレース、位相空間確率
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.5.0.tar.gz (72.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: vdist_solver_fortran-1.5.0.tar.gz
  • Upload date:
  • Size: 72.0 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.5.0.tar.gz
Algorithm Hash digest
SHA256 399c547c345bde068cac6411587301d5c5564e8b3eea779ae7ef768898c051f7
MD5 8d986ec8557d862e510a0ddaaafe5171
BLAKE2b-256 f6d16049269b001b7966da884fe052d60c41ca1eb45bcbe60bca02df5acb5c70

See more details on using hashes here.

Provenance

The following attestation bundles were made for vdist_solver_fortran-1.5.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