LoginSignup
0
0

WSLにFlameMasterをインストールする

Posted at

FlameMasterとは

0次元の化学反応と1次元の層流火炎の計算のためのオープンソースのC++プログラムパッケージ.
Google Scholarで調べると乱流燃焼のLESのためのFlamelet Libraryを作成するためによく用いられている.

公式サイト

ダウンロード

ダウンロード先

You can request a login here. のリンクを押すと,ログインのリクエストができるので適宜情報を入力する.
一定期間後にメールが届くので,メールに従ってダウンロード画面でidとパスワードを入力すると,ダウンロードできる.
ダウンロードできたzipファイルを解凍すると,FlameMaster/Repositoryというフォルダ構成になっており,任意の場所に保存して作業する

インストール

ダウンロードしたフォルダのREADME.mdを参考にするが,その前に必要なパッケージをインストールしておく.
doc\LINUX_Prerequisites.mdに記載されている以下のコマンドを実行しておく.

sudo apt-get install git cmake flex bison libsundials-dev g++ gfortran 

これでcmakeなどの必要なパッケージがそろったのでインストールしていく.
先ほどダウンロードしたFlamemasterのフォルダにcdで移動し,以下を実行する

mkdir -p Build && cd Build
cmake ../Repository -DCMAKE_BUILD_TYPE=Release
cmake --build . --parallel --target install --config Release

ここでエラーが出なければ,以下を実行するとビルドとインストールができる.

make

エラー処理

自分の環境ではcmakeの実行時に以下のエラーが出た.

CMake Error at CMakeLists.txt:74 (message):
  In-source builds are not allowed.

一度間違った場所でcmakeを実行したときのキャッシュが残っていたことが原因らしく,この記事を参考に,以下のコマンドを実行してキャッシュを削除することで解消できた.

rm ../Repository/CMakeCache.txt

サンプルの実行

以下のスクリプトを実行することで,環境の設定をできる.シェルの種類によって実行するスクリプトが異なるが,bashならば以下を実行する.

source Bin/bin/Source.bash

fmagainというコマンドで環境変数とaliasを表示させることができる.

/mnt/d/FlameMaster$ fmagain

>> 実行結果
#########################################################################
Setting up environment for FlameMaster, version 4.2.1
#########################################################################

'fmagain' can be used to run this script again in verbose mode

Setting up locations...
export FM_PATH=/mnt/d/FlameMaster/Bin/bin/../..
export FM_DATA=/mnt/d/FlameMaster/Build/../Data
export myData=/mnt/d/FlameMaster/Build/../Data
export FM_RUN=/mnt/d/FlameMaster/Bin/bin/../../Run
export FM_RUN_FM=/mnt/d/FlameMaster/Bin/bin/../../Run/FlameMan
export FM_RUN_SM=/mnt/d/FlameMaster/Bin/bin/../../Run/ScanMan
export FM_BIN=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin
export FM_LIB=/mnt/d/FlameMaster/Bin/bin/../../Bin/lib

Creating alias commands...
alias FlameMan=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin/FlameMan
alias FlameMaster=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin/FlameMan
alias ScanMan=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin/ScanMan
alias CreateBinFile=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin/CreateBinFile
alias ListTool=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin/ListTool -M
alias LT=/mnt/d/FlameMaster/Bin/bin/../../Bin/bin/ListTool -M

インストール時に自動で作成されるRunというフォルダに計算のサンプルがある.
Runのフォルダをたどっていくと,サンプルを実行するbashのスクリプトが存在するので実行し,インストールが出来ていることを確認した.

/mnt/d/FlameMaster/Run/FlameMan/Diff/Steady$ bash RunSteadyDiff.bash >log.RUnSteadyDiff.bash 2>&1
0
0
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
0
0