4
6

More than 5 years have passed since last update.

VTKFortranの紹介

Posted at

はじめに

可視化フォーマットであるVTKをFortranから使用できるライブラリであるVTKFortranについて紹介する.

ライブラリについて

VTKFortranはStefano Zaghi氏によって開発されているFortran用のライブラリである.
構造格子,非構造格子の両方に対応しており,XML形式で出力が可能であり,並列化にも対応している.
ライセンスについては修正BSDライセンス(2,3)とMITライセンスが提示されている.
備忘録的ではあるが,インストールまでを記載することにする.

インストール

ソースコードはgithubから入手可能である.

git clone --recursive https://github.com/szaghi/VTKFortran.git
cd VTKFortran
git submodule update --init --recursive

今回はmakeを用いた場合のコンパイル方法について書く.
makefile内でフラグが宣言されているので編集する.

# User options
TESTS    = no
SHARED   = no
STATIC   = yes 
COMPILER = gnu
DEBUG    = no
F03STD   = no
OPTIMIZE = no
OPENMP   = no
MPI      = no
R16P     = no

今回はintelコンパイラを使いたいので以下のようにした.

COMPILER = intel

あとはmakeを叩くだけである.

make

作成されたライブラリはstaticの中に作成される.

.
|-- libvtkfortran.a
|-- mod
`-- obj

自作のソフトに使用したい場合はmodフォルダとlibvtkfortran.aをリンクする.

終わりに

今回はコンパイルまでの紹介となったが,src/test内にテストコードがあるようである.

4
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
6