スタートアップガイド

Python環境でPVGeoを使用する

ParaViewを使用せずにPython(>=3.6)でPVGeoを使用する場合は、アクティブなPython環境にPVGeoをインストールするだけです (Python2環境でのPVGeoの使用は、ParaViewのビルドに直接含まれていない限りサポートされません)。

pip 経由でPVGeoをインストール:

pip install PVGeo

必要な依存関係

オプションの依存関係

PVGeoには、必要のない依存関係がいくつかあります。これらの依存関係によって、使用可能なアルゴリズムや機能を増やすことができます。すべての要件はリポジトリの requirements.txt ファイルにありますが、PVGeoが動作するために必要な要件はPVGeoとともにインストールされます。いくつかの有用な依存関係:

  • discretize: discretize の有限体積コードとファイルIOメソッドを利用するアルゴリズムを追加します。

  • pyproj: 座標変換を実行できるアルゴリズムを追加します

  • omfomfvista: Open Mining Format(OMF)をサポート

ParaViewでPVGeoを使用する

ParaViewのグラフィカルユーザインタフェースでPVGeoを直接使用したい場合は、このセクションの残りの手順を慎重に実行する必要があります。この手順では、ParaViewのインストールで共有される独立 Python2.7環境 を設定しています。この環境を作成した後は、この環境をそのままにして、日常的に使用するPython環境用の上記のセクションの手順に従ってPVGeoをインストールする必要があります。

ParaViewの簡単な紹介

ParaViewは、2D、3D、4D(時間的に変化する)のデータセットを視覚化できるオープンソースプラットフォームです。 ParaViewは、複数の非常に大きなデータセットを並行して処理し、その結果を後で収集して、ユーザーが操作できる応答性の高いグラフィックス環境を生成することができます。 ソフトウェアをホストするマシンのプロセッサとグラフィックスハードウェアが優れていればいるほど、ParaViewの実行速度とパフォーマンスは向上します。しかし、MacBook Proのような標準的なグラフィックスカードを搭載したラップトップでは非常にうまく動作します。

ParaViewはオープンソースのアプリケーションなので、誰でもプログラムとそのソースコードをダウンロードして修正することができます。 ParaViewを使い始める最も簡単な方法は、 ご使用のオペレーティングシステム用のコンパイル済みバイナリインストーラをダウンロードします を使うことです。

詳細については、Kitware提供の 文書 を参照してください。特に、ParaViewの簡単なツアーを見る価値のある2つは The ParaView GuideThe ParaView Tutorial です。 1つはParaViewソフトウェアのチュートリアルで、ソースの作成方法やフィルタの適用方法などを説明しています。もう1つはスクリプト、マクロ、アプリケーションのより高度な使い方などを説明したガイドです。

ParaViewをインストールする

ParaView5.6.x(またはそれ以降)用に ParaView's website からダウンロードしたインストーラを開き、インストーラのプロンプトに従います。

アプリケーションのGUI環境の詳細については、 The ParaView Tutorial のセクション2.1を参照してください。チュートリアルの第2章全体では、ソフトウェアとその一般的な機能に慣れていない人のために、ソフトウェアとそのワークフローを詳しく説明しています。

便利な機能の1つは、ParaView環境の状態を保存することです。これにより、一部のデータを視覚化するために適用したすべてのフィルタに対して選択したすべてのオプションが保存されます。 File->Save State… を選択 (注:*これにより、ParaViewにロードされたファイルの絶対パスが保存されます。したがって、これらの状態ファイルを開くときは、必ず *Search for Files Under Directory... を選択してください。)。

Install PVGeo

Anacondaを使用してPython仮想環境を管理することを強くお勧めします。また、AnacondaによるインストールPythonディストリビューションは、Mac、Windows、およびLinuxオペレーティングシステム上で動作することがわかっています。 PVGeo Pythonパッケージの使用を開始するには、新しい仮想環境を作成し、pipを使用して PVGeo をインストールします。

$ conda create -n pvgeoenv python=2.7

PVGeoをParaViewにリンクする場合は、 Python 2.7 仮想環境を使用する必要があります。この2.7環境を作成すると、PVGeoとその依存関係を保持してParaViewで使用する場合にのみ必要なので、再度使用しないこともできます。ParaView以外でPVGeoを使用する場合は、Pythonのどのバージョンでも使用できます(Windows上のPython2.xを除く)。

$ source activate pvgeoenv
(pvgeoenv) $ pip install PVGeo

Windows以外のユーザー

次に、仮想環境にVTKをインストールする必要があります。LinuxおよびMacユーザの場合は、 pip 経由でVTKをインストールします。

# Now install VTK
(pvgeoenv) $ pip install vtk

Windowsではどうですか?ParaViewで使用するためにPVGeoをインストールする場合、VTK PythonパッケージはParaViewインストールの下で使用でき、PVGeoはそのライブラリを使用します。ParaView以外のWindowsでPVGeoを使用する場合は、Python>=3.6バージョンを使用し、VTKを conda または pip 経由でインストールする必要があります。

PVGeoをParaViewにインストールする

ParaViewの最新リリースを使用する: PVGeoは、バージョン5.6.x (と以降) のParaViewとのみ互換性があります。 ParaViewダウンロードページ があります

ParaViewで PVGeo ライブラリをプラグインとして使用するには、 PVGeo をインストールした仮想環境をParaViewのPython環境にリンクし、 PVGeo コード・ベースをParaViewのグラフィカル・ユーザー・インターフェースでラップする一連のプラグイン・ファイルをロードする必要があります。

PVGeo のリンク

まず、 PVGeo の仮想環境をParaViewにリンクし、 PYTHONPATHPV_PLUGIN_PATH 環境変数を設定します。まず、必要なパスを PVGeo から取得します。コマンドラインから次のコマンドを実行します。

(pvgeoenv) $ python -m PVGeo install

注釈

何か問題でも?

次のコマンドを実行して、ランチャーの作成をデバッグしてみてください (これは、問題を作成する場合に役立ちます):

`bash (pvgeoenv) $ python -m PVGeo install echo `

Mac OSユーザ

上記のスクリプトは、これから環境変数に設定する必要があるパスを出力します。Mac OS Xコンピュータを使用している場合、このスクリプトはインストール用に実行するシェルコマンドを出力します。Macの場合は、そのコマンドを実行して [プラグインのロード](#loading-the-plugins) にスキップします。

Windowsユーザー

環境変数の設定は、Windowsでは少し複雑です。どうやって python -m PVGeo install を走らせたか覚えてる?デスクトップに PVGeoLauncher.bat という新しいファイルができました。このファイルを使用して、環境変数が適切に設定された独自の環境であるParaViewを安全に起動します。

  1. デスクトップに移動して右クリックし、 New->Shortcut を選択します。

2. Browse... to the PVGeoLauncher.bat on your Desktop. Not sure where this file is? Check the output of the install command from above.

3. Click Next and give your shortcut a meaningful name like ParaView+PVGeo and select Finish.

  1. 新しく作成したショートカットを右クリックし、 Properties を選択します。

5. For the Start in field, we will use the path to your ParaView installation (top-level). To discover this, go to where ParaView is installed. Likely in C:\Program Files and find the ParaView 5.6-xxxxxx folder. Go into that folder and then copy the full path by copying the path in the navigation bar at the top of the window. Paste this path into the Start in field.

  1. ApplyOkay の順にクリックします。

  2. 新しいショートカットを使用してParaViewを起動してください。

6. Test that the install worked: open the Python Shell and import the modules delivered in this repo by executing import PVGeo and import pvmacros. Errors should not arise but if they do, seek help via the Slack community.

プラグインのロード

Now you must load the plugin files through ParaView's Plugin Manager. Select Tools -> Manage Plugins then select Load New on the bottom right of the popup dialog. Navigate to the directory declared in PV_PLUGIN_PATH and load the plugins files. Note that we have included a file called PVGeo_All.py; this will load all of PVGeo's Plugins for convenience. If you wish only to load specific suites, then load the desired suites by their individual plugin .py files. Once the plugins are loaded, expand them in the plugin manager and be sure to select Auto Load.

エラー

Not sure where your PV_PLUGIN_PATH is located?

Re-run the install command with an additional argument echo:

(pvgeoenv) $ python -m PVGeo install echo
../_images/plugin-manager.png

Now test that the install worked by ensuring the various categories for the PVGeo filters are in the Filters menu such as PVGeo General Filters. Errors should not arise but if they do, post to the issues page and the errors will be immediately addressed.

注釈

If an error arises or you are having trouble, feel free to join the PVGeo community on Slack and ask for help

You can also post to the issues page if you think you are encountering a bug.

Using Outside Modules in ParaView

If you installed PVGeo according to the instructions above, then any Python package installed through pip/conda in that virtual environment will be accessible in ParaView. For some further reading on using virtual environments with ParaView, see this blog post

Update PVGeo

Use pip to update PVGeo in your python environment(s):

(pvgeoenv) $ pip install --upgrade PVGeo